Pushing changes
This commit is contained in:
1
node_modules/merge/.npmignore
generated
vendored
Normal file
1
node_modules/merge/.npmignore
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
tests
|
21
node_modules/merge/LICENSE
generated
vendored
Normal file
21
node_modules/merge/LICENSE
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014 yeikos - http://www.yeikos.com
|
||||
|
||||
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.
|
58
node_modules/merge/README.md
generated
vendored
Normal file
58
node_modules/merge/README.md
generated
vendored
Normal file
@ -0,0 +1,58 @@
|
||||
# Merge
|
||||
|
||||
Merge multiple objects into one, optionally creating a new cloned object.
|
||||
Similar to the jQuery.extend but more flexible. Works in Node.js and the
|
||||
browser.
|
||||
|
||||
## Node.js Usage
|
||||
|
||||
```sh
|
||||
npm install merge --save
|
||||
```
|
||||
|
||||
```js
|
||||
var merge = require('merge'), original, cloned;
|
||||
|
||||
console.log(merge({one:'hello'}, {two: 'world'}));
|
||||
// -> {"one": "hello", "two": "world"}
|
||||
|
||||
original = { x: { y: 1 } };
|
||||
cloned = merge(true, original);
|
||||
cloned.x.y++;
|
||||
|
||||
console.log(original.x.y, cloned.x.y);
|
||||
// -> 1, 2
|
||||
|
||||
console.log(merge.recursive(true, original, { x: { z: 2 } }));
|
||||
// -> {"x": { "y": 1, "z": 2 } }
|
||||
|
||||
```
|
||||
|
||||
## Browser Usage
|
||||
|
||||
```html
|
||||
<script src="http://files.yeikos.com/merge.js"></script>
|
||||
<script>
|
||||
var original, cloned;
|
||||
|
||||
console.log(merge({one:'hello'}, {two: 'world'}));
|
||||
// -> {"one": "hello", "two": "world"}
|
||||
|
||||
original = { x: { y: 1 } };
|
||||
cloned = merge(true, original);
|
||||
cloned.x.y++;
|
||||
|
||||
console.log(original.x.y, cloned.x.y);
|
||||
// -> 1, 2
|
||||
|
||||
console.log(merge.recursive(true, original, { x: { z: 2 } }));
|
||||
// -> {"x": { "y": 1, "z": 2 } }
|
||||
|
||||
</script>
|
||||
```
|
||||
|
||||
## Tests
|
||||
|
||||
```sh
|
||||
npm test
|
||||
```
|
22
node_modules/merge/bower.json
generated
vendored
Normal file
22
node_modules/merge/bower.json
generated
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
{
|
||||
"name": "merge",
|
||||
"version": "1.2.0",
|
||||
"homepage": "https://github.com/yeikos/js.merge",
|
||||
"authors": [
|
||||
"yeikos <yeikos@gmail.com>"
|
||||
],
|
||||
"description": "Merge multiple objects into one, optionally creating a new cloned object. Similar to the jQuery.extend but more flexible. Works in Node.js and the browser.",
|
||||
"main": "merge.js",
|
||||
"keywords": [
|
||||
"merge",
|
||||
"recursive",
|
||||
"extend",
|
||||
"clone",
|
||||
"object",
|
||||
"browser"
|
||||
],
|
||||
"license": "MIT",
|
||||
"ignore": [
|
||||
"tests"
|
||||
]
|
||||
}
|
175
node_modules/merge/merge.js
generated
vendored
Normal file
175
node_modules/merge/merge.js
generated
vendored
Normal file
@ -0,0 +1,175 @@
|
||||
/*!
|
||||
* @name JavaScript/NodeJS Merge v1.2.0
|
||||
* @author yeikos
|
||||
* @repository https://github.com/yeikos/js.merge
|
||||
|
||||
* Copyright 2014 yeikos - MIT license
|
||||
* https://raw.github.com/yeikos/js.merge/master/LICENSE
|
||||
*/
|
||||
|
||||
;(function(isNode) {
|
||||
|
||||
/**
|
||||
* Merge one or more objects
|
||||
* @param bool? clone
|
||||
* @param mixed,... arguments
|
||||
* @return object
|
||||
*/
|
||||
|
||||
var Public = function(clone) {
|
||||
|
||||
return merge(clone === true, false, arguments);
|
||||
|
||||
}, publicName = 'merge';
|
||||
|
||||
/**
|
||||
* Merge two or more objects recursively
|
||||
* @param bool? clone
|
||||
* @param mixed,... arguments
|
||||
* @return object
|
||||
*/
|
||||
|
||||
Public.recursive = function(clone) {
|
||||
|
||||
return merge(clone === true, true, arguments);
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* Clone the input removing any reference
|
||||
* @param mixed input
|
||||
* @return mixed
|
||||
*/
|
||||
|
||||
Public.clone = function(input) {
|
||||
|
||||
var output = input,
|
||||
type = typeOf(input),
|
||||
index, size;
|
||||
|
||||
if (type === 'array') {
|
||||
|
||||
output = [];
|
||||
size = input.length;
|
||||
|
||||
for (index=0;index<size;++index)
|
||||
|
||||
output[index] = Public.clone(input[index]);
|
||||
|
||||
} else if (type === 'object') {
|
||||
|
||||
output = {};
|
||||
|
||||
for (index in input)
|
||||
|
||||
output[index] = Public.clone(input[index]);
|
||||
|
||||
}
|
||||
|
||||
return output;
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* Merge two objects recursively
|
||||
* @param mixed input
|
||||
* @param mixed extend
|
||||
* @return mixed
|
||||
*/
|
||||
|
||||
function merge_recursive(base, extend) {
|
||||
|
||||
if (typeOf(base) !== 'object')
|
||||
|
||||
return extend;
|
||||
|
||||
for (var key in extend) {
|
||||
|
||||
if (typeOf(base[key]) === 'object' && typeOf(extend[key]) === 'object') {
|
||||
|
||||
base[key] = merge_recursive(base[key], extend[key]);
|
||||
|
||||
} else {
|
||||
|
||||
base[key] = extend[key];
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return base;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Merge two or more objects
|
||||
* @param bool clone
|
||||
* @param bool recursive
|
||||
* @param array argv
|
||||
* @return object
|
||||
*/
|
||||
|
||||
function merge(clone, recursive, argv) {
|
||||
|
||||
var result = argv[0],
|
||||
size = argv.length;
|
||||
|
||||
if (clone || typeOf(result) !== 'object')
|
||||
|
||||
result = {};
|
||||
|
||||
for (var index=0;index<size;++index) {
|
||||
|
||||
var item = argv[index],
|
||||
|
||||
type = typeOf(item);
|
||||
|
||||
if (type !== 'object') continue;
|
||||
|
||||
for (var key in item) {
|
||||
|
||||
var sitem = clone ? Public.clone(item[key]) : item[key];
|
||||
|
||||
if (recursive) {
|
||||
|
||||
result[key] = merge_recursive(result[key], sitem);
|
||||
|
||||
} else {
|
||||
|
||||
result[key] = sitem;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Get type of variable
|
||||
* @param mixed input
|
||||
* @return string
|
||||
*
|
||||
* @see http://jsperf.com/typeofvar
|
||||
*/
|
||||
|
||||
function typeOf(input) {
|
||||
|
||||
return ({}).toString.call(input).slice(8, -1).toLowerCase();
|
||||
|
||||
}
|
||||
|
||||
if (isNode) {
|
||||
|
||||
module.exports = Public;
|
||||
|
||||
} else {
|
||||
|
||||
window[publicName] = Public;
|
||||
|
||||
}
|
||||
|
||||
})(typeof module === 'object' && module && typeof module.exports === 'object' && module.exports);
|
3
node_modules/merge/merge.min.js
generated
vendored
Normal file
3
node_modules/merge/merge.min.js
generated
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
/*! JavaScript/NodeJS Merge v1.2.0 | Copyright 2014 yeikos - MIT license | https://github.com/yeikos/js.merge */
|
||||
|
||||
;(function(e){function r(e,t){if(s(e)!=="object")return t;for(var n in t){if(s(e[n])==="object"&&s(t[n])==="object"){e[n]=r(e[n],t[n])}else{e[n]=t[n]}}return e}function i(e,n,i){var o=i[0],u=i.length;if(e||s(o)!=="object")o={};for(var a=0;a<u;++a){var f=i[a],l=s(f);if(l!=="object")continue;for(var c in f){var h=e?t.clone(f[c]):f[c];if(n){o[c]=r(o[c],h)}else{o[c]=h}}}return o}function s(e){return{}.toString.call(e).slice(8,-1).toLowerCase()}var t=function(e){return i(e===true,false,arguments)},n="merge";t.recursive=function(e){return i(e===true,true,arguments)};t.clone=function(e){var n=e,r=s(e),i,o;if(r==="array"){n=[];o=e.length;for(i=0;i<o;++i)n[i]=t.clone(e[i])}else if(r==="object"){n={};for(i in e)n[i]=t.clone(e[i])}return n};if(e){module.exports=t}else{window[n]=t}})(typeof module==="object"&&module&&typeof module.exports==="object"&&module.exports);
|
87
node_modules/merge/package.json
generated
vendored
Normal file
87
node_modules/merge/package.json
generated
vendored
Normal file
@ -0,0 +1,87 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
{
|
||||
"raw": "merge@^1.2.0",
|
||||
"scope": null,
|
||||
"escapedName": "merge",
|
||||
"name": "merge",
|
||||
"rawSpec": "^1.2.0",
|
||||
"spec": ">=1.2.0 <2.0.0",
|
||||
"type": "range"
|
||||
},
|
||||
"/home/burchettm/statsbot/node_modules/console-stamp"
|
||||
]
|
||||
],
|
||||
"_from": "merge@>=1.2.0 <2.0.0",
|
||||
"_id": "merge@1.2.0",
|
||||
"_inCache": true,
|
||||
"_location": "/merge",
|
||||
"_npmUser": {
|
||||
"name": "yeikos",
|
||||
"email": "yeikos@gmail.com"
|
||||
},
|
||||
"_npmVersion": "1.4.21",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"raw": "merge@^1.2.0",
|
||||
"scope": null,
|
||||
"escapedName": "merge",
|
||||
"name": "merge",
|
||||
"rawSpec": "^1.2.0",
|
||||
"spec": ">=1.2.0 <2.0.0",
|
||||
"type": "range"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/console-stamp"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/merge/-/merge-1.2.0.tgz",
|
||||
"_shasum": "7531e39d4949c281a66b8c5a6e0265e8b05894da",
|
||||
"_shrinkwrap": null,
|
||||
"_spec": "merge@^1.2.0",
|
||||
"_where": "/home/burchettm/statsbot/node_modules/console-stamp",
|
||||
"author": {
|
||||
"name": "yeikos",
|
||||
"url": "http://www.yeikos.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/yeikos/js.merge/issues"
|
||||
},
|
||||
"dependencies": {},
|
||||
"description": "Merge multiple objects into one, optionally creating a new cloned object. Similar to the jQuery.extend but more flexible. Works in Node.js and the browser.",
|
||||
"devDependencies": {},
|
||||
"directories": {},
|
||||
"dist": {
|
||||
"shasum": "7531e39d4949c281a66b8c5a6e0265e8b05894da",
|
||||
"tarball": "https://registry.npmjs.org/merge/-/merge-1.2.0.tgz"
|
||||
},
|
||||
"gitHead": "6fc27c23e1ebf54a4f6ba8a7224dd48dfd9faf7c",
|
||||
"homepage": "https://github.com/yeikos/js.merge",
|
||||
"keywords": [
|
||||
"merge",
|
||||
"recursive",
|
||||
"extend",
|
||||
"clone",
|
||||
"object",
|
||||
"browser"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "merge.js",
|
||||
"maintainers": [
|
||||
{
|
||||
"name": "yeikos",
|
||||
"email": "yeikos@gmail.com"
|
||||
}
|
||||
],
|
||||
"name": "merge",
|
||||
"optionalDependencies": {},
|
||||
"readme": "ERROR: No README data found!",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/yeikos/js.merge.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "cd tests; node index.js"
|
||||
},
|
||||
"version": "1.2.0"
|
||||
}
|
Reference in New Issue
Block a user