Comparing version 10.0.2 to 10.0.3
@@ -102,3 +102,3 @@ "use strict"; | ||
}); | ||
ajv_formats_1.default(ajv); | ||
(0, ajv_formats_1.default)(ajv); | ||
const schema = { | ||
@@ -283,3 +283,3 @@ type: 'object', | ||
catch (error) { | ||
if (error.code === 'ENOENT') { | ||
if ((error === null || error === void 0 ? void 0 : error.code) === 'ENOENT') { | ||
this._ensureDirectory(); | ||
@@ -320,2 +320,3 @@ return createPlainObject(); | ||
else { | ||
// TODO: Remove this in the next major version. | ||
const decipher = crypto.createDecipher(encryptionAlgorithm, __classPrivateFieldGet(this, _Conf_encryptionKey, "f")); | ||
@@ -336,3 +337,3 @@ data = Buffer.concat([decipher.update(Buffer.from(data)), decipher.final()]).toString('utf8'); | ||
const newValue = getter(); | ||
if (util_1.isDeepStrictEqual(newValue, oldValue)) { | ||
if ((0, util_1.isDeepStrictEqual)(newValue, oldValue)) { | ||
return; | ||
@@ -383,3 +384,3 @@ } | ||
// (even though to the same directory), so we fall back to non atomic write | ||
if (error.code === 'EXDEV') { | ||
if ((error === null || error === void 0 ? void 0 : error.code) === 'EXDEV') { | ||
fs.writeFileSync(this.path, data); | ||
@@ -386,0 +387,0 @@ return; |
{ | ||
"name": "conf", | ||
"version": "10.0.2", | ||
"version": "10.0.3", | ||
"description": "Simple config handling for your app or module", | ||
@@ -45,4 +45,4 @@ "license": "MIT", | ||
"dependencies": { | ||
"ajv": "^8.1.0", | ||
"ajv-formats": "^2.0.2", | ||
"ajv": "^8.6.3", | ||
"ajv-formats": "^2.1.1", | ||
"atomically": "^1.7.0", | ||
@@ -72,3 +72,3 @@ "debounce-fn": "^4.0.0", | ||
"tsd": "^0.14.0", | ||
"typescript": "^4.2.4", | ||
"typescript": "^4.4.3", | ||
"xo": "^0.38.2" | ||
@@ -75,0 +75,0 @@ }, |
@@ -173,8 +173,6 @@ # conf | ||
This can be used to secure sensitive data **if** the encryption key is stored in a secure manner (not plain-text) in the Node.js app. For example, by using [`node-keytar`](https://github.com/atom/node-keytar) to store the encryption key securely, or asking the encryption key from the user (a password) and then storing it in a variable. | ||
Note that this is **not intended for security purposes**, since the encryption key would be easily found inside a plain-text Node.js app. | ||
In addition to security, this could be used for obscurity. If a user looks through the config directory and finds the config file, since it's just a JSON file, they may be tempted to modify it. By providing an encryption key, the file will be obfuscated, which should hopefully deter any users from doing so. | ||
Its main use is for obscurity. If a user looks through the config directory and finds the config file, since it's just a JSON file, they may be tempted to modify it. By providing an encryption key, the file will be obfuscated, which should hopefully deter any users from doing so. | ||
It also has the added bonus of ensuring the config file's integrity. If the file is changed in any way, the decryption will not work, in which case the store will just reset back to its default state. | ||
When specified, the store will be encrypted using the [`aes-256-cbc`](https://en.wikipedia.org/wiki/Block_cipher_mode_of_operation) encryption algorithm. | ||
@@ -181,0 +179,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
719
46192
389
Updatedajv@^8.6.3
Updatedajv-formats@^2.1.1