Firebase Update
This commit is contained in:
8
express-server/node_modules/deep-equal/.travis.yml
generated
vendored
Normal file
8
express-server/node_modules/deep-equal/.travis.yml
generated
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
language: node_js
|
||||
node_js:
|
||||
- '0.8'
|
||||
- '0.10'
|
||||
- '0.12'
|
||||
- 'iojs'
|
||||
before_install:
|
||||
- npm install -g npm@latest
|
18
express-server/node_modules/deep-equal/LICENSE
generated
vendored
Normal file
18
express-server/node_modules/deep-equal/LICENSE
generated
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
This software is released under the MIT license:
|
||||
|
||||
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.
|
11
express-server/node_modules/deep-equal/example/cmp.js
generated
vendored
Normal file
11
express-server/node_modules/deep-equal/example/cmp.js
generated
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
var equal = require('../');
|
||||
console.dir([
|
||||
equal(
|
||||
{ a : [ 2, 3 ], b : [ 4 ] },
|
||||
{ a : [ 2, 3 ], b : [ 4 ] }
|
||||
),
|
||||
equal(
|
||||
{ x : 5, y : [6] },
|
||||
{ x : 5, y : 6 }
|
||||
)
|
||||
]);
|
94
express-server/node_modules/deep-equal/index.js
generated
vendored
Normal file
94
express-server/node_modules/deep-equal/index.js
generated
vendored
Normal file
@ -0,0 +1,94 @@
|
||||
var pSlice = Array.prototype.slice;
|
||||
var objectKeys = require('./lib/keys.js');
|
||||
var isArguments = require('./lib/is_arguments.js');
|
||||
|
||||
var deepEqual = module.exports = function (actual, expected, opts) {
|
||||
if (!opts) opts = {};
|
||||
// 7.1. All identical values are equivalent, as determined by ===.
|
||||
if (actual === expected) {
|
||||
return true;
|
||||
|
||||
} else if (actual instanceof Date && expected instanceof Date) {
|
||||
return actual.getTime() === expected.getTime();
|
||||
|
||||
// 7.3. Other pairs that do not both pass typeof value == 'object',
|
||||
// equivalence is determined by ==.
|
||||
} else if (!actual || !expected || typeof actual != 'object' && typeof expected != 'object') {
|
||||
return opts.strict ? actual === expected : actual == expected;
|
||||
|
||||
// 7.4. For all other Object pairs, including Array objects, equivalence is
|
||||
// determined by having the same number of owned properties (as verified
|
||||
// with Object.prototype.hasOwnProperty.call), the same set of keys
|
||||
// (although not necessarily the same order), equivalent values for every
|
||||
// corresponding key, and an identical 'prototype' property. Note: this
|
||||
// accounts for both named and indexed properties on Arrays.
|
||||
} else {
|
||||
return objEquiv(actual, expected, opts);
|
||||
}
|
||||
}
|
||||
|
||||
function isUndefinedOrNull(value) {
|
||||
return value === null || value === undefined;
|
||||
}
|
||||
|
||||
function isBuffer (x) {
|
||||
if (!x || typeof x !== 'object' || typeof x.length !== 'number') return false;
|
||||
if (typeof x.copy !== 'function' || typeof x.slice !== 'function') {
|
||||
return false;
|
||||
}
|
||||
if (x.length > 0 && typeof x[0] !== 'number') return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
function objEquiv(a, b, opts) {
|
||||
var i, key;
|
||||
if (isUndefinedOrNull(a) || isUndefinedOrNull(b))
|
||||
return false;
|
||||
// an identical 'prototype' property.
|
||||
if (a.prototype !== b.prototype) return false;
|
||||
//~~~I've managed to break Object.keys through screwy arguments passing.
|
||||
// Converting to array solves the problem.
|
||||
if (isArguments(a)) {
|
||||
if (!isArguments(b)) {
|
||||
return false;
|
||||
}
|
||||
a = pSlice.call(a);
|
||||
b = pSlice.call(b);
|
||||
return deepEqual(a, b, opts);
|
||||
}
|
||||
if (isBuffer(a)) {
|
||||
if (!isBuffer(b)) {
|
||||
return false;
|
||||
}
|
||||
if (a.length !== b.length) return false;
|
||||
for (i = 0; i < a.length; i++) {
|
||||
if (a[i] !== b[i]) return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
try {
|
||||
var ka = objectKeys(a),
|
||||
kb = objectKeys(b);
|
||||
} catch (e) {//happens when one is a string literal and the other isn't
|
||||
return false;
|
||||
}
|
||||
// having the same number of owned properties (keys incorporates
|
||||
// hasOwnProperty)
|
||||
if (ka.length != kb.length)
|
||||
return false;
|
||||
//the same set of keys (although not necessarily the same order),
|
||||
ka.sort();
|
||||
kb.sort();
|
||||
//~~~cheap key test
|
||||
for (i = ka.length - 1; i >= 0; i--) {
|
||||
if (ka[i] != kb[i])
|
||||
return false;
|
||||
}
|
||||
//equivalent values for every corresponding key, and
|
||||
//~~~possibly expensive deep test
|
||||
for (i = ka.length - 1; i >= 0; i--) {
|
||||
key = ka[i];
|
||||
if (!deepEqual(a[key], b[key], opts)) return false;
|
||||
}
|
||||
return typeof a === typeof b;
|
||||
}
|
20
express-server/node_modules/deep-equal/lib/is_arguments.js
generated
vendored
Normal file
20
express-server/node_modules/deep-equal/lib/is_arguments.js
generated
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
var supportsArgumentsClass = (function(){
|
||||
return Object.prototype.toString.call(arguments)
|
||||
})() == '[object Arguments]';
|
||||
|
||||
exports = module.exports = supportsArgumentsClass ? supported : unsupported;
|
||||
|
||||
exports.supported = supported;
|
||||
function supported(object) {
|
||||
return Object.prototype.toString.call(object) == '[object Arguments]';
|
||||
};
|
||||
|
||||
exports.unsupported = unsupported;
|
||||
function unsupported(object){
|
||||
return object &&
|
||||
typeof object == 'object' &&
|
||||
typeof object.length == 'number' &&
|
||||
Object.prototype.hasOwnProperty.call(object, 'callee') &&
|
||||
!Object.prototype.propertyIsEnumerable.call(object, 'callee') ||
|
||||
false;
|
||||
};
|
9
express-server/node_modules/deep-equal/lib/keys.js
generated
vendored
Normal file
9
express-server/node_modules/deep-equal/lib/keys.js
generated
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
exports = module.exports = typeof Object.keys === 'function'
|
||||
? Object.keys : shim;
|
||||
|
||||
exports.shim = shim;
|
||||
function shim (obj) {
|
||||
var keys = [];
|
||||
for (var key in obj) keys.push(key);
|
||||
return keys;
|
||||
}
|
87
express-server/node_modules/deep-equal/package.json
generated
vendored
Normal file
87
express-server/node_modules/deep-equal/package.json
generated
vendored
Normal file
@ -0,0 +1,87 @@
|
||||
{
|
||||
"_from": "deep-equal@^1.0.1",
|
||||
"_id": "deep-equal@1.0.1",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-9dJgKStmDghO/0zbyfCK0yR0SLU=",
|
||||
"_location": "/deep-equal",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "deep-equal@^1.0.1",
|
||||
"name": "deep-equal",
|
||||
"escapedName": "deep-equal",
|
||||
"rawSpec": "^1.0.1",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^1.0.1"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/@google-cloud/firestore"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.0.1.tgz",
|
||||
"_shasum": "f5d260292b660e084eff4cdbc9f08ad3247448b5",
|
||||
"_spec": "deep-equal@^1.0.1",
|
||||
"_where": "D:\\Desktop\\Git\\Firebase\\SmartShopperFirebase\\node_modules\\@google-cloud\\firestore",
|
||||
"author": {
|
||||
"name": "James Halliday",
|
||||
"email": "mail@substack.net",
|
||||
"url": "http://substack.net"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/substack/node-deep-equal/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"deprecated": false,
|
||||
"description": "node's assert.deepEqual algorithm",
|
||||
"devDependencies": {
|
||||
"tape": "^3.5.0"
|
||||
},
|
||||
"directories": {
|
||||
"lib": ".",
|
||||
"example": "example",
|
||||
"test": "test"
|
||||
},
|
||||
"homepage": "https://github.com/substack/node-deep-equal#readme",
|
||||
"keywords": [
|
||||
"equality",
|
||||
"equal",
|
||||
"compare"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "index.js",
|
||||
"name": "deep-equal",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+ssh://git@github.com/substack/node-deep-equal.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "tape test/*.js"
|
||||
},
|
||||
"testling": {
|
||||
"files": "test/*.js",
|
||||
"browsers": {
|
||||
"ie": [
|
||||
6,
|
||||
7,
|
||||
8,
|
||||
9
|
||||
],
|
||||
"ff": [
|
||||
3.5,
|
||||
10,
|
||||
15
|
||||
],
|
||||
"chrome": [
|
||||
10,
|
||||
22
|
||||
],
|
||||
"safari": [
|
||||
5.1
|
||||
],
|
||||
"opera": [
|
||||
12
|
||||
]
|
||||
}
|
||||
},
|
||||
"version": "1.0.1"
|
||||
}
|
61
express-server/node_modules/deep-equal/readme.markdown
generated
vendored
Normal file
61
express-server/node_modules/deep-equal/readme.markdown
generated
vendored
Normal file
@ -0,0 +1,61 @@
|
||||
# deep-equal
|
||||
|
||||
Node's `assert.deepEqual() algorithm` as a standalone module.
|
||||
|
||||
This module is around [5 times faster](https://gist.github.com/2790507)
|
||||
than wrapping `assert.deepEqual()` in a `try/catch`.
|
||||
|
||||
[](https://ci.testling.com/substack/node-deep-equal)
|
||||
|
||||
[](https://travis-ci.org/substack/node-deep-equal)
|
||||
|
||||
# example
|
||||
|
||||
``` js
|
||||
var equal = require('deep-equal');
|
||||
console.dir([
|
||||
equal(
|
||||
{ a : [ 2, 3 ], b : [ 4 ] },
|
||||
{ a : [ 2, 3 ], b : [ 4 ] }
|
||||
),
|
||||
equal(
|
||||
{ x : 5, y : [6] },
|
||||
{ x : 5, y : 6 }
|
||||
)
|
||||
]);
|
||||
```
|
||||
|
||||
# methods
|
||||
|
||||
``` js
|
||||
var deepEqual = require('deep-equal')
|
||||
```
|
||||
|
||||
## deepEqual(a, b, opts)
|
||||
|
||||
Compare objects `a` and `b`, returning whether they are equal according to a
|
||||
recursive equality algorithm.
|
||||
|
||||
If `opts.strict` is `true`, use strict equality (`===`) to compare leaf nodes.
|
||||
The default is to use coercive equality (`==`) because that's how
|
||||
`assert.deepEqual()` works by default.
|
||||
|
||||
# install
|
||||
|
||||
With [npm](http://npmjs.org) do:
|
||||
|
||||
```
|
||||
npm install deep-equal
|
||||
```
|
||||
|
||||
# test
|
||||
|
||||
With [npm](http://npmjs.org) do:
|
||||
|
||||
```
|
||||
npm test
|
||||
```
|
||||
|
||||
# license
|
||||
|
||||
MIT. Derived largely from node's assert module.
|
95
express-server/node_modules/deep-equal/test/cmp.js
generated
vendored
Normal file
95
express-server/node_modules/deep-equal/test/cmp.js
generated
vendored
Normal file
@ -0,0 +1,95 @@
|
||||
var test = require('tape');
|
||||
var equal = require('../');
|
||||
var isArguments = require('../lib/is_arguments.js');
|
||||
var objectKeys = require('../lib/keys.js');
|
||||
|
||||
test('equal', function (t) {
|
||||
t.ok(equal(
|
||||
{ a : [ 2, 3 ], b : [ 4 ] },
|
||||
{ a : [ 2, 3 ], b : [ 4 ] }
|
||||
));
|
||||
t.end();
|
||||
});
|
||||
|
||||
test('not equal', function (t) {
|
||||
t.notOk(equal(
|
||||
{ x : 5, y : [6] },
|
||||
{ x : 5, y : 6 }
|
||||
));
|
||||
t.end();
|
||||
});
|
||||
|
||||
test('nested nulls', function (t) {
|
||||
t.ok(equal([ null, null, null ], [ null, null, null ]));
|
||||
t.end();
|
||||
});
|
||||
|
||||
test('strict equal', function (t) {
|
||||
t.notOk(equal(
|
||||
[ { a: 3 }, { b: 4 } ],
|
||||
[ { a: '3' }, { b: '4' } ],
|
||||
{ strict: true }
|
||||
));
|
||||
t.end();
|
||||
});
|
||||
|
||||
test('non-objects', function (t) {
|
||||
t.ok(equal(3, 3));
|
||||
t.ok(equal('beep', 'beep'));
|
||||
t.ok(equal('3', 3));
|
||||
t.notOk(equal('3', 3, { strict: true }));
|
||||
t.notOk(equal('3', [3]));
|
||||
t.end();
|
||||
});
|
||||
|
||||
test('arguments class', function (t) {
|
||||
t.ok(equal(
|
||||
(function(){return arguments})(1,2,3),
|
||||
(function(){return arguments})(1,2,3),
|
||||
"compares arguments"
|
||||
));
|
||||
t.notOk(equal(
|
||||
(function(){return arguments})(1,2,3),
|
||||
[1,2,3],
|
||||
"differenciates array and arguments"
|
||||
));
|
||||
t.end();
|
||||
});
|
||||
|
||||
test('test the arguments shim', function (t) {
|
||||
t.ok(isArguments.supported((function(){return arguments})()));
|
||||
t.notOk(isArguments.supported([1,2,3]));
|
||||
|
||||
t.ok(isArguments.unsupported((function(){return arguments})()));
|
||||
t.notOk(isArguments.unsupported([1,2,3]));
|
||||
|
||||
t.end();
|
||||
});
|
||||
|
||||
test('test the keys shim', function (t) {
|
||||
t.deepEqual(objectKeys.shim({ a: 1, b : 2 }), [ 'a', 'b' ]);
|
||||
t.end();
|
||||
});
|
||||
|
||||
test('dates', function (t) {
|
||||
var d0 = new Date(1387585278000);
|
||||
var d1 = new Date('Fri Dec 20 2013 16:21:18 GMT-0800 (PST)');
|
||||
t.ok(equal(d0, d1));
|
||||
t.end();
|
||||
});
|
||||
|
||||
test('buffers', function (t) {
|
||||
t.ok(equal(Buffer('xyz'), Buffer('xyz')));
|
||||
t.end();
|
||||
});
|
||||
|
||||
test('booleans and arrays', function (t) {
|
||||
t.notOk(equal(true, []));
|
||||
t.end();
|
||||
})
|
||||
|
||||
test('null == undefined', function (t) {
|
||||
t.ok(equal(null, undefined))
|
||||
t.notOk(equal(null, undefined, { strict: true }))
|
||||
t.end()
|
||||
})
|
Reference in New Issue
Block a user