Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

extend

Package Overview
Dependencies
Maintainers
2
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

extend - npm Package Compare versions

Comparing version 2.0.1 to 3.0.0

.eslintrc

38

.jscs.json
{
"additionalRules": [],
"requireSemicolons": true,
"disallowMultipleSpaces": true,
"disallowIdentifierNames": [],
"requireCurlyBraces": ["if", "else", "for", "while", "do", "try", "catch"],

@@ -66,4 +72,34 @@

"mark": "'"
}
},
"disallowOperatorBeforeLineBreak": [],
"requireSpaceBeforeKeywords": [
"do",
"for",
"if",
"else",
"switch",
"case",
"try",
"catch",
"finally",
"while",
"with",
"return"
],
"validateAlignedFunctionParameters": {
"lineBreakAfterOpeningBraces": true,
"lineBreakBeforeClosingBraces": true
},
"requirePaddingNewLinesBeforeExport": true,
"validateNewlineAfterArrayElements": {
"maximum": 6
},
"requirePaddingNewLinesAfterUseStrict": true
}

@@ -0,1 +1,9 @@

3.0.0 / 2015-07-01
==================
* [Possible breaking change] Use global "strict" directive (#32)
* [Tests] `int` is an ES3 reserved word
* [Tests] Test up to `io.js` `v2.3`
* [Tests] Add `npm run eslint`
* [Dev Deps] Update `covert`, `jscs`
2.0.1 / 2015-04-25

@@ -2,0 +10,0 @@ ==================

2

component.json
{
"name": "extend",
"author": "Stefan Thomas <justmoon@members.fsf.org> (http://www.justmoon.net)",
"version": "2.0.1",
"version": "3.0.0",
"description": "Port of jQuery.extend for node.js and the browser.",

@@ -6,0 +6,0 @@ "scripts": [

@@ -0,4 +1,5 @@

'use strict';
var hasOwn = Object.prototype.hasOwnProperty;
var toStr = Object.prototype.toString;
var undefined;

@@ -14,3 +15,2 @@ var isArray = function isArray(arr) {

var isPlainObject = function isPlainObject(obj) {
'use strict';
if (!obj || toStr.call(obj) !== '[object Object]') {

@@ -20,6 +20,6 @@ return false;

var has_own_constructor = hasOwn.call(obj, 'constructor');
var has_is_property_of_method = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, 'isPrototypeOf');
var hasOwnConstructor = hasOwn.call(obj, 'constructor');
var hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, 'isPrototypeOf');
// Not own constructor property must be Object
if (obj.constructor && !has_own_constructor && !has_is_property_of_method) {
if (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) {
return false;

@@ -31,9 +31,8 @@ }

var key;
for (key in obj) {}
for (key in obj) {/**/}
return key === undefined || hasOwn.call(obj, key);
return typeof key === 'undefined' || hasOwn.call(obj, key);
};
module.exports = function extend() {
'use strict';
var options, name, src, copy, copyIsArray, clone,

@@ -65,21 +64,19 @@ target = arguments[0],

// Prevent never-ending loop
if (target === copy) {
continue;
}
if (target !== copy) {
// Recurse if we're merging plain objects or arrays
if (deep && copy && (isPlainObject(copy) || (copyIsArray = isArray(copy)))) {
if (copyIsArray) {
copyIsArray = false;
clone = src && isArray(src) ? src : [];
} else {
clone = src && isPlainObject(src) ? src : {};
}
// Recurse if we're merging plain objects or arrays
if (deep && copy && (isPlainObject(copy) || (copyIsArray = isArray(copy)))) {
if (copyIsArray) {
copyIsArray = false;
clone = src && isArray(src) ? src : [];
} else {
clone = src && isPlainObject(src) ? src : {};
// Never move original objects, clone them
target[name] = extend(deep, clone, copy);
// Don't bring in undefined values
} else if (typeof copy !== 'undefined') {
target[name] = copy;
}
// Never move original objects, clone them
target[name] = extend(deep, clone, copy);
// Don't bring in undefined values
} else if (copy !== undefined) {
target[name] = copy;
}

@@ -86,0 +83,0 @@ }

{
"name": "extend",
"author": "Stefan Thomas <justmoon@members.fsf.org> (http://www.justmoon.net)",
"version": "2.0.1",
"version": "3.0.0",
"description": "Port of jQuery.extend for node.js and the browser",

@@ -11,3 +11,5 @@ "main": "index",

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

@@ -32,4 +34,5 @@ "contributors": [

"tape": "^4.0.0",
"covert": "^1.0.1",
"jscs": "^1.11.3"
"covert": "^1.1.0",
"jscs": "^1.13.1",
"eslint": "^0.24.0"
},

@@ -36,0 +39,0 @@ "license": "MIT"

Sorry, the diff of this file is not supported yet

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