electron-settings
Advanced tools
Comparing version 3.1.3 to 3.1.4
@@ -301,7 +301,8 @@ /** | ||
* @param {string} keyPath | ||
* @param {any} [defaultValue] | ||
* @param {any} defaultValue | ||
* @param {Object} opts | ||
* @returns {any} | ||
* @private | ||
*/ | ||
_getValueAtKeyPath(keyPath, defaultValue) { | ||
_getValueAtKeyPath(keyPath, defaultValue, opts) { | ||
const obj = this._readSettings(); | ||
@@ -316,3 +317,3 @@ | ||
if (!exists && typeof defaultValue !== 'undefined') { | ||
this._setValueAtKeyPath(keyPath, defaultValue); | ||
this._setValueAtKeyPath(keyPath, defaultValue, opts); | ||
@@ -424,9 +425,10 @@ // Get the new value now that the default has been set. | ||
* @param {any} [defaultValue] | ||
* @param {Object} [opts={}] | ||
* @returns {any} | ||
* @public | ||
*/ | ||
get(keyPath, defaultValue) { | ||
get(keyPath, defaultValue, opts = {}) { | ||
assert.strictEqual(typeof keyPath, 'string', 'First parameter must be a string. Did you mean to use `getAll()` instead?'); | ||
return this._getValueAtKeyPath(keyPath, defaultValue); | ||
return this._getValueAtKeyPath(keyPath, defaultValue, opts); | ||
} | ||
@@ -433,0 +435,0 @@ |
{ | ||
"name": "electron-settings", | ||
"version": "3.1.3", | ||
"version": "3.1.4", | ||
"description": "A simple persistent user settings framework for Electron.", | ||
@@ -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
21658
654