Socket
Socket
Sign inDemoInstall

can-assign

Package Overview
Dependencies
0
Maintainers
3
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.1.0 to 1.1.1

13

can-assign-test.js

@@ -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]);
}
});

18

can-assign.js

@@ -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/",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc