pax_global_header00006660000000000000000000000064125702121200014502gustar00rootroot0000000000000052 comment=78fc4309afb5021ac7f33657663bb5f0bf36f235 mixin-deep-master/000077500000000000000000000000001257021212000143765ustar00rootroot00000000000000mixin-deep-master/.gitattributes000066400000000000000000000001771257021212000172760ustar00rootroot00000000000000# Enforce Unix newlines * text eol=lf # binaries *.ai binary *.psd binary *.jpg binary *.gif binary *.png binary *.jpeg binarymixin-deep-master/.gitignore000066400000000000000000000010061257021212000163630ustar00rootroot00000000000000# Numerous always-ignore extensions *.DS_Store *.csv *.dat *.diff *.err *.gz *.log *.orig *.out *.pid *.rar *.rej *.seed *.swo *.swp *.vi *.yo-rc.json *.zip *~ .ruby-version lib-cov npm-debug.log # Always-ignore dirs /bower_components/ /node_modules/ /temp/ /tmp/ /vendor/ _gh_pages # OS or Editor folders *.esproj *.komodoproject .komodotools *.sublime-* ._* .cache .DS_Store .idea .project .settings .tmproj nbproject Thumbs.db # grunt-html-validation validation-status.json validation-report.json # misc TODO.mdmixin-deep-master/.jshintrc000066400000000000000000000004311257021212000162210ustar00rootroot00000000000000{ "asi": false, "boss": true, "curly": true, "eqeqeq": true, "eqnull": true, "esnext": true, "immed": true, "latedef": false, "laxcomma": false, "mocha": true, "newcap": true, "noarg": true, "node": true, "sub": true, "undef": true, "unused": true }mixin-deep-master/.travis.yml000066400000000000000000000001311257021212000165020ustar00rootroot00000000000000sudo: false language: node_js node_js: - "0.10" - "0.12" - "iojs" git: depth: 10 mixin-deep-master/.verb.md000066400000000000000000000012451257021212000157360ustar00rootroot00000000000000# {%= name %} {%= badge("fury") %} > {%= description %} ## Install {%= include("install-npm", {save: true}) %} {%= include("install-bower", {save: true}) %} ## Usage ```js var mixinDeep = require('{%= name %}'); mixinDeep({a: {aa: 'aa'}}, {a: {bb: 'bb'}}, {a: {cc: 'cc'}}); //=> { a: { aa: 'aa', bb: 'bb', cc: 'cc' } } ``` ## Related projects {%= related(['merge-deep', 'mixin-deep', 'extend-shallow', 'assign-deep', 'defaults-deep', 'omit-deep'], {remove: name}) %} ## Running tests {%= include("tests") %} ## Contributing {%= include("contributing") %} ## Author {%= include("author") %} ## License {%= copyright() %} {%= license() %} *** {%= include("footer") %}mixin-deep-master/LICENSE000066400000000000000000000021001257021212000153740ustar00rootroot00000000000000The MIT License (MIT) Copyright (c) 2014-2015, Jon Schlinkert. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. mixin-deep-master/README.md000066400000000000000000000041241257021212000156560ustar00rootroot00000000000000# mixin-deep [![NPM version](https://badge.fury.io/js/mixin-deep.svg)](http://badge.fury.io/js/mixin-deep) > Deeply mix the properties of objects into the first object. Like merge-deep, but doesn't clone. ## Install Install with [npm](https://www.npmjs.com/) ```sh $ npm i mixin-deep --save ``` Install with [bower](http://bower.io/) ```sh $ bower install mixin-deep --save ``` ## Usage ```js var mixinDeep = require('mixin-deep'); mixinDeep({a: {aa: 'aa'}}, {a: {bb: 'bb'}}, {a: {cc: 'cc'}}); //=> { a: { aa: 'aa', bb: 'bb', cc: 'cc' } } ``` ## Related projects * [assign-deep](https://www.npmjs.com/package/assign-deep): Deeply assign the enumerable properties of source objects to a destination object. | [homepage](https://github.com/jonschlinkert/assign-deep) * [defaults-deep](https://www.npmjs.com/package/defaults-deep): Like `extend` but recursively copies only the missing properties/values to the target object. | [homepage](https://github.com/jonschlinkert/defaults-deep) * [extend-shallow](https://www.npmjs.com/package/extend-shallow): Extend an object with the properties of additional objects. node.js/javascript util. | [homepage](https://github.com/jonschlinkert/extend-shallow) * [merge-deep](https://www.npmjs.com/package/merge-deep): Recursively merge values in a javascript object. | [homepage](https://github.com/jonschlinkert/merge-deep) * [omit-deep](https://www.npmjs.com/package/omit-deep): Recursively omit the specified key or keys from an object. | [homepage](https://github.com/jonschlinkert/omit-deep) ## Running tests Install dev dependencies: ```sh $ 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/new). ## Author **Jon Schlinkert** + [github/jonschlinkert](https://github.com/jonschlinkert) + [twitter/jonschlinkert](http://twitter.com/jonschlinkert) ## License Copyright © 2015 Jon Schlinkert Released under the MIT license. *** _This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on August 28, 2015._ mixin-deep-master/bower.json000066400000000000000000000013071257021212000164100ustar00rootroot00000000000000{ "name": "mixin-deep", "description": "Deeply mix the properties of objects into the first object. Like merge-deep, but doesn't clone.", "repository": "jonschlinkert/mixin-deep", "license": "MIT", "homepage": "https://github.com/jonschlinkert/mixin-deep", "authors": [ "Jon Schlinkert (https://github.com/jonschlinkert)" ], "main": [ "index.js" ], "dependencies": { "for-in": "^0.1.4", "is-extendable": "^0.1.1", "lazy-cache": "^0.2.3" }, "devDependencies": { "mocha": "*", "should": "*" }, "keywords": [ "deep", "extend", "key", "keys", "merge", "mixin", "object", "prop", "properties", "util", "values" ] }mixin-deep-master/index.js000066400000000000000000000014721257021212000160470ustar00rootroot00000000000000'use strict'; var isExtendable = require('is-extendable'); var forIn = require('for-in'); function mixinDeep(target, objects) { var len = arguments.length, i = 0; while (++i < len) { var obj = arguments[i]; if (isObject(obj)) { forIn(obj, copy, target); } } return target; } /** * Copy properties from the source object to the * target object. * * @param {*} `val` * @param {String} `key` */ function copy(val, key) { var obj = this[key]; if (isObject(val) && isObject(obj)) { mixinDeep(obj, val); } else { this[key] = val; } } /** * Returns true if `val` is an object or function. * * @param {any} val * @return {Boolean} */ function isObject(val) { return isExtendable(val) && !Array.isArray(val); } /** * Expose `mixinDeep` */ module.exports = mixinDeep; mixin-deep-master/package.json000066400000000000000000000020251257021212000166630ustar00rootroot00000000000000{ "name": "mixin-deep", "description": "Deeply mix the properties of objects into the first object. Like merge-deep, but doesn't clone.", "version": "1.1.3", "homepage": "https://github.com/jonschlinkert/mixin-deep", "author": "Jon Schlinkert (https://github.com/jonschlinkert)", "repository": "jonschlinkert/mixin-deep", "bugs": { "url": "https://github.com/jonschlinkert/mixin-deep/issues" }, "license": "MIT", "files": [ "index.js" ], "main": "index.js", "engines": { "node": ">=0.10.0" }, "scripts": { "test": "mocha" }, "dependencies": { "for-in": "^0.1.4", "is-extendable": "^0.1.1" }, "devDependencies": { "mocha": "*", "should": "*" }, "keywords": [ "deep", "extend", "key", "keys", "merge", "mixin", "object", "prop", "properties", "util", "values" ], "verbiage": { "related": { "list": [ "mixin-object", "merge-deep", "extend-shallow", "defaults-deep" ] } } }mixin-deep-master/test.js000066400000000000000000000060101257021212000157100ustar00rootroot00000000000000/*! * mixin-deep * * Copyright (c) 2014-2015 Jon Schlinkert. * Licensed under the MIT License */ 'use strict'; /* deps: mocha */ require('should'); var mixinDeep = require('./'); describe('.mixinDeep()', function () { it('should deeply mix the properties of object into the first object.', function () { var a = mixinDeep({a: {aa: 'aa'} }, {a: {bb: 'bb'} }, {a: {cc: 'cc'} }); a.should.eql({a: {aa: 'aa', bb: 'bb', cc: 'cc'} }); var b = mixinDeep({a: {aa: 'aa', dd: {ee: 'ff'} } }, {a: {bb: 'bb', dd: {gg: 'hh'} } }, {a: {cc: 'cc', dd: {ii: 'jj'} } }); b.should.eql({a: {aa: 'aa', dd: {ee: 'ff', gg: 'hh', ii: 'jj'}, bb: 'bb', cc: 'cc'} }); }); it('should merge object properties without affecting any object', function () { var obj1 = {a: 0, b: 1}; var obj2 = {c: 2, d: 3}; var obj3 = {a: 4, d: 5}; var actual = {a: 4, b: 1, c: 2, d: 5 }; mixinDeep({}, obj1, obj2, obj3).should.eql(actual); actual.should.not.eql(obj1); actual.should.not.eql(obj2); actual.should.not.eql(obj3); }); it('should do a deep merge', function () { var obj1 = {a: {b: 1, c: 1, d: {e: 1, f: 1}}}; var obj2 = {a: {b: 2, d : {f : 'f'} }}; mixinDeep(obj1, obj2).should.eql({a: {b: 2, c: 1, d: {e: 1, f: 'f'} }}); }); it('should merge additional objects into the first:', function () { var obj1 = {a: {b: 1, c: 1, d: {e: 1, f: 1}}}; var obj2 = {a: {b: 2, d : {f : 'f'} }}; mixinDeep(obj1, obj2); obj1.should.eql({a: {b: 2, c: 1, d: {e: 1, f: 'f'} }}); }); it('should clone objects during merge', function () { var obj1 = {a: {b :1}}; var obj2 = {a: {c :2}}; var actual = mixinDeep({}, obj1, obj2); actual.should.eql({a:{b:1, c:2}}); actual.a.should.eql(obj1.a); actual.a.should.not.eql(obj2.a); }); it('should deep clone arrays during merge', function () { var obj1 = {a: [1, 2, [3, 4]]}; var obj2 = {b : [5, 6]}; var actual = mixinDeep(obj1, obj2); actual.a.should.eql([1, 2, [3, 4]]); actual.a[2].should.eql([3, 4]); actual.b.should.eql(obj2.b); }); it('should copy source properties', function() { mixinDeep({ test: true }).test.should.be.true; }); it('should not clone arrays', function() { mixinDeep([1, 2, 3]).should.eql([1, 2, 3]); mixinDeep([1, 2, 3], {}).should.eql([1, 2, 3]); }); it('should work with sparse objects:', function() { var actual = mixinDeep({}, undefined, {a: 'b'}, undefined, {c: 'd'}); actual.should.eql({a: 'b', c: 'd'}); }); it('should clone RegExps', function() { var fixture = /test/g; var actual = mixinDeep(fixture); actual.should.eql(fixture); }); it('should clone Dates', function() { var fixture = new Date(); var actual = mixinDeep(fixture); actual.should.eql(fixture); }); it('should not clone objects created with custom constructor', function() { function TestType() { } var fixture = new TestType(); var actual = mixinDeep(fixture); actual.should.eql(fixture); }); });