style Dashboard
This commit is contained in:
1
node_modules/defaults/.npmignore
generated
vendored
Executable file
1
node_modules/defaults/.npmignore
generated
vendored
Executable file
@@ -0,0 +1 @@
|
||||
node_modules
|
||||
21
node_modules/defaults/LICENSE
generated
vendored
Executable file
21
node_modules/defaults/LICENSE
generated
vendored
Executable file
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2015 Elijah Insua
|
||||
|
||||
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.
|
||||
43
node_modules/defaults/README.md
generated
vendored
Executable file
43
node_modules/defaults/README.md
generated
vendored
Executable file
@@ -0,0 +1,43 @@
|
||||
# defaults
|
||||
|
||||
A simple one level options merge utility
|
||||
|
||||
## install
|
||||
|
||||
`npm install defaults`
|
||||
|
||||
## use
|
||||
|
||||
```javascript
|
||||
|
||||
var defaults = require('defaults');
|
||||
|
||||
var handle = function(options, fn) {
|
||||
options = defaults(options, {
|
||||
timeout: 100
|
||||
});
|
||||
|
||||
setTimeout(function() {
|
||||
fn(options);
|
||||
}, options.timeout);
|
||||
}
|
||||
|
||||
handle({ timeout: 1000 }, function() {
|
||||
// we're here 1000 ms later
|
||||
});
|
||||
|
||||
handle({ timeout: 10000 }, function() {
|
||||
// we're here 10s later
|
||||
});
|
||||
|
||||
```
|
||||
|
||||
## summary
|
||||
|
||||
this module exports a function that takes 2 arguments: `options` and `defaults`. When called, it overrides all of `undefined` properties in `options` with the clones of properties defined in `defaults`
|
||||
|
||||
Sidecases: if called with a falsy `options` value, options will be initialized to a new object before being merged onto.
|
||||
|
||||
## license
|
||||
|
||||
[MIT](LICENSE)
|
||||
13
node_modules/defaults/index.js
generated
vendored
Executable file
13
node_modules/defaults/index.js
generated
vendored
Executable file
@@ -0,0 +1,13 @@
|
||||
var clone = require('clone');
|
||||
|
||||
module.exports = function(options, defaults) {
|
||||
options = options || {};
|
||||
|
||||
Object.keys(defaults).forEach(function(key) {
|
||||
if (typeof options[key] === 'undefined') {
|
||||
options[key] = clone(defaults[key]);
|
||||
}
|
||||
});
|
||||
|
||||
return options;
|
||||
};
|
||||
4
node_modules/defaults/node_modules/clone/.npmignore
generated
vendored
Normal file
4
node_modules/defaults/node_modules/clone/.npmignore
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
/node_modules/
|
||||
/test.js
|
||||
/*.html
|
||||
/.travis.yml
|
||||
18
node_modules/defaults/node_modules/clone/LICENSE
generated
vendored
Normal file
18
node_modules/defaults/node_modules/clone/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
Copyright © 2011-2015 Paul Vorbach <paul@vorba.ch>
|
||||
|
||||
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, OUT OF OR IN CONNECTION WITH THE
|
||||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
126
node_modules/defaults/node_modules/clone/README.md
generated
vendored
Normal file
126
node_modules/defaults/node_modules/clone/README.md
generated
vendored
Normal file
@@ -0,0 +1,126 @@
|
||||
# clone
|
||||
|
||||
[](http://travis-ci.org/pvorb/node-clone)
|
||||
|
||||
[](http://npm-stat.com/charts.html?package=clone)
|
||||
|
||||
offers foolproof _deep cloning_ of objects, arrays, numbers, strings etc. in JavaScript.
|
||||
|
||||
|
||||
## Installation
|
||||
|
||||
npm install clone
|
||||
|
||||
(It also works with browserify, ender or standalone.)
|
||||
|
||||
|
||||
## Example
|
||||
|
||||
~~~ javascript
|
||||
var clone = require('clone');
|
||||
|
||||
var a, b;
|
||||
|
||||
a = { foo: { bar: 'baz' } }; // initial value of a
|
||||
|
||||
b = clone(a); // clone a -> b
|
||||
a.foo.bar = 'foo'; // change a
|
||||
|
||||
console.log(a); // show a
|
||||
console.log(b); // show b
|
||||
~~~
|
||||
|
||||
This will print:
|
||||
|
||||
~~~ javascript
|
||||
{ foo: { bar: 'foo' } }
|
||||
{ foo: { bar: 'baz' } }
|
||||
~~~
|
||||
|
||||
**clone** masters cloning simple objects (even with custom prototype), arrays,
|
||||
Date objects, and RegExp objects. Everything is cloned recursively, so that you
|
||||
can clone dates in arrays in objects, for example.
|
||||
|
||||
|
||||
## API
|
||||
|
||||
`clone(val, circular, depth)`
|
||||
|
||||
* `val` -- the value that you want to clone, any type allowed
|
||||
* `circular` -- boolean
|
||||
|
||||
Call `clone` with `circular` set to `false` if you are certain that `obj`
|
||||
contains no circular references. This will give better performance if needed.
|
||||
There is no error if `undefined` or `null` is passed as `obj`.
|
||||
* `depth` -- depth to which the object is to be cloned (optional,
|
||||
defaults to infinity)
|
||||
|
||||
`clone.clonePrototype(obj)`
|
||||
|
||||
* `obj` -- the object that you want to clone
|
||||
|
||||
Does a prototype clone as
|
||||
[described by Oran Looney](http://oranlooney.com/functional-javascript/).
|
||||
|
||||
|
||||
## Circular References
|
||||
|
||||
~~~ javascript
|
||||
var a, b;
|
||||
|
||||
a = { hello: 'world' };
|
||||
|
||||
a.myself = a;
|
||||
b = clone(a);
|
||||
|
||||
console.log(b);
|
||||
~~~
|
||||
|
||||
This will print:
|
||||
|
||||
~~~ javascript
|
||||
{ hello: "world", myself: [Circular] }
|
||||
~~~
|
||||
|
||||
So, `b.myself` points to `b`, not `a`. Neat!
|
||||
|
||||
|
||||
## Test
|
||||
|
||||
npm test
|
||||
|
||||
|
||||
## Caveat
|
||||
|
||||
Some special objects like a socket or `process.stdout`/`stderr` are known to not
|
||||
be cloneable. If you find other objects that cannot be cloned, please [open an
|
||||
issue](https://github.com/pvorb/node-clone/issues/new).
|
||||
|
||||
|
||||
## Bugs and Issues
|
||||
|
||||
If you encounter any bugs or issues, feel free to [open an issue at
|
||||
github](https://github.com/pvorb/node-clone/issues) or send me an email to
|
||||
<paul@vorba.ch>. I also always like to hear from you, if you’re using my code.
|
||||
|
||||
## License
|
||||
|
||||
Copyright © 2011-2015 [Paul Vorbach](http://paul.vorba.ch/) and
|
||||
[contributors](https://github.com/pvorb/node-clone/graphs/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, OUT OF OR IN CONNECTION WITH THE
|
||||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
10
node_modules/defaults/node_modules/clone/clone.iml
generated
vendored
Normal file
10
node_modules/defaults/node_modules/clone/clone.iml
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="WEB_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$" />
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="library" name="clone node_modules" level="project" />
|
||||
</component>
|
||||
</module>
|
||||
166
node_modules/defaults/node_modules/clone/clone.js
generated
vendored
Normal file
166
node_modules/defaults/node_modules/clone/clone.js
generated
vendored
Normal file
@@ -0,0 +1,166 @@
|
||||
var clone = (function() {
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* Clones (copies) an Object using deep copying.
|
||||
*
|
||||
* This function supports circular references by default, but if you are certain
|
||||
* there are no circular references in your object, you can save some CPU time
|
||||
* by calling clone(obj, false).
|
||||
*
|
||||
* Caution: if `circular` is false and `parent` contains circular references,
|
||||
* your program may enter an infinite loop and crash.
|
||||
*
|
||||
* @param `parent` - the object to be cloned
|
||||
* @param `circular` - set to true if the object to be cloned may contain
|
||||
* circular references. (optional - true by default)
|
||||
* @param `depth` - set to a number if the object is only to be cloned to
|
||||
* a particular depth. (optional - defaults to Infinity)
|
||||
* @param `prototype` - sets the prototype to be used when cloning an object.
|
||||
* (optional - defaults to parent prototype).
|
||||
*/
|
||||
function clone(parent, circular, depth, prototype) {
|
||||
var filter;
|
||||
if (typeof circular === 'object') {
|
||||
depth = circular.depth;
|
||||
prototype = circular.prototype;
|
||||
filter = circular.filter;
|
||||
circular = circular.circular
|
||||
}
|
||||
// maintain two arrays for circular references, where corresponding parents
|
||||
// and children have the same index
|
||||
var allParents = [];
|
||||
var allChildren = [];
|
||||
|
||||
var useBuffer = typeof Buffer != 'undefined';
|
||||
|
||||
if (typeof circular == 'undefined')
|
||||
circular = true;
|
||||
|
||||
if (typeof depth == 'undefined')
|
||||
depth = Infinity;
|
||||
|
||||
// recurse this function so we don't reset allParents and allChildren
|
||||
function _clone(parent, depth) {
|
||||
// cloning null always returns null
|
||||
if (parent === null)
|
||||
return null;
|
||||
|
||||
if (depth == 0)
|
||||
return parent;
|
||||
|
||||
var child;
|
||||
var proto;
|
||||
if (typeof parent != 'object') {
|
||||
return parent;
|
||||
}
|
||||
|
||||
if (clone.__isArray(parent)) {
|
||||
child = [];
|
||||
} else if (clone.__isRegExp(parent)) {
|
||||
child = new RegExp(parent.source, __getRegExpFlags(parent));
|
||||
if (parent.lastIndex) child.lastIndex = parent.lastIndex;
|
||||
} else if (clone.__isDate(parent)) {
|
||||
child = new Date(parent.getTime());
|
||||
} else if (useBuffer && Buffer.isBuffer(parent)) {
|
||||
if (Buffer.allocUnsafe) {
|
||||
// Node.js >= 4.5.0
|
||||
child = Buffer.allocUnsafe(parent.length);
|
||||
} else {
|
||||
// Older Node.js versions
|
||||
child = new Buffer(parent.length);
|
||||
}
|
||||
parent.copy(child);
|
||||
return child;
|
||||
} else {
|
||||
if (typeof prototype == 'undefined') {
|
||||
proto = Object.getPrototypeOf(parent);
|
||||
child = Object.create(proto);
|
||||
}
|
||||
else {
|
||||
child = Object.create(prototype);
|
||||
proto = prototype;
|
||||
}
|
||||
}
|
||||
|
||||
if (circular) {
|
||||
var index = allParents.indexOf(parent);
|
||||
|
||||
if (index != -1) {
|
||||
return allChildren[index];
|
||||
}
|
||||
allParents.push(parent);
|
||||
allChildren.push(child);
|
||||
}
|
||||
|
||||
for (var i in parent) {
|
||||
var attrs;
|
||||
if (proto) {
|
||||
attrs = Object.getOwnPropertyDescriptor(proto, i);
|
||||
}
|
||||
|
||||
if (attrs && attrs.set == null) {
|
||||
continue;
|
||||
}
|
||||
child[i] = _clone(parent[i], depth - 1);
|
||||
}
|
||||
|
||||
return child;
|
||||
}
|
||||
|
||||
return _clone(parent, depth);
|
||||
}
|
||||
|
||||
/**
|
||||
* Simple flat clone using prototype, accepts only objects, usefull for property
|
||||
* override on FLAT configuration object (no nested props).
|
||||
*
|
||||
* USE WITH CAUTION! This may not behave as you wish if you do not know how this
|
||||
* works.
|
||||
*/
|
||||
clone.clonePrototype = function clonePrototype(parent) {
|
||||
if (parent === null)
|
||||
return null;
|
||||
|
||||
var c = function () {};
|
||||
c.prototype = parent;
|
||||
return new c();
|
||||
};
|
||||
|
||||
// private utility functions
|
||||
|
||||
function __objToStr(o) {
|
||||
return Object.prototype.toString.call(o);
|
||||
};
|
||||
clone.__objToStr = __objToStr;
|
||||
|
||||
function __isDate(o) {
|
||||
return typeof o === 'object' && __objToStr(o) === '[object Date]';
|
||||
};
|
||||
clone.__isDate = __isDate;
|
||||
|
||||
function __isArray(o) {
|
||||
return typeof o === 'object' && __objToStr(o) === '[object Array]';
|
||||
};
|
||||
clone.__isArray = __isArray;
|
||||
|
||||
function __isRegExp(o) {
|
||||
return typeof o === 'object' && __objToStr(o) === '[object RegExp]';
|
||||
};
|
||||
clone.__isRegExp = __isRegExp;
|
||||
|
||||
function __getRegExpFlags(re) {
|
||||
var flags = '';
|
||||
if (re.global) flags += 'g';
|
||||
if (re.ignoreCase) flags += 'i';
|
||||
if (re.multiline) flags += 'm';
|
||||
return flags;
|
||||
};
|
||||
clone.__getRegExpFlags = __getRegExpFlags;
|
||||
|
||||
return clone;
|
||||
})();
|
||||
|
||||
if (typeof module === 'object' && module.exports) {
|
||||
module.exports = clone;
|
||||
}
|
||||
141
node_modules/defaults/node_modules/clone/package.json
generated
vendored
Normal file
141
node_modules/defaults/node_modules/clone/package.json
generated
vendored
Normal file
@@ -0,0 +1,141 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"clone@1.0.4",
|
||||
"/Applications/XAMPP/xamppfiles/htdocs/wordpress/latehome/wp-content/plugins/opal-estate-pro"
|
||||
]
|
||||
],
|
||||
"_development": true,
|
||||
"_from": "clone@1.0.4",
|
||||
"_id": "clone@1.0.4",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-2jCcwmPfFZlMaIypAheco8fNfH4=",
|
||||
"_location": "/defaults/clone",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "clone@1.0.4",
|
||||
"name": "clone",
|
||||
"escapedName": "clone",
|
||||
"rawSpec": "1.0.4",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "1.0.4"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/defaults"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz",
|
||||
"_spec": "1.0.4",
|
||||
"_where": "/Applications/XAMPP/xamppfiles/htdocs/wordpress/latehome/wp-content/plugins/opal-estate-pro",
|
||||
"author": {
|
||||
"name": "Paul Vorbach",
|
||||
"email": "paul@vorba.ch",
|
||||
"url": "http://paul.vorba.ch/"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/pvorb/node-clone/issues"
|
||||
},
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Blake Miner",
|
||||
"email": "miner.blake@gmail.com",
|
||||
"url": "http://www.blakeminer.com/"
|
||||
},
|
||||
{
|
||||
"name": "Tian You",
|
||||
"email": "axqd001@gmail.com",
|
||||
"url": "http://blog.axqd.net/"
|
||||
},
|
||||
{
|
||||
"name": "George Stagas",
|
||||
"email": "gstagas@gmail.com",
|
||||
"url": "http://stagas.com/"
|
||||
},
|
||||
{
|
||||
"name": "Tobiasz Cudnik",
|
||||
"email": "tobiasz.cudnik@gmail.com",
|
||||
"url": "https://github.com/TobiaszCudnik"
|
||||
},
|
||||
{
|
||||
"name": "Pavel Lang",
|
||||
"email": "langpavel@phpskelet.org",
|
||||
"url": "https://github.com/langpavel"
|
||||
},
|
||||
{
|
||||
"name": "Dan MacTough",
|
||||
"url": "http://yabfog.com/"
|
||||
},
|
||||
{
|
||||
"name": "w1nk",
|
||||
"url": "https://github.com/w1nk"
|
||||
},
|
||||
{
|
||||
"name": "Hugh Kennedy",
|
||||
"url": "http://twitter.com/hughskennedy"
|
||||
},
|
||||
{
|
||||
"name": "Dustin Diaz",
|
||||
"url": "http://dustindiaz.com"
|
||||
},
|
||||
{
|
||||
"name": "Ilya Shaisultanov",
|
||||
"url": "https://github.com/diversario"
|
||||
},
|
||||
{
|
||||
"name": "Nathan MacInnes",
|
||||
"email": "nathan@macinn.es",
|
||||
"url": "http://macinn.es/"
|
||||
},
|
||||
{
|
||||
"name": "Benjamin E. Coe",
|
||||
"email": "ben@npmjs.com",
|
||||
"url": "https://twitter.com/benjamincoe"
|
||||
},
|
||||
{
|
||||
"name": "Nathan Zadoks",
|
||||
"url": "https://github.com/nathan7"
|
||||
},
|
||||
{
|
||||
"name": "Róbert Oroszi",
|
||||
"email": "robert+gh@oroszi.net",
|
||||
"url": "https://github.com/oroce"
|
||||
},
|
||||
{
|
||||
"name": "Aurélio A. Heckert",
|
||||
"url": "http://softwarelivre.org/aurium"
|
||||
},
|
||||
{
|
||||
"name": "Guy Ellis",
|
||||
"url": "http://www.guyellisrocks.com/"
|
||||
}
|
||||
],
|
||||
"dependencies": {},
|
||||
"description": "deep cloning of objects and arrays",
|
||||
"devDependencies": {
|
||||
"nodeunit": "~0.9.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.8"
|
||||
},
|
||||
"homepage": "https://github.com/pvorb/node-clone#readme",
|
||||
"license": "MIT",
|
||||
"main": "clone.js",
|
||||
"name": "clone",
|
||||
"optionalDependencies": {},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/pvorb/node-clone.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "nodeunit test.js"
|
||||
},
|
||||
"tags": [
|
||||
"clone",
|
||||
"object",
|
||||
"array",
|
||||
"function",
|
||||
"date"
|
||||
],
|
||||
"version": "1.0.4"
|
||||
}
|
||||
60
node_modules/defaults/package.json
generated
vendored
Executable file
60
node_modules/defaults/package.json
generated
vendored
Executable file
@@ -0,0 +1,60 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"defaults@1.0.3",
|
||||
"/Applications/XAMPP/xamppfiles/htdocs/wordpress/latehome"
|
||||
]
|
||||
],
|
||||
"_from": "defaults@1.0.3",
|
||||
"_id": "defaults@1.0.3",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-xlYFHpgX2f8I7YgUd/P+QBnz730=",
|
||||
"_location": "/defaults",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "defaults@1.0.3",
|
||||
"name": "defaults",
|
||||
"escapedName": "defaults",
|
||||
"rawSpec": "1.0.3",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "1.0.3"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/vinyl-fs"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.3.tgz",
|
||||
"_spec": "1.0.3",
|
||||
"_where": "/Applications/XAMPP/xamppfiles/htdocs/wordpress/latehome",
|
||||
"author": {
|
||||
"name": "Elijah Insua",
|
||||
"email": "tmpvar@gmail.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/tmpvar/defaults/issues"
|
||||
},
|
||||
"dependencies": {
|
||||
"clone": "^1.0.2"
|
||||
},
|
||||
"description": "merge single level defaults over a config object",
|
||||
"devDependencies": {
|
||||
"tap": "^2.0.0"
|
||||
},
|
||||
"homepage": "https://github.com/tmpvar/defaults#readme",
|
||||
"keywords": [
|
||||
"config",
|
||||
"defaults"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "index.js",
|
||||
"name": "defaults",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/tmpvar/defaults.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "node test.js"
|
||||
},
|
||||
"version": "1.0.3"
|
||||
}
|
||||
34
node_modules/defaults/test.js
generated
vendored
Executable file
34
node_modules/defaults/test.js
generated
vendored
Executable file
@@ -0,0 +1,34 @@
|
||||
var defaults = require('./'),
|
||||
test = require('tap').test;
|
||||
|
||||
test("ensure options is an object", function(t) {
|
||||
var options = defaults(false, { a : true });
|
||||
t.ok(options.a);
|
||||
t.end()
|
||||
});
|
||||
|
||||
test("ensure defaults override keys", function(t) {
|
||||
var result = defaults({}, { a: false, b: true });
|
||||
t.ok(result.b, 'b merges over undefined');
|
||||
t.equal(result.a, false, 'a merges over undefined');
|
||||
t.end();
|
||||
});
|
||||
|
||||
test("ensure defined keys are not overwritten", function(t) {
|
||||
var result = defaults({ b: false }, { a: false, b: true });
|
||||
t.equal(result.b, false, 'b not merged');
|
||||
t.equal(result.a, false, 'a merges over undefined');
|
||||
t.end();
|
||||
});
|
||||
|
||||
test("ensure defaults clone nested objects", function(t) {
|
||||
var d = { a: [1,2,3], b: { hello : 'world' } };
|
||||
var result = defaults({}, d);
|
||||
t.equal(result.a.length, 3, 'objects should be clones');
|
||||
t.ok(result.a !== d.a, 'objects should be clones');
|
||||
|
||||
t.equal(Object.keys(result.b).length, 1, 'objects should be clones');
|
||||
t.ok(result.b !== d.b, 'objects should be clones');
|
||||
t.end();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user