diff options
| author | Arman <[email protected]> | 2018-08-02 16:50:59 -0700 |
|---|---|---|
| committer | Arman <[email protected]> | 2018-08-02 16:50:59 -0700 |
| commit | 7d5a0696ccc642db0d14aae8677ecada40bf85d1 (patch) | |
| tree | 1bbbcf2f4c4a3a733326ac2401375f8d891cb2f1 /node_modules/deep-extend | |
| parent | dialog box for adding items (diff) | |
| download | launcher-7d5a0696ccc642db0d14aae8677ecada40bf85d1.tar.xz launcher-7d5a0696ccc642db0d14aae8677ecada40bf85d1.zip | |
inital commit
Diffstat (limited to 'node_modules/deep-extend')
| -rw-r--r-- | node_modules/deep-extend/CHANGELOG.md | 21 | ||||
| -rw-r--r-- | node_modules/deep-extend/LICENSE | 20 | ||||
| -rw-r--r-- | node_modules/deep-extend/README.md | 90 | ||||
| -rw-r--r-- | node_modules/deep-extend/index.js | 1 | ||||
| -rw-r--r-- | node_modules/deep-extend/lib/deep-extend.js | 144 | ||||
| -rw-r--r-- | node_modules/deep-extend/package.json | 93 |
6 files changed, 0 insertions, 369 deletions
diff --git a/node_modules/deep-extend/CHANGELOG.md b/node_modules/deep-extend/CHANGELOG.md deleted file mode 100644 index f3efe0b..0000000 --- a/node_modules/deep-extend/CHANGELOG.md +++ /dev/null @@ -1,21 +0,0 @@ -Changelog -========= - -v0.4.1 ------- - -- Removed test code from <b>npm</b> package - ([see pull request #21](https://github.com/unclechu/node-deep-extend/pull/21)); -- Increased minimal version of Node from 0.4.0 to 0.12.0 - (because can't run tests on lesser version anyway). - -v0.4.0 ------- - -Broken backward compatibility with v0.3.x - -- Fixed bug with extending arrays instead of cloning; -- Deep cloning for arrays; -- Check for own property; -- Fixed some documentation issues; -- Strict JS mode. diff --git a/node_modules/deep-extend/LICENSE b/node_modules/deep-extend/LICENSE deleted file mode 100644 index acc4662..0000000 --- a/node_modules/deep-extend/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2013-2015, Viacheslav Lotsmanov - -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. diff --git a/node_modules/deep-extend/README.md b/node_modules/deep-extend/README.md deleted file mode 100644 index 7002224..0000000 --- a/node_modules/deep-extend/README.md +++ /dev/null @@ -1,90 +0,0 @@ -Deep Extend -=========== - -Recursive object extending. - -[](https://nodei.co/npm/deep-extend/) -[](https://nodei.co/npm/deep-extend/) - -Install -------- - -```bash -$ npm install deep-extend -``` - -Usage ------ - -```javascript -var deepExtend = require('deep-extend'); -var obj1 = { - a: 1, - b: 2, - d: { - a: 1, - b: [], - c: { test1: 123, test2: 321 } - }, - f: 5, - g: 123, - i: 321, - j: [1, 2] -}; -var obj2 = { - b: 3, - c: 5, - d: { - b: { first: 'one', second: 'two' }, - c: { test2: 222 } - }, - e: { one: 1, two: 2 }, - f: [], - g: (void 0), - h: /abc/g, - i: null, - j: [3, 4] -}; - -deepExtend(obj1, obj2); - -console.log(obj1); -/* -{ a: 1, - b: 3, - d: - { a: 1, - b: { first: 'one', second: 'two' }, - c: { test1: 123, test2: 222 } }, - f: [], - g: undefined, - c: 5, - e: { one: 1, two: 2 }, - h: /abc/g, - i: null, - j: [3, 4] } -*/ -``` - -Unit testing ------------- - -```bash -$ npm test -``` - -Changelog ---------- - -[CHANGELOG.md](./CHANGELOG.md) - -Any issues? ------------ - -Please, report about issues -[here](https://github.com/unclechu/node-deep-extend/issues). - -License -------- - -[MIT](./LICENSE) diff --git a/node_modules/deep-extend/index.js b/node_modules/deep-extend/index.js deleted file mode 100644 index 762d81e..0000000 --- a/node_modules/deep-extend/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./lib/deep-extend'); diff --git a/node_modules/deep-extend/lib/deep-extend.js b/node_modules/deep-extend/lib/deep-extend.js deleted file mode 100644 index 08f70ed..0000000 --- a/node_modules/deep-extend/lib/deep-extend.js +++ /dev/null @@ -1,144 +0,0 @@ -/*! - * @description Recursive object extending - * @author Viacheslav Lotsmanov <[email protected]> - * @license MIT - * - * The MIT License (MIT) - * - * Copyright (c) 2013-2015 Viacheslav Lotsmanov - * - * 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. - */ - -'use strict'; - -function isSpecificValue(val) { - return ( - val instanceof Buffer - || val instanceof Date - || val instanceof RegExp - ) ? true : false; -} - -function cloneSpecificValue(val) { - if (val instanceof Buffer) { - var x = new Buffer(val.length); - val.copy(x); - return x; - } else if (val instanceof Date) { - return new Date(val.getTime()); - } else if (val instanceof RegExp) { - return new RegExp(val); - } else { - throw new Error('Unexpected situation'); - } -} - -/** - * Recursive cloning array. - */ -function deepCloneArray(arr) { - var clone = []; - arr.forEach(function (item, index) { - if (typeof item === 'object' && item !== null) { - if (Array.isArray(item)) { - clone[index] = deepCloneArray(item); - } else if (isSpecificValue(item)) { - clone[index] = cloneSpecificValue(item); - } else { - clone[index] = deepExtend({}, item); - } - } else { - clone[index] = item; - } - }); - return clone; -} - -/** - * Extening object that entered in first argument. - * - * Returns extended object or false if have no target object or incorrect type. - * - * If you wish to clone source object (without modify it), just use empty new - * object as first argument, like this: - * deepExtend({}, yourObj_1, [yourObj_N]); - */ -var deepExtend = module.exports = function (/*obj_1, [obj_2], [obj_N]*/) { - if (arguments.length < 1 || typeof arguments[0] !== 'object') { - return false; - } - - if (arguments.length < 2) { - return arguments[0]; - } - - var target = arguments[0]; - - // convert arguments to array and cut off target object - var args = Array.prototype.slice.call(arguments, 1); - - var val, src, clone; - - args.forEach(function (obj) { - // skip argument if isn't an object, is null, or is an array - if (typeof obj !== 'object' || obj === null || Array.isArray(obj)) { - return; - } - - Object.keys(obj).forEach(function (key) { - src = target[key]; // source value - val = obj[key]; // new value - - // recursion prevention - if (val === target) { - return; - - /** - * if new value isn't object then just overwrite by new value - * instead of extending. - */ - } else if (typeof val !== 'object' || val === null) { - target[key] = val; - return; - - // just clone arrays (and recursive clone objects inside) - } else if (Array.isArray(val)) { - target[key] = deepCloneArray(val); - return; - - // custom cloning and overwrite for specific objects - } else if (isSpecificValue(val)) { - target[key] = cloneSpecificValue(val); - return; - - // overwrite by new value if source isn't object or array - } else if (typeof src !== 'object' || src === null || Array.isArray(src)) { - target[key] = deepExtend({}, val); - return; - - // source value and new value is objects both, extending... - } else { - target[key] = deepExtend(src, val); - return; - } - }); - }); - - return target; -} diff --git a/node_modules/deep-extend/package.json b/node_modules/deep-extend/package.json deleted file mode 100644 index 3ce9c12..0000000 --- a/node_modules/deep-extend/package.json +++ /dev/null @@ -1,93 +0,0 @@ -{ - "_from": "deep-extend@~0.4.0", - "_id": "[email protected]", - "_inBundle": false, - "_integrity": "sha1-SLaZwn4zS/ifEIkr5DL25MfTSn8=", - "_location": "/deep-extend", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "deep-extend@~0.4.0", - "name": "deep-extend", - "escapedName": "deep-extend", - "rawSpec": "~0.4.0", - "saveSpec": null, - "fetchSpec": "~0.4.0" - }, - "_requiredBy": [ - "/rc" - ], - "_resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.4.2.tgz", - "_shasum": "48b699c27e334bf89f10892be432f6e4c7d34a7f", - "_spec": "deep-extend@~0.4.0", - "_where": "/Users/armanshah/Desktop/node-projects/shopping-list/node_modules/rc", - "author": { - "name": "Viacheslav Lotsmanov", - "email": "[email protected]" - }, - "bugs": { - "url": "https://github.com/unclechu/node-deep-extend/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Romain Prieto", - "url": "https://github.com/rprieto" - }, - { - "name": "Max Maximov", - "url": "https://github.com/maxmaximov" - }, - { - "name": "Marshall Bowers", - "url": "https://github.com/maxdeviant" - } - ], - "deprecated": false, - "description": "Recursive object extending", - "devDependencies": { - "mocha": "^2.2.1", - "should": "^5.2.0" - }, - "directories": { - "lib": "./lib/", - "test": "./test/" - }, - "engines": { - "iojs": ">=1.0.0", - "node": ">=0.12.0" - }, - "files": [ - "lib/deep-extend.js", - "index.js" - ], - "homepage": "https://github.com/unclechu/node-deep-extend", - "keywords": [ - "deep-extend", - "extend", - "deep", - "recursive", - "xtend", - "clone", - "merge", - "json" - ], - "license": "MIT", - "licenses": [ - { - "type": "MIT", - "url": "https://raw.githubusercontent.com/unclechu/node-deep-extend/master/LICENSE" - } - ], - "main": "lib/deep-extend.js", - "name": "deep-extend", - "repository": { - "type": "git", - "url": "git://github.com/unclechu/node-deep-extend.git" - }, - "scripts": { - "test": "mocha" - }, - "version": "0.4.2" -} |