object-path-immutable
Advanced tools
Comparing version 0.2.0 to 0.3.0
@@ -60,3 +60,3 @@ (function (root, factory){ | ||
proxy[prop] = function() { | ||
var args = Array.prototype.slice.call(arguments).concat([obj]) | ||
var args = [obj].concat(Array.prototype.slice.call(arguments)) | ||
return objectPathImmutable(objectPathImmutable[prop].apply(objectPathImmutable, args)) | ||
@@ -63,0 +63,0 @@ } |
{ | ||
"name": "object-path-immutable", | ||
"version": "0.2.0", | ||
"version": "0.3.0", | ||
"description": "Modify deep object properties without modifying the original object (immutability). Works great with React and Redux.", | ||
@@ -5,0 +5,0 @@ "author": "Mario Casciaro <mariocasciaro@gmail.com>", |
24
test.js
@@ -186,2 +186,24 @@ 'use strict'; | ||
}) | ||
}) | ||
}) | ||
describe('bind', function() { | ||
it('should execute all methods on the bound object', function() { | ||
var obj = { | ||
a: { | ||
d: 1, | ||
f: 2 | ||
}, | ||
c: {} | ||
} | ||
var newObj = op(obj).set('a.q', 'q').del('a.d').value() | ||
expect(newObj).not.to.be.equal(obj) | ||
expect(newObj.a).not.to.be.equal(obj.a) | ||
expect(newObj.c).to.be.equal(obj.c) | ||
expect(newObj.a).to.be.eql({f: 2, q: 'q'}) | ||
}) | ||
}) | ||
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
14427
307