Apply suggestions from code review

Co-Authored-By: Mikunj <Mikunj@users.noreply.github.com>
This commit is contained in:
Beaudan Campbell-Brown 2018-12-10 14:44:56 +11:00 committed by GitHub
parent 7d0d244e7c
commit 1303603db9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -193,7 +193,7 @@ async function setupSQLCipher(instance, { key }) {
const deriveKey = HEX_KEY.test(key);
// https://www.zetetic.net/sqlcipher/sqlcipher-api/#key
const value = deriveKey ? `'${key}'` : `"x'${key}'"`
const value = deriveKey ? `'${key}'` : `"x'${key}'"`;
await instance.run(`PRAGMA key = ${value};`);
}
@ -204,7 +204,7 @@ async function setSQLPassword(password) {
// If the password isn't hex then we need to derive a key from it
const deriveKey = HEX_KEY.test(password);
const value = deriveKey ? `'${password}'` : `"x'${password}'"`
const value = deriveKey ? `'${password}'` : `"x'${password}'"`;
await db.run(`PRAGMA rekey = ${value};`);
}