extend-shallow
Advanced tools
Comparing version 0.1.0 to 0.1.1
@@ -6,3 +6,3 @@ # {%= name %} {%= badge("fury") %} | ||
## Install | ||
{%= include("install") %} | ||
{%= include("install-npm", {save: true}) %} | ||
@@ -9,0 +9,0 @@ ## Run tests |
12
index.js
'use strict'; | ||
// faster slice | ||
var slice = require('array-slice'); | ||
/** | ||
@@ -12,4 +15,2 @@ * Extend the target `obj` with the properties of other objects. | ||
module.exports = function extend(o) { | ||
var args = [].slice.call(arguments, 1); | ||
if (o == null) { | ||
@@ -19,3 +20,6 @@ return {}; | ||
var args = slice(arguments, 1); | ||
var len = args.length; | ||
var i = 0; | ||
if (len === 0) { | ||
@@ -25,4 +29,4 @@ return o; | ||
for (var i = 0; i < len; i++) { | ||
var obj = args[i]; | ||
while (len--) { | ||
var obj = args[i++]; | ||
@@ -29,0 +33,0 @@ for (var key in obj) { |
{ | ||
"name": "extend-shallow", | ||
"description": "Extend javascript object A with the properties of object B.", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"homepage": "https://github.com/jonschlinkert/extend-shallow", | ||
@@ -45,3 +45,6 @@ "author": { | ||
"props" | ||
] | ||
], | ||
"dependencies": { | ||
"array-slice": "^0.2.2" | ||
} | ||
} |
@@ -7,6 +7,6 @@ # extend-shallow [![NPM version](https://badge.fury.io/js/extend-shallow.svg)](http://badge.fury.io/js/extend-shallow) | ||
## Install | ||
#### Install with [npm](npmjs.org): | ||
#### Install with [npm](npmjs.org) | ||
```bash | ||
npm i extend-shallow --save-dev | ||
npm i extend-shallow --save | ||
``` | ||
@@ -42,2 +42,2 @@ | ||
_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on October 06, 2014._ | ||
_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on October 28, 2014._ |
@@ -16,3 +16,9 @@ /*! | ||
extend({a: 'b'}, {c: 'd'}).should.eql({a: 'b', c: 'd'}); | ||
extend({a: 'b', c: 'd'}, {c: 'e'}).should.eql({a: 'b', c: 'e'}); | ||
}); | ||
it('should return an empty object when args are undefined.', function () { | ||
extend(null).should.eql({}); | ||
extend(undefined).should.eql({}); | ||
}); | ||
}); |
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
5653
48
1
+ Addedarray-slice@^0.2.2
+ Addedarray-slice@0.2.3(transitive)