mixin-deep
Advanced tools
Comparing version 1.0.1 to 1.1.0
20
index.js
'use strict'; | ||
var isObject = require('is-plain-object'); | ||
var forIn = require('for-own'); | ||
var forOwn = require('for-own'); | ||
module.exports = function deepMixin(o, objects) { | ||
if (!o || !objects) { return o || {}; } | ||
if (!isObject(o)) return {}; | ||
if (!isObject(objects)) return o; | ||
var len = arguments.length - 1; | ||
for (var i = 0; i < len; i++) { | ||
var obj = arguments[i + 1]; | ||
if (isObject(obj)) { | ||
forOwn(obj, copy, o); | ||
} | ||
} | ||
function copy(value, key) { | ||
@@ -19,11 +27,3 @@ var obj = this[key]; | ||
} | ||
for (var i = 0; i < len; i++) { | ||
var obj = arguments[i + 1]; | ||
if (isObject(obj)) { | ||
forIn(obj, copy, o); | ||
} | ||
} | ||
return o; | ||
}; |
{ | ||
"name": "mixin-deep", | ||
"description": "Deeply mix the properties of objects into the first object. Like merge-deep, but doesn't clone.", | ||
"version": "1.0.1", | ||
"version": "1.1.0", | ||
"homepage": "https://github.com/jonschlinkert/mixin-deep", | ||
@@ -32,8 +32,8 @@ "author": { | ||
"dependencies": { | ||
"for-own": "^0.1.1", | ||
"is-plain-object": "^0.1.0" | ||
"for-own": "^0.1.3", | ||
"is-plain-object": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.0.tgz" | ||
}, | ||
"devDependencies": { | ||
"mocha": "*", | ||
"should": "^4.0.4" | ||
"mocha": "^2.2.4", | ||
"should": "^6.0.1" | ||
}, | ||
@@ -52,2 +52,2 @@ "keywords": [ | ||
] | ||
} | ||
} |
@@ -11,10 +11,2 @@ # mixin-deep [![NPM version](https://badge.fury.io/js/mixin-deep.svg)](http://badge.fury.io/js/mixin-deep) | ||
## Running tests | ||
Install dev dependencies. | ||
```bash | ||
npm i -d && npm test | ||
``` | ||
## Usage | ||
@@ -29,15 +21,36 @@ | ||
## Related projects | ||
* [assign-deep](https://github.com/jonschlinkert/assign-deep): Deeply assign the enumerable properties of source objects to a destination object. If a callback… [more](https://github.com/jonschlinkert/assign-deep) | ||
* [extend-shallow](https://github.com/jonschlinkert/extend-shallow): Extend an object with the properties of additional objects. node.js/javascript util. | ||
* [merge-deep](https://github.com/jonschlinkert/merge-deep): Recursively merge values in a javascript object. | ||
## Running tests | ||
Install dev dependencies: | ||
```bash | ||
npm i -d && npm test | ||
``` | ||
## Contributing | ||
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/mixin-deep/issues) | ||
## Author | ||
**Jon Schlinkert** | ||
+ [github/jonschlinkert](https://github.com/jonschlinkert) | ||
+ [twitter/jonschlinkert](http://twitter.com/jonschlinkert) | ||
+ [twitter/jonschlinkert](http://twitter.com/jonschlinkert) | ||
## License | ||
Copyright (c) 2015 Jon Schlinkert | ||
Released under the MIT license | ||
Copyright (c) 2015 Jon Schlinkert | ||
Released under the MIT license. | ||
*** | ||
_This file was generated by [verb](https://github.com/assemble/verb) on February 25, 2015._ | ||
_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on April 29, 2015._ | ||
<!-- reflinks generated by verb-reflinks plugin --> |
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
HTTP dependency
Supply chain riskContains a dependency which resolves to a remote HTTP URL which could be used to inject untrusted code and reduce overall package reliability.
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
4366
23
55
1
- Removedis-plain-object@0.1.0(transitive)
Updatedfor-own@^0.1.3
Updatedis-plain-object@https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.0.tgz