aboutsummaryrefslogtreecommitdiffstats
path: root/npm_assets/node_modules/merge
diff options
context:
space:
mode:
Diffstat (limited to 'npm_assets/node_modules/merge')
-rw-r--r--npm_assets/node_modules/merge/LICENSE21
-rw-r--r--npm_assets/node_modules/merge/README.md58
-rw-r--r--npm_assets/node_modules/merge/bower.json22
-rw-r--r--npm_assets/node_modules/merge/merge.js177
-rw-r--r--npm_assets/node_modules/merge/merge.min.js3
-rw-r--r--npm_assets/node_modules/merge/package.json54
6 files changed, 335 insertions, 0 deletions
diff --git a/npm_assets/node_modules/merge/LICENSE b/npm_assets/node_modules/merge/LICENSE
new file mode 100644
index 0000000..06cc243
--- /dev/null
+++ b/npm_assets/node_modules/merge/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2014 yeikos
+
+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. \ No newline at end of file
diff --git a/npm_assets/node_modules/merge/README.md b/npm_assets/node_modules/merge/README.md
new file mode 100644
index 0000000..1d38059
--- /dev/null
+++ b/npm_assets/node_modules/merge/README.md
@@ -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="https://cdn.jsdelivr.net/gh/yeikos/js.merge/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
+```
diff --git a/npm_assets/node_modules/merge/bower.json b/npm_assets/node_modules/merge/bower.json
new file mode 100644
index 0000000..5f867a3
--- /dev/null
+++ b/npm_assets/node_modules/merge/bower.json
@@ -0,0 +1,22 @@
+{
+ "name": "merge",
+ "version": "1.2.1",
+ "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"
+ ]
+}
diff --git a/npm_assets/node_modules/merge/merge.js b/npm_assets/node_modules/merge/merge.js
new file mode 100644
index 0000000..1a9ac77
--- /dev/null
+++ b/npm_assets/node_modules/merge/merge.js
@@ -0,0 +1,177 @@
+/*!
+ * @name JavaScript/NodeJS Merge v1.2.1
+ * @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) {
+
+ if (key === '__proto__') continue;
+
+ 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); \ No newline at end of file
diff --git a/npm_assets/node_modules/merge/merge.min.js b/npm_assets/node_modules/merge/merge.min.js
new file mode 100644
index 0000000..17822e0
--- /dev/null
+++ b/npm_assets/node_modules/merge/merge.min.js
@@ -0,0 +1,3 @@
+/*! JavaScript/NodeJS Merge v1.2.1 | 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){if(c==="__proto__")continue;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); \ No newline at end of file
diff --git a/npm_assets/node_modules/merge/package.json b/npm_assets/node_modules/merge/package.json
new file mode 100644
index 0000000..90e7347
--- /dev/null
+++ b/npm_assets/node_modules/merge/package.json
@@ -0,0 +1,54 @@
+{
+ "_from": "merge@1.2.1",
+ "_id": "merge@1.2.1",
+ "_inBundle": false,
+ "_integrity": "sha512-VjFo4P5Whtj4vsLzsYBu5ayHhoHJ0UqNm7ibvShmbmoz7tGi0vXaoJbGdB+GmDMLUdg8DpQXEIeVDAe8MaABvQ==",
+ "_location": "/merge",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "version",
+ "registry": true,
+ "raw": "merge@1.2.1",
+ "name": "merge",
+ "escapedName": "merge",
+ "rawSpec": "1.2.1",
+ "saveSpec": null,
+ "fetchSpec": "1.2.1"
+ },
+ "_requiredBy": [
+ "/justified-layout"
+ ],
+ "_resolved": "https://registry.npmjs.org/merge/-/merge-1.2.1.tgz",
+ "_shasum": "38bebf80c3220a8a487b6fcfb3941bb11720c145",
+ "_spec": "merge@1.2.1",
+ "_where": "/Users/kwpolska/git/nikola/npm_assets/node_modules/justified-layout",
+ "author": {
+ "name": "yeikos"
+ },
+ "bugs": {
+ "url": "https://github.com/yeikos/js.merge/issues"
+ },
+ "bundleDependencies": false,
+ "deprecated": false,
+ "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.",
+ "homepage": "https://github.com/yeikos/js.merge",
+ "keywords": [
+ "merge",
+ "recursive",
+ "extend",
+ "clone",
+ "object",
+ "browser"
+ ],
+ "license": "MIT",
+ "main": "merge.js",
+ "name": "merge",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/yeikos/js.merge.git"
+ },
+ "scripts": {
+ "test": "cd tests; node index.js"
+ },
+ "version": "1.2.1"
+}