object-assign
Advanced tools
Comparing version 4.1.0 to 4.1.1
15
index.js
@@ -0,3 +1,10 @@ | ||
/* | ||
object-assign | ||
(c) Sindre Sorhus | ||
@license MIT | ||
*/ | ||
'use strict'; | ||
/* eslint-disable no-unused-vars */ | ||
var getOwnPropertySymbols = Object.getOwnPropertySymbols; | ||
var hasOwnProperty = Object.prototype.hasOwnProperty; | ||
@@ -23,3 +30,3 @@ var propIsEnumerable = Object.prototype.propertyIsEnumerable; | ||
// https://bugs.chromium.org/p/v8/issues/detail?id=4118 | ||
var test1 = new String('abc'); // eslint-disable-line | ||
var test1 = new String('abc'); // eslint-disable-line no-new-wrappers | ||
test1[5] = 'de'; | ||
@@ -53,3 +60,3 @@ if (Object.getOwnPropertyNames(test1)[0] === '5') { | ||
return true; | ||
} catch (e) { | ||
} catch (err) { | ||
// We don't expect any of the above to throw, but better to be safe. | ||
@@ -74,4 +81,4 @@ return false; | ||
if (Object.getOwnPropertySymbols) { | ||
symbols = Object.getOwnPropertySymbols(from); | ||
if (getOwnPropertySymbols) { | ||
symbols = getOwnPropertySymbols(from); | ||
for (var i = 0; i < symbols.length; i++) { | ||
@@ -78,0 +85,0 @@ if (propIsEnumerable.call(from, symbols[i])) { |
{ | ||
"name": "object-assign", | ||
"version": "4.1.0", | ||
"description": "ES2015 Object.assign() ponyfill", | ||
"version": "4.1.1", | ||
"description": "ES2015 `Object.assign()` ponyfill", | ||
"license": "MIT", | ||
@@ -16,3 +16,3 @@ "repository": "sindresorhus/object-assign", | ||
"scripts": { | ||
"test": "xo && mocha", | ||
"test": "xo && ava", | ||
"bench": "matcha bench.js" | ||
@@ -38,7 +38,7 @@ }, | ||
"devDependencies": { | ||
"lodash": "^4.8.2", | ||
"ava": "^0.16.0", | ||
"lodash": "^4.16.4", | ||
"matcha": "^0.7.0", | ||
"mocha": "*", | ||
"xo": "*" | ||
"xo": "^0.16.0" | ||
} | ||
} |
# object-assign [![Build Status](https://travis-ci.org/sindresorhus/object-assign.svg?branch=master)](https://travis-ci.org/sindresorhus/object-assign) | ||
> ES2015 [`Object.assign()`](http://www.2ality.com/2014/01/object-assign.html) ponyfill | ||
> ES2015 [`Object.assign()`](http://www.2ality.com/2014/01/object-assign.html) [ponyfill](https://ponyfill.com) | ||
> Ponyfill: A polyfill that doesn't overwrite the native method | ||
## Use the built-in | ||
Node.js 4 and up, as well as every evergreen browser (Chrome, Edge, Firefox, Opera, Safari), | ||
support `Object.assign()` :tada:. If you target only those environments, then by all | ||
means, use `Object.assign()` instead of this package. | ||
## Install | ||
@@ -39,3 +44,3 @@ | ||
### objectAssign(target, source, [source, ...]) | ||
### objectAssign(target, [source, ...]) | ||
@@ -42,0 +47,0 @@ Assigns enumerable own properties of `source` objects to the `target` object and returns the `target` object. Additional `source` objects will overwrite previous ones. |
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
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
5493
76
62
0