property-expr
Advanced tools
Comparing version 1.3.0 to 1.3.1
@@ -21,3 +21,3 @@ /** | ||
setter: function(path){ | ||
return setCache[path] || ( setCache[path] = new Function('data, value', expr(path, 'data') + ' = value')) | ||
return setCache[path] || ( setCache[path] = new Function('data, value', 'return ' + expr(path, 'data') + ' = value, data;')) | ||
}, | ||
@@ -27,3 +27,3 @@ | ||
var k = path + '_' + safe | ||
return getCache[k] || ( getCache[k] = new Function('data', "return " + expr(path, safe, 'data') )) | ||
return getCache[k] || ( getCache[k] = new Function('data', 'return ' + expr(path, safe, 'data') )) | ||
}, | ||
@@ -30,0 +30,0 @@ |
{ | ||
"name": "property-expr", | ||
"version": "1.3.0", | ||
"version": "1.3.1", | ||
"description": "tiny util for getting and setting deep object props safely", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -33,3 +33,5 @@ var a = require('assert') | ||
setter('foo.bar[1]')(obj, 'bot') | ||
a.strictEqual( | ||
setter('foo.bar[1]')(obj, 'bot'), obj, 'setter must return the object') | ||
a.strictEqual(obj.foo.bar[1], 'bot') | ||
@@ -36,0 +38,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
9661
137