summaryrefslogtreecommitdiff
path: root/deps/npm/node_modules/util-extend
diff options
context:
space:
mode:
Diffstat (limited to 'deps/npm/node_modules/util-extend')
-rw-r--r--deps/npm/node_modules/util-extend/LICENSE18
-rw-r--r--deps/npm/node_modules/util-extend/README.md13
-rw-r--r--deps/npm/node_modules/util-extend/extend.js33
-rw-r--r--deps/npm/node_modules/util-extend/package.json45
-rw-r--r--deps/npm/node_modules/util-extend/test.js10
5 files changed, 119 insertions, 0 deletions
diff --git a/deps/npm/node_modules/util-extend/LICENSE b/deps/npm/node_modules/util-extend/LICENSE
new file mode 100644
index 0000000000..e3d4e695a4
--- /dev/null
+++ b/deps/npm/node_modules/util-extend/LICENSE
@@ -0,0 +1,18 @@
+Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+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/deps/npm/node_modules/util-extend/README.md b/deps/npm/node_modules/util-extend/README.md
new file mode 100644
index 0000000000..be03922ab0
--- /dev/null
+++ b/deps/npm/node_modules/util-extend/README.md
@@ -0,0 +1,13 @@
+# util-extend
+
+The Node object extending function that Node uses for Node!
+
+## Usage
+
+```js
+var extend = require('util-extend');
+function functionThatTakesOptions(options) {
+ var options = extend(defaults, options);
+ // now any unset options are set to the defaults.
+}
+```
diff --git a/deps/npm/node_modules/util-extend/extend.js b/deps/npm/node_modules/util-extend/extend.js
new file mode 100644
index 0000000000..de9fcf471a
--- /dev/null
+++ b/deps/npm/node_modules/util-extend/extend.js
@@ -0,0 +1,33 @@
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// 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.
+
+module.exports = extend;
+function extend(origin, add) {
+ // Don't do anything if add isn't an object
+ if (!add || typeof add !== 'object') return origin;
+
+ var keys = Object.keys(add);
+ var i = keys.length;
+ while (i--) {
+ origin[keys[i]] = add[keys[i]];
+ }
+ return origin;
+}
diff --git a/deps/npm/node_modules/util-extend/package.json b/deps/npm/node_modules/util-extend/package.json
new file mode 100644
index 0000000000..fa05e6bb12
--- /dev/null
+++ b/deps/npm/node_modules/util-extend/package.json
@@ -0,0 +1,45 @@
+{
+ "_from": "util-extend@^1.0.1",
+ "_id": "util-extend@1.0.3",
+ "_inBundle": false,
+ "_integrity": "sha1-p8IW0mdUUWljeztu3GypEZ4v+T8=",
+ "_location": "/util-extend",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "range",
+ "registry": true,
+ "raw": "util-extend@^1.0.1",
+ "name": "util-extend",
+ "escapedName": "util-extend",
+ "rawSpec": "^1.0.1",
+ "saveSpec": null,
+ "fetchSpec": "^1.0.1"
+ },
+ "_requiredBy": [
+ "/npm-registry-mock",
+ "/read-installed"
+ ],
+ "_resolved": "https://registry.npmjs.org/util-extend/-/util-extend-1.0.3.tgz",
+ "_shasum": "a7c216d267545169637b3b6edc6ca9119e2ff93f",
+ "_spec": "util-extend@^1.0.1",
+ "_where": "/Users/rebecca/code/npm/node_modules/read-installed",
+ "author": "",
+ "bugs": {
+ "url": "https://github.com/isaacs/util-extend/issues"
+ },
+ "bundleDependencies": false,
+ "deprecated": false,
+ "description": "Node's internal object extension function",
+ "homepage": "https://github.com/isaacs/util-extend#readme",
+ "license": "MIT",
+ "main": "extend.js",
+ "name": "util-extend",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/isaacs/util-extend.git"
+ },
+ "scripts": {
+ "test": "node test.js"
+ },
+ "version": "1.0.3"
+}
diff --git a/deps/npm/node_modules/util-extend/test.js b/deps/npm/node_modules/util-extend/test.js
new file mode 100644
index 0000000000..fbee2b1e1b
--- /dev/null
+++ b/deps/npm/node_modules/util-extend/test.js
@@ -0,0 +1,10 @@
+var assert = require('assert');
+var extend = require('./');
+assert.deepEqual(extend({a:1}), {a:1});
+assert.deepEqual(extend({a:1}, []), {a:1});
+assert.deepEqual(extend({a:1}, null), {a:1});
+assert.deepEqual(extend({a:1}, true), {a:1});
+assert.deepEqual(extend({a:1}, false), {a:1});
+assert.deepEqual(extend({a:1}, {b:2}), {a:1, b:2});
+assert.deepEqual(extend({a:1, b:2}, {b:3}), {a:1, b:3});
+console.log('ok');