can-assign
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -16,14 +16,1 @@ var assign = require('./can-assign'); | ||
}); | ||
QUnit.test("Assign all properties to an object from multiple source objects", function(){ | ||
var one = { a: 1, b: 1, c: 1 }; | ||
var two = { a: 2, b: 2 }; | ||
var three = { a: 3 }; | ||
var expected = { a: 3, b: 2, c: 1 }; | ||
var actual = assign(one, two, three); | ||
for (var prop in actual){ | ||
equal(expected[prop], actual[prop]); | ||
} | ||
}); |
@@ -7,3 +7,3 @@ /** | ||
* | ||
* A simplified version of [Object.assign](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign). | ||
* A simplified version of [Object.assign](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign), which only accepts a single source argument. | ||
* | ||
@@ -23,3 +23,3 @@ * ```js | ||
* @param {Object} target The destination object. This object's properties will be mutated based on the object provided as `source`. | ||
* @param {Array} sources The source objects whose own properties will be applied to `target`. | ||
* @param {Object} source The source object whose own properties will be applied to `target`. | ||
* | ||
@@ -29,15 +29,7 @@ * @return {Object} Returns the `target` argument. | ||
module.exports = function(d) { | ||
var sources = Array.prototype.slice.call(arguments, 1); | ||
var s = sources.shift(); | ||
while(s) { | ||
for (var prop in s) { | ||
d[prop] = s[prop]; | ||
} | ||
s = sources.shift(); | ||
module.exports = function (d, s) { | ||
for (var prop in s) { | ||
d[prop] = s[prop]; | ||
} | ||
return d; | ||
}; |
@@ -1,11 +0,6 @@ | ||
/*can-assign@1.0.1#can-assign*/ | ||
/*can-assign@1.1.0#can-assign*/ | ||
define(function (require, exports, module) { | ||
module.exports = function (d) { | ||
var sources = Array.prototype.slice.call(arguments, 1); | ||
var s = sources.shift(); | ||
while (s) { | ||
for (var prop in s) { | ||
d[prop] = s[prop]; | ||
} | ||
s = sources.shift(); | ||
module.exports = function (d, s) { | ||
for (var prop in s) { | ||
d[prop] = s[prop]; | ||
} | ||
@@ -12,0 +7,0 @@ return d; |
@@ -1,12 +0,7 @@ | ||
/*can-assign@1.0.1#can-assign*/ | ||
module.exports = function (d) { | ||
var sources = Array.prototype.slice.call(arguments, 1); | ||
var s = sources.shift(); | ||
while (s) { | ||
for (var prop in s) { | ||
d[prop] = s[prop]; | ||
} | ||
s = sources.shift(); | ||
/*can-assign@1.1.0#can-assign*/ | ||
module.exports = function (d, s) { | ||
for (var prop in s) { | ||
d[prop] = s[prop]; | ||
} | ||
return d; | ||
}; |
@@ -130,12 +130,7 @@ /*[global-shim-start]*/ | ||
/*can-assign@1.0.1#can-assign*/ | ||
/*can-assign@1.1.0#can-assign*/ | ||
define('can-assign', function (require, exports, module) { | ||
module.exports = function (d) { | ||
var sources = Array.prototype.slice.call(arguments, 1); | ||
var s = sources.shift(); | ||
while (s) { | ||
for (var prop in s) { | ||
d[prop] = s[prop]; | ||
} | ||
s = sources.shift(); | ||
module.exports = function (d, s) { | ||
for (var prop in s) { | ||
d[prop] = s[prop]; | ||
} | ||
@@ -142,0 +137,0 @@ return d; |
{ | ||
"name": "can-assign", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "A simplified version of Object.assign, which only accepts a single source argument.", | ||
@@ -5,0 +5,0 @@ "homepage": "https://canjs.com/", |
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
0
0
13733
208