object-assign
Advanced tools
Comparing version 0.1.1 to 0.1.2
@@ -11,11 +11,32 @@ /*! | ||
var ToObject = function (val) { | ||
if (val == null) { | ||
throw new TypeError(); | ||
} | ||
return Object(val); | ||
} | ||
var objectAssign = Object.assign || function (target, source) { | ||
var keys = Object.keys(source); | ||
var pendingException; | ||
var to = ToObject(target); | ||
var from = ToObject(source); | ||
var keys = Object.keys(from); | ||
var i = keys.length; | ||
while (i--) { | ||
target[keys[i]] = source[keys[i]]; | ||
try { | ||
to[keys[i]] = from[keys[i]]; | ||
} catch (err) { | ||
if (pendingException === undefined) { | ||
pendingException = err; | ||
} | ||
} | ||
} | ||
return target; | ||
if (pendingException) { | ||
throw pendingException; | ||
} | ||
return to; | ||
}; | ||
@@ -22,0 +43,0 @@ |
{ | ||
"name": "object-assign", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "ES6 Object.assign() ponyfill", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
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
2875
41