Comparing version 2.0.2 to 2.0.3
@@ -85,3 +85,6 @@ (function(undefined) { | ||
// If `force === true`, bruteforce the path without throwing errors. | ||
if (!hasOwnProp.call(current, piece) || current[piece] === undefined || (typeof current[piece] !== 'object' && options && options.force === true)) { | ||
if ( | ||
!hasOwnProp.call(current, piece) | ||
|| current[piece] === undefined | ||
|| ((typeof current[piece] !== 'object' || current[piece] === null) && options && options.force === true)) { | ||
current[piece] = {}; | ||
@@ -95,3 +98,3 @@ } | ||
// We do not overwrite existing path pieces by default | ||
if (typeof current[piece] !== 'object') { | ||
if (typeof current[piece] !== 'object' || current[piece] === null) { | ||
throw new Error('Target key "' + piece + '" is not suitable for a nested value. (It is in use as non-object. Set `force` to `true` to override.)'); | ||
@@ -98,0 +101,0 @@ } |
{ | ||
"name": "dottie", | ||
"version": "2.0.2", | ||
"version": "2.0.3", | ||
"devDependencies": { | ||
@@ -5,0 +5,0 @@ "chai": "^4.2.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
10256
184