Comparing version 3.0.0 to 3.0.1
{ | ||
"es3": true, | ||
"additionalRules": [], | ||
@@ -10,3 +12,6 @@ | ||
"requireCurlyBraces": ["if", "else", "for", "while", "do", "try", "catch"], | ||
"requireCurlyBraces": { | ||
"allExcept": [], | ||
"keywords": ["if", "else", "for", "while", "do", "try", "catch"] | ||
}, | ||
@@ -17,2 +22,16 @@ "requireSpaceAfterKeywords": ["if", "else", "for", "while", "do", "switch", "return", "try", "catch", "function"], | ||
"disallowSpaceBeforeComma": true, | ||
"disallowSpaceAfterComma": false, | ||
"disallowSpaceBeforeSemicolon": true, | ||
"disallowNodeTypes": [ | ||
"DebuggerStatement", | ||
"LabeledStatement", | ||
"SwitchCase", | ||
"SwitchStatement", | ||
"WithStatement" | ||
], | ||
"requireObjectKeysOnNewLine": { "allExcept": ["sameLine"] }, | ||
"requireSpacesInAnonymousFunctionExpression": { "beforeOpeningRoundBrace": true, "beforeOpeningCurlyBrace": true }, | ||
@@ -30,3 +49,3 @@ "requireSpacesInNamedFunctionExpression": { "beforeOpeningCurlyBrace": true }, | ||
"disallowQuotedKeysInObjects": "allButReserved", | ||
"disallowQuotedKeysInObjects": { "allExcept": ["reserved"] }, | ||
@@ -66,3 +85,3 @@ "disallowSpaceAfterObjectKeys": true, | ||
"requireDotNotation": true, | ||
"requireDotNotation": { "allExcept": ["keywords"] }, | ||
@@ -106,4 +125,56 @@ "requireParenthesesAroundIIFE": true, | ||
"requirePaddingNewLinesAfterUseStrict": true | ||
"requirePaddingNewLinesAfterUseStrict": true, | ||
"disallowArrowFunctions": true, | ||
"disallowMultiLineTernary": true, | ||
"validateOrderInObjectKeys": false, | ||
"disallowIdenticalDestructuringNames": true, | ||
"disallowNestedTernaries": { "maxLevel": 1 }, | ||
"requireSpaceAfterComma": { "allExcept": ["trailing"] }, | ||
"requireAlignedMultilineParams": false, | ||
"requireSpacesInGenerator": { | ||
"afterStar": true | ||
}, | ||
"disallowSpacesInGenerator": { | ||
"beforeStar": true | ||
}, | ||
"disallowVar": false, | ||
"requireArrayDestructuring": false, | ||
"requireEnhancedObjectLiterals": false, | ||
"requireObjectDestructuring": false, | ||
"requireEarlyReturn": false, | ||
"requireCapitalizedConstructorsNew": { | ||
"allExcept": ["Function", "String", "Object", "Symbol", "Number", "Date", "RegExp", "Error", "Boolean", "Array"] | ||
}, | ||
"requireImportAlphabetized": false, | ||
"requireSpaceBeforeObjectValues": true, | ||
"requireSpaceBeforeDestructuredValues": true, | ||
"disallowSpacesInsideTemplateStringPlaceholders": true, | ||
"disallowArrayDestructuringReturn": false, | ||
"requireNewlineBeforeSingleStatementsInIf": false, | ||
"disallowUnusedVariables": true, | ||
"requireSpacesInsideImportedObjectBraces": true, | ||
"requireUseStrict": true | ||
} | ||
@@ -0,1 +1,9 @@ | ||
3.0.1 / 2017-04-27 | ||
================== | ||
* [Fix] deep extending should work with a non-object (#46) | ||
* [Dev Deps] update `tape`, `eslint`, `@ljharb/eslint-config` | ||
* [Tests] up to `node` `v7.9`, `v6.10`, `v4.8`; improve matrix | ||
* [Docs] Switch from vb.teelaun.ch to versionbadg.es for the npm version badge SVG. | ||
* [Docs] Add example to readme (#34) | ||
3.0.0 / 2015-07-01 | ||
@@ -2,0 +10,0 @@ ================== |
16
index.js
@@ -29,3 +29,3 @@ 'use strict'; | ||
var key; | ||
for (key in obj) {/**/} | ||
for (key in obj) { /**/ } | ||
@@ -36,7 +36,7 @@ return typeof key === 'undefined' || hasOwn.call(obj, key); | ||
module.exports = function extend() { | ||
var options, name, src, copy, copyIsArray, clone, | ||
target = arguments[0], | ||
i = 1, | ||
length = arguments.length, | ||
deep = false; | ||
var options, name, src, copy, copyIsArray, clone; | ||
var target = arguments[0]; | ||
var i = 1; | ||
var length = arguments.length; | ||
var deep = false; | ||
@@ -49,3 +49,4 @@ // Handle a deep copy situation | ||
i = 2; | ||
} else if ((typeof target !== 'object' && typeof target !== 'function') || target == null) { | ||
} | ||
if (target == null || (typeof target !== 'object' && typeof target !== 'function')) { | ||
target = {}; | ||
@@ -89,2 +90,1 @@ } | ||
}; | ||
{ | ||
"name": "extend", | ||
"author": "Stefan Thomas <justmoon@members.fsf.org> (http://www.justmoon.net)", | ||
"version": "3.0.0", | ||
"version": "3.0.1", | ||
"description": "Port of jQuery.extend for node.js and the browser", | ||
"main": "index", | ||
"scripts": { | ||
"test": "npm run lint && node test/index.js && npm run coverage-quiet", | ||
"pretest": "npm run lint", | ||
"test": "npm run tests-only", | ||
"posttest": "npm run coverage-quiet", | ||
"tests-only": "node test", | ||
"coverage": "covert test/index.js", | ||
@@ -32,6 +35,7 @@ "coverage-quiet": "covert test/index.js --quiet", | ||
"devDependencies": { | ||
"tape": "^4.0.0", | ||
"tape": "^4.6.3", | ||
"covert": "^1.1.0", | ||
"jscs": "^1.13.1", | ||
"eslint": "^0.24.0" | ||
"jscs": "^3.0.7", | ||
"eslint": "^3.19.0", | ||
"@ljharb/eslint-config": "^11.0.0" | ||
}, | ||
@@ -38,0 +42,0 @@ "license": "MIT" |
@@ -9,2 +9,14 @@ [![Build Status][travis-svg]][travis-url] | ||
Notes: | ||
* Since Node.js >= 4, | ||
[`Object.assign`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign) | ||
now offers the same functionality natively (but without the "deep copy" option). | ||
See [ECMAScript 2015 (ES6) in Node.js](https://nodejs.org/en/docs/es6). | ||
* Some native implementations of `Object.assign` in both Node.js and many | ||
browsers (since NPM modules are for the browser too) may not be fully | ||
spec-compliant. | ||
Check [`object.assign`](https://www.npmjs.com/package/object.assign) module for | ||
a compliant candidate. | ||
## Installation | ||
@@ -24,2 +36,9 @@ | ||
**Example:** | ||
``` js | ||
var extend = require('extend'); | ||
extend(targetObject, object1, object2); | ||
``` | ||
Keep in mind that the target object will be modified, and will be returned from extend(). | ||
@@ -59,3 +78,3 @@ | ||
[github-ljharb]: https://github.com/ljharb | ||
[npm-version-png]: http://vb.teelaun.ch/justmoon/node-extend.svg | ||
[npm-version-png]: http://versionbadg.es/justmoon/node-extend.svg | ||
[deps-svg]: https://david-dm.org/justmoon/node-extend.svg | ||
@@ -62,0 +81,0 @@ [deps-url]: https://david-dm.org/justmoon/node-extend |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
20376
216
82
5