Socket
Socket
Sign inDemoInstall

node.extend

Package Overview
Dependencies
2
Maintainers
2
Versions
25
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.0.0 to 2.0.1

.editorconfig

8

.jscs.json

@@ -160,10 +160,10 @@ {

"requireSpaceBeforeObjectValues": true,
"requireSpaceBeforeDestructuredValues": true,
"requireSpaceBeforeObjectValues": true,
"requireSpaceBeforeDestructuredValues": true,
"disallowSpacesInsideTemplateStringPlaceholders": true,
"disallowArrayDestructuringReturn": false,
"disallowArrayDestructuringReturn": false,
"requireNewlineBeforeSingleStatementsInIf": false,
"requireNewlineBeforeSingleStatementsInIf": false,

@@ -170,0 +170,0 @@ "disallowUnusedVariables": true,

@@ -13,3 +13,36 @@ 'use strict';

var is = require('is');
var has = require('has');
var defineProperty = Object.defineProperty;
var gOPD = Object.getOwnPropertyDescriptor;
// If name is '__proto__', and Object.defineProperty is available, define __proto__ as an own property on target
var setProperty = function setP(target, name, value) {
if (defineProperty && name === '__proto__') {
defineProperty(target, name, {
enumerable: true,
configurable: true,
value: value,
writable: true
});
} else {
target[name] = value;
}
};
// Return undefined instead of __proto__ if '__proto__' is not an own property
var getProperty = function getP(obj, name) {
if (name === '__proto__') {
if (!has(obj, name)) {
return void 0;
} else if (gOPD) {
// In early versions of node, obj['__proto__'] is buggy when obj has
// __proto__ as an own property. Object.getOwnPropertyDescriptor() works.
return gOPD(obj, name).value;
}
}
return obj[name];
};
module.exports = function extend() {

@@ -44,4 +77,4 @@ var target = arguments[0] || {};

for (name in options) {
src = target[name];
copy = options[name];
src = getProperty(target, name);
copy = getProperty(options, name);

@@ -63,7 +96,7 @@ // Prevent never-ending loop

// Never move original objects, clone them
target[name] = extend(deep, clone, copy);
setProperty(target, name, extend(deep, clone, copy));
// Don't bring in undefined values
} else if (typeof copy !== 'undefined') {
target[name] = copy;
setProperty(target, name, copy);
}

@@ -70,0 +103,0 @@ }

{
"name": "node.extend",
"version": "2.0.0",
"version": "2.0.1",
"description": "A port of jQuery.extend that actually works on node.js",

@@ -15,10 +15,11 @@ "keywords": [

"dependencies": {
"has": "^1.0.3",
"is": "^3.2.1"
},
"devDependencies": {
"tape": "^4.6.3",
"@ljharb/eslint-config": "^13.0.0",
"covert": "^1.1.0",
"eslint": "^5.8.0",
"jscs": "^3.0.7",
"eslint": "^3.19.0",
"@ljharb/eslint-config": "^11.0.0"
"tape": "^4.9.1"
},

@@ -43,5 +44,5 @@ "repository": {

"coverage-quiet": "covert test/index.js --quiet",
"lint": "npm run jscs && npm run eslint",
"lint": "npm run jscs && npm run eslint .",
"jscs": "jscs *.js */*.js",
"eslint": "eslint *.js */*.js"
"eslint": "eslint"
},

@@ -48,0 +49,0 @@ "engines": {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc