Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
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 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": "*"
}
}
SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc