object-assign
Advanced tools
Comparing version 3.0.0 to 4.0.0
31
index.js
'use strict'; | ||
var propIsEnumerable = Object.prototype.propertyIsEnumerable; | ||
var hasOwnProperty = Object.prototype.hasOwnProperty; | ||
@@ -12,14 +12,2 @@ function ToObject(val) { | ||
function ownEnumerableKeys(obj) { | ||
var keys = Object.getOwnPropertyNames(obj); | ||
if (Object.getOwnPropertySymbols) { | ||
keys = keys.concat(Object.getOwnPropertySymbols(obj)); | ||
} | ||
return keys.filter(function (key) { | ||
return propIsEnumerable.call(obj, key); | ||
}); | ||
} | ||
module.exports = Object.assign || function (target, source) { | ||
@@ -29,10 +17,19 @@ var from; | ||
var to = ToObject(target); | ||
var symbols; | ||
for (var s = 1; s < arguments.length; s++) { | ||
from = arguments[s]; | ||
keys = ownEnumerableKeys(Object(from)); | ||
from = Object(arguments[s]); | ||
for (var i = 0; i < keys.length; i++) { | ||
to[keys[i]] = from[keys[i]]; | ||
for (var key in from) { | ||
if (hasOwnProperty.call(from, key)) { | ||
to[key] = from[key]; | ||
} | ||
} | ||
if (Object.getOwnPropertySymbols) { | ||
symbols = Object.getOwnPropertySymbols(from); | ||
for (var i = 0; i < symbols.length; i++) { | ||
to[symbols[i]] = from[symbols[i]]; | ||
} | ||
} | ||
} | ||
@@ -39,0 +36,0 @@ |
{ | ||
"name": "object-assign", | ||
"version": "3.0.0", | ||
"version": "4.0.0", | ||
"description": "ES6 Object.assign() ponyfill", | ||
@@ -16,3 +16,4 @@ "license": "MIT", | ||
"scripts": { | ||
"test": "mocha" | ||
"test": "mocha", | ||
"bench": "matcha bench.js" | ||
}, | ||
@@ -37,4 +38,6 @@ "files": [ | ||
"devDependencies": { | ||
"lodash": "^3.10.1", | ||
"matcha": "^0.6.0", | ||
"mocha": "*" | ||
} | ||
} |
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
3766
3
29