This commit is contained in:
oitsjustjose 2017-02-26 17:06:42 -05:00
commit 6b60015c02
9588 changed files with 1149251 additions and 49 deletions

4
node_modules/deepmerge/.npmignore generated vendored Normal file
View file

@ -0,0 +1,4 @@
node_modules
#jasmine
reports

70
node_modules/deepmerge/README.markdown generated vendored Normal file
View file

@ -0,0 +1,70 @@
deepmerge
=========
Merge the enumerable attributes of two objects deeply.
example
=======
```js
var util = require('util')
var merge = require('deepmerge')
var x = { foo: { bar: 3 },
array: [ { does: 'work', too: [ 1, 2, 3 ] } ] }
var y = { foo: { baz: 4 },
quux: 5,
array: [ { does: 'work', too: [ 4, 5, 6 ] }, { really: 'yes' } ] }
console.log(util.inspect(merge(x, y), false, null))
```
output:
```js
{ foo: { bar: 3, baz: 4 },
array: [ { does: 'work', too: [ 1, 2, 3, 4, 5, 6 ] }, { really: 'yes' } ],
quux: 5 }
```
methods
=======
var merge = require('deepmerge')
merge(x, y)
-----------
Merge two objects `x` and `y` deeply, returning a new merged object with the
elements from both `x` and `y`.
If an element at the same key is present for both `x` and `y`, the value from
`y` will appear in the result.
The merge is immutable, so neither `x` nor `y` will be modified.
The merge will also merge arrays and array values.
install
=======
With [npm](http://npmjs.org) do:
```
npm install deepmerge
```
For the browser, you can install with [bower](http://bower.io/):
```
bower install deepmerge
```
test
====
With [npm](http://npmjs.org) do:
```
npm test
```

24
node_modules/deepmerge/bower.json generated vendored Normal file
View file

@ -0,0 +1,24 @@
{
"name": "deepmerge",
"main": "index.js",
"version": "0.2.5",
"homepage": "https://github.com/nrf110/deepmerge",
"authors": [
"Nicholas Fisher <nfisher110@gmail.com>"
],
"description": "Merge the enumerable attributes of two objects.",
"keywords": [
"merge",
"extend",
"assign"
],
"license": "MIT",
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"app/bower_components",
"test",
"tests"
]
}

5
node_modules/deepmerge/example/merge.js generated vendored Normal file
View file

@ -0,0 +1,5 @@
var merge = require('../')
var x = { foo : { 'bar' : 3 } }
var y = { foo : { 'baz' : 4 }, quux : 5 }
var merged = merge(x, y)
console.dir(merged)

52
node_modules/deepmerge/index.js generated vendored Normal file
View file

@ -0,0 +1,52 @@
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define(factory);
} else if (typeof exports === 'object') {
module.exports = factory();
} else {
root.deepmerge = factory();
}
}(this, function () {
return function deepmerge(target, src) {
var array = Array.isArray(src);
var dst = array && [] || {};
if (array) {
target = target || [];
dst = dst.concat(target);
src.forEach(function(e, i) {
if (typeof dst[i] === 'undefined') {
dst[i] = e;
} else if (typeof e === 'object') {
dst[i] = deepmerge(target[i], e);
} else {
if (target.indexOf(e) === -1) {
dst.push(e);
}
}
});
} else {
if (target && typeof target === 'object') {
Object.keys(target).forEach(function (key) {
dst[key] = target[key];
})
}
Object.keys(src).forEach(function (key) {
if (typeof src[key] !== 'object' || !src[key]) {
dst[key] = src[key];
}
else {
if (!target[key]) {
dst[key] = src[key];
} else {
dst[key] = deepmerge(target[key], src[key]);
}
}
});
}
return dst;
}
}));

21
node_modules/deepmerge/license.txt generated vendored Normal file
View file

@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2012 Nicholas Fisher
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.

88
node_modules/deepmerge/package.json generated vendored Normal file
View file

@ -0,0 +1,88 @@
{
"_args": [
[
{
"raw": "deepmerge@~0.2.7",
"scope": null,
"escapedName": "deepmerge",
"name": "deepmerge",
"rawSpec": "~0.2.7",
"spec": ">=0.2.7 <0.3.0",
"type": "range"
},
"/Users/jose/Documents/GitHub/Mods/node_modules/gulp-json-editor"
]
],
"_from": "deepmerge@>=0.2.7 <0.3.0",
"_id": "deepmerge@0.2.10",
"_inCache": true,
"_location": "/deepmerge",
"_nodeVersion": "0.10.35",
"_npmUser": {
"name": "kylemathews",
"email": "mathews.kyle@gmail.com"
},
"_npmVersion": "2.9.0",
"_phantomChildren": {},
"_requested": {
"raw": "deepmerge@~0.2.7",
"scope": null,
"escapedName": "deepmerge",
"name": "deepmerge",
"rawSpec": "~0.2.7",
"spec": ">=0.2.7 <0.3.0",
"type": "range"
},
"_requiredBy": [
"/gulp-json-editor"
],
"_resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-0.2.10.tgz",
"_shasum": "8906bf9e525a4fbf1b203b2afcb4640249821219",
"_shrinkwrap": null,
"_spec": "deepmerge@~0.2.7",
"_where": "/Users/jose/Documents/GitHub/Mods/node_modules/gulp-json-editor",
"author": {
"name": "Nick Fisher"
},
"bugs": {
"url": "https://github.com/nrf110/deepmerge/issues"
},
"dependencies": {},
"description": "A library for deep (recursive) merging of Javascript objects",
"devDependencies": {
"tap": "~0.4.8"
},
"directories": {},
"dist": {
"shasum": "8906bf9e525a4fbf1b203b2afcb4640249821219",
"tarball": "https://registry.npmjs.org/deepmerge/-/deepmerge-0.2.10.tgz"
},
"engines": {
"node": ">=0.4.0"
},
"gitHead": "2383571036c1d2f3b6db0b4342859867920a0084",
"homepage": "https://github.com/nrf110/deepmerge",
"license": "MIT",
"main": "index",
"maintainers": [
{
"name": "nfisher",
"email": "nfisher@trafficland.com"
},
{
"name": "kylemathews",
"email": "mathews.kyle@gmail.com"
}
],
"name": "deepmerge",
"optionalDependencies": {},
"readme": "ERROR: No README data found!",
"repository": {
"type": "git",
"url": "git://github.com/nrf110/deepmerge.git"
},
"scripts": {
"test": "tap test/*.js"
},
"version": "0.2.10"
}

222
node_modules/deepmerge/test/merge.js generated vendored Normal file
View file

@ -0,0 +1,222 @@
var merge = require('../')
var test = require('tap').test
test('add keys in target that do not exist at the root', function (t) {
var src = { key1: 'value1', key2: 'value2' }
target = {}
var res = merge(target, src)
t.deepEqual(target, {}, 'merge should be immutable')
t.deepEqual(res, src)
t.end()
})
test('merge existing simple keys in target at the roots', function (t) {
var src = { key1: 'changed', key2: 'value2' }
var target = { key1: 'value1', key3: 'value3' }
var expected = {
key1: 'changed',
key2: 'value2',
key3: 'value3'
}
t.deepEqual(target, { key1: 'value1', key3: 'value3' })
t.deepEqual(merge(target, src), expected)
t.end()
})
test('merge nested objects into target', function (t) {
var src = {
key1: {
subkey1: 'changed',
subkey3: 'added'
}
}
var target = {
key1: {
subkey1: 'value1',
subkey2: 'value2'
}
}
var expected = {
key1: {
subkey1: 'changed',
subkey2: 'value2',
subkey3: 'added'
}
}
t.deepEqual(target, {
key1: {
subkey1: 'value1',
subkey2: 'value2'
}
})
t.deepEqual(merge(target, src), expected)
t.end()
})
test('replace simple key with nested object in target', function (t) {
var src = {
key1: {
subkey1: 'subvalue1',
subkey2: 'subvalue2'
}
}
var target = {
key1: 'value1',
key2: 'value2'
}
var expected = {
key1: {
subkey1: 'subvalue1',
subkey2: 'subvalue2'
},
key2: 'value2'
}
t.deepEqual(target, { key1: 'value1', key2: 'value2' })
t.deepEqual(merge(target, src), expected)
t.end()
})
test('should add nested object in target', function(t) {
var src = {
"b": {
"c": {}
}
}
var target = {
"a": {}
}
var expected = {
"a": {},
"b": {
"c": {}
}
}
t.deepEqual(merge(target, src), expected)
t.end()
})
test('should replace object with simple key in target', function (t) {
var src = { key1: 'value1' }
var target = {
key1: {
subkey1: 'subvalue1',
subkey2: 'subvalue2'
},
key2: 'value2'
}
var expected = { key1: 'value1', key2: 'value2' }
t.deepEqual(target, {
key1: {
subkey1: 'subvalue1',
subkey2: 'subvalue2'
},
key2: 'value2'
})
t.deepEqual(merge(target, src), expected)
t.end()
})
test('should work on simple array', function (t) {
var src = ['one', 'three']
var target = ['one', 'two']
var expected = ['one', 'two', 'three']
t.deepEqual(target, ['one', 'two'])
t.deepEqual(merge(target, src), expected)
t.ok(Array.isArray(merge(target, src)))
t.end()
})
test('should work on another simple array', function(t) {
var target = ["a1","a2","c1","f1","p1"];
var src = ["t1","s1","c2","r1","p2","p3"];
var expected = ["a1", "a2", "c1", "f1", "p1", "t1", "s1", "c2", "r1", "p2", "p3"]
t.deepEqual(target, ["a1", "a2", "c1", "f1", "p1"])
t.deepEqual(merge(target, src), expected)
t.ok(Array.isArray(merge(target, src)))
t.end()
})
test('should work on array properties', function (t) {
var src = {
key1: ['one', 'three'],
key2: ['four']
}
var target = {
key1: ['one', 'two']
}
var expected = {
key1: ['one', 'two', 'three'],
key2: ['four']
}
t.deepEqual(target, {
key1: ['one', 'two']
})
t.deepEqual(merge(target, src), expected)
t.ok(Array.isArray(merge(target, src).key1))
t.ok(Array.isArray(merge(target, src).key2))
t.end()
})
test('should work on array of objects', function (t) {
var src = [
{ key1: ['one', 'three'], key2: ['one'] },
{ key3: ['five'] }
]
var target = [
{ key1: ['one', 'two'] },
{ key3: ['four'] }
]
var expected = [
{ key1: ['one', 'two', 'three'], key2: ['one'] },
{ key3: ['four', 'five'] }
]
t.deepEqual(target, [
{ key1: ['one', 'two'] },
{ key3: ['four'] }
])
t.deepEqual(merge(target, src), expected)
t.ok(Array.isArray(merge(target, src)), 'result should be an array')
t.ok(Array.isArray(merge(target, src)[0].key1), 'subkey should be an array too')
t.end()
})
test('should work on arrays of nested objects', function(t) {
var target = [
{ key1: { subkey: 'one' }}
]
var src = [
{ key1: { subkey: 'two' }},
{ key2: { subkey: 'three' }}
]
var expected = [
{ key1: { subkey: 'two' }},
{ key2: { subkey: 'three' }}
]
t.deepEqual(merge(target, src), expected)
t.end()
})