just-safe-set
Advanced tools
Comparing version 1.0.0 to 1.1.0
10
index.js
@@ -19,2 +19,7 @@ module.exports = set; | ||
obj4; // {a: {aa: {bbb: 7}}} | ||
const obj5 = {a: {}}; | ||
const sym = Symbol(); | ||
set(obj5.a, sym, 7); // true | ||
obj5; // {a: {Symbol(): 7}} | ||
*/ | ||
@@ -26,2 +31,5 @@ | ||
} | ||
if (typeof props == 'symbol') { | ||
props = [props]; | ||
} | ||
var lastProp = props.pop(); | ||
@@ -32,3 +40,3 @@ if (!lastProp) { | ||
var thisProp; | ||
while (thisProp = props.shift()) { | ||
while ((thisProp = props.shift())) { | ||
if (!obj[thisProp]) { | ||
@@ -35,0 +43,0 @@ obj[thisProp] = {}; |
{ | ||
"name": "just-safe-set", | ||
"version": "1.0.0", | ||
"description": "set value at property, create intermediate properties if necessary", | ||
"version": "1.1.0", | ||
"description": | ||
"set value at property, create intermediate properties if necessary", | ||
"main": "index.js", | ||
@@ -10,9 +11,3 @@ "scripts": { | ||
"repository": "https://github.com/angus-c/just", | ||
"keywords": [ | ||
"object", | ||
"safe", | ||
"set", | ||
"no-dependencies", | ||
"just" | ||
], | ||
"keywords": ["object", "safe", "set", "no-dependencies", "just"], | ||
"author": "Angus Croll", | ||
@@ -19,0 +14,0 @@ "license": "MIT", |
@@ -26,2 +26,7 @@ ## just-safe-get | ||
obj4; // {a: {aa: {bbb: 7}}} | ||
const obj5 = {a: {}}; | ||
const sym = Symbol(); | ||
set(obj5.a, sym, 7); // true | ||
obj5; // {a: {Symbol(): 7}} | ||
``` |
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
2134
40
32