node-cipher
Advanced tools
Comparing version 6.3.0 to 6.3.1
@@ -125,3 +125,7 @@ /** | ||
_initConfig() { | ||
this._config = rc(APP_NAME, NodeCipher.Defaults); | ||
let defaults = _.clone(NodeCipher.Defaults); | ||
let properties = _.keys(NodeCipher.Defaults); | ||
let config = rc(APP_NAME, defaults); | ||
this._config = _.pick(config, properties); | ||
} | ||
@@ -477,3 +481,5 @@ | ||
}); | ||
} else if (!_.isString(val)) { | ||
} | ||
if (!_.isString(val)) { | ||
errors.push({ | ||
@@ -489,3 +495,3 @@ option: key, | ||
/** | ||
* Validates an option that is required and must be an integer. | ||
* Validates an option that is required and must be a string or a Buffer. | ||
* | ||
@@ -497,3 +503,3 @@ * @param {string} key | ||
*/ | ||
_validateRequiredInteger(key, val) { | ||
_validateRequiredStringOrBuffer(key, val) { | ||
let errors = []; | ||
@@ -506,6 +512,8 @@ | ||
}); | ||
} else if (!_.isInteger(val)) { | ||
} | ||
if (!_.isString(val) && !Buffer.isBuffer(val)) { | ||
errors.push({ | ||
option: key, | ||
message: `"${key}" must be an integer. Got "${typeof val}"` | ||
message: `"${key}" must be a string or buffer. Got "${typeof val}"` | ||
}); | ||
@@ -518,3 +526,3 @@ } | ||
/** | ||
* Validates an option that is required and must be a string or a Buffer. | ||
* Validates an option that is required and must be an integer. | ||
* | ||
@@ -526,3 +534,3 @@ * @param {string} key | ||
*/ | ||
_validateRequiredStringOrBuffer(key, val) { | ||
_validateRequiredInteger(key, val) { | ||
let errors = []; | ||
@@ -535,6 +543,8 @@ | ||
}); | ||
} else if (!_.isString(val) && !Buffer.isBuffer(val)) { | ||
} | ||
if (!_.isInteger(val)) { | ||
errors.push({ | ||
option: key, | ||
message: `"${key}" must be a string or buffer. Got "${typeof val}"` | ||
message: `"${key}" must be an integer. Got "${typeof val}"` | ||
}); | ||
@@ -563,3 +573,5 @@ } | ||
}); | ||
} else if (!_.isString(val)) { | ||
} | ||
if (!_.isString(val)) { | ||
errors.push({ | ||
@@ -569,3 +581,5 @@ option: key, | ||
}); | ||
} else if (!_.includes(ALL_HASHES, val)) { | ||
} | ||
if (!_.includes(ALL_HASHES, val)) { | ||
errors.push({ | ||
@@ -597,3 +611,5 @@ option: key, | ||
}); | ||
} else if (!_.isString(val)) { | ||
} | ||
if (!_.isString(val)) { | ||
errors.push({ | ||
@@ -603,3 +619,5 @@ option: key, | ||
}); | ||
} else if (!_.includes(ALL_CIPHERS, val)) { | ||
} | ||
if (!_.includes(ALL_CIPHERS, val)) { | ||
errors.push({ | ||
@@ -636,4 +654,4 @@ option: key, | ||
* - decrypt() | ||
* - encryptSync() | ||
* - decryptSync() | ||
* - encryptSync():Object | ||
* - decryptSync():Object | ||
* - listAlgorithms():Array | ||
@@ -640,0 +658,0 @@ * - listHashes():Array |
{ | ||
"name": "node-cipher", | ||
"version": "6.3.0", | ||
"version": "6.3.1", | ||
"description": "Securely encrypt sensitive files for use in public source control.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
37817
1051