🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

object-assign

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

object-assign - npm Package Compare versions

Comparing version

to
2.0.0

13

index.js

@@ -12,3 +12,2 @@ 'use strict';

module.exports = Object.assign || function (target, source) {
var pendingException;
var from;

@@ -23,17 +22,7 @@ var keys;

for (var i = 0; i < keys.length; i++) {
try {
to[keys[i]] = from[keys[i]];
} catch (err) {
if (pendingException === undefined) {
pendingException = err;
}
}
to[keys[i]] = from[keys[i]];
}
}
if (pendingException) {
throw pendingException;
}
return to;
};

2

package.json
{
"name": "object-assign",
"version": "1.0.0",
"version": "2.0.0",
"description": "ES6 Object.assign() ponyfill",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -24,8 +24,12 @@ # object-assign [![Build Status](https://travis-ci.org/sindresorhus/object-assign.svg?branch=master)](https://travis-ci.org/sindresorhus/object-assign)

// multiple sources
objectAssign({foo: 0}, {bar: 1}, {baz: 3});
objectAssign({foo: 0}, {bar: 1}, {baz: 2});
//=> {foo: 0, bar: 1, baz: 2}
// overwrites equal keys
objectAssign({foo: 0}, {foo: 1}, {foo: 2});
//=> {foo: 2}
// ignores null and undefined sources
objectAssign({foo: 0}, null, {bar: 1}, undefined);
//=> {foo: 0, bar: 1, baz: 2}
//=> {foo: 0, bar: 1}
```

@@ -32,0 +36,0 @@