1
0
mirror of https://github.com/musix-org/musix-oss synced 2025-07-01 13:53:38 +00:00
This commit is contained in:
MatteZ02
2019-10-10 16:43:04 +03:00
parent 6f6ac8a6fa
commit 50b9bed483
9432 changed files with 1988816 additions and 167 deletions

20
node_modules/deep-equal/.editorconfig generated vendored Normal file
View File

@ -0,0 +1,20 @@
root = true
[*]
indent_style = tab
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
max_line_length = 150
[CHANGELOG.md]
indent_style = space
indent_size = 2
[*.json]
max_line_length = off
[Makefile]
max_line_length = off

26
node_modules/deep-equal/.eslintrc generated vendored Normal file
View File

@ -0,0 +1,26 @@
{
"root": true,
"extends": "@ljharb",
"rules": {
"complexity": 0,
"eqeqeq": 1,
"func-style": [2, "declaration"],
"indent": [2, 2],
"max-lines-per-function": [2, 75],
"max-params": [2, 3],
"max-statements-per-line": [2, { "max": 2 }],
"strict": 1,
},
"overrides": [
{
"files": ["example/**", "test/**"],
"rules": {
"array-bracket-newline": 0,
"max-params": 0,
"max-statements": 0,
"no-console": 0,
"no-magic-numbers": 0,
},
},
],
}

307
node_modules/deep-equal/.travis.yml generated vendored Normal file
View File

@ -0,0 +1,307 @@
language: node_js
os:
- linux
node_js:
- "12.7"
- "11.15"
- "10.16"
- "9.11"
- "8.16"
- "7.10"
- "6.17"
- "5.12"
- "4.9"
- "iojs-v3.3"
- "iojs-v2.5"
- "iojs-v1.8"
- "0.12"
- "0.10"
- "0.8"
before_install:
- 'case "${TRAVIS_NODE_VERSION}" in 0.*) export NPM_CONFIG_STRICT_SSL=false ;; esac'
- 'nvm install-latest-npm'
install:
- 'if [ "${TRAVIS_NODE_VERSION}" = "0.6" ] || [ "${TRAVIS_NODE_VERSION}" = "0.9" ]; then nvm install --latest-npm 0.8 && npm install && nvm use "${TRAVIS_NODE_VERSION}"; else npm install; fi;'
script:
- 'if [ -n "${PRETEST-}" ]; then npm run pretest ; fi'
- 'if [ -n "${POSTTEST-}" ]; then npm run posttest ; fi'
- 'if [ -n "${COVERAGE-}" ]; then npm run coverage ; fi'
- 'if [ -n "${TEST-}" ]; then npm run tests-only ; fi'
sudo: false
env:
- TEST=true
matrix:
fast_finish: true
include:
- node_js: "lts/*"
env: PRETEST=true
- node_js: "12.6"
env: TEST=true ALLOW_FAILURE=true
- node_js: "12.5"
env: TEST=true ALLOW_FAILURE=true
- node_js: "12.4"
env: TEST=true ALLOW_FAILURE=true
- node_js: "12.3"
env: TEST=true ALLOW_FAILURE=true
- node_js: "12.2"
env: TEST=true ALLOW_FAILURE=true
- node_js: "12.1"
env: TEST=true ALLOW_FAILURE=true
- node_js: "12.0"
env: TEST=true ALLOW_FAILURE=true
- node_js: "11.14"
env: TEST=true ALLOW_FAILURE=true
- node_js: "11.13"
env: TEST=true ALLOW_FAILURE=true
- node_js: "11.12"
env: TEST=true ALLOW_FAILURE=true
- node_js: "11.11"
env: TEST=true ALLOW_FAILURE=true
- node_js: "11.10"
env: TEST=true ALLOW_FAILURE=true
- node_js: "11.9"
env: TEST=true ALLOW_FAILURE=true
- node_js: "11.8"
env: TEST=true ALLOW_FAILURE=true
- node_js: "11.7"
env: TEST=true ALLOW_FAILURE=true
- node_js: "11.6"
env: TEST=true ALLOW_FAILURE=true
- node_js: "11.5"
env: TEST=true ALLOW_FAILURE=true
- node_js: "11.4"
env: TEST=true ALLOW_FAILURE=true
- node_js: "11.3"
env: TEST=true ALLOW_FAILURE=true
- node_js: "11.2"
env: TEST=true ALLOW_FAILURE=true
- node_js: "11.1"
env: TEST=true ALLOW_FAILURE=true
- node_js: "11.0"
env: TEST=true ALLOW_FAILURE=true
- node_js: "10.15"
env: TEST=true ALLOW_FAILURE=true
- node_js: "10.14"
env: TEST=true ALLOW_FAILURE=true
- node_js: "10.13"
env: TEST=true ALLOW_FAILURE=true
- node_js: "10.12"
env: TEST=true ALLOW_FAILURE=true
- node_js: "10.11"
env: TEST=true ALLOW_FAILURE=true
- node_js: "10.10"
env: TEST=true ALLOW_FAILURE=true
- node_js: "10.9"
env: TEST=true ALLOW_FAILURE=true
- node_js: "10.8"
env: TEST=true ALLOW_FAILURE=true
- node_js: "10.7"
env: TEST=true ALLOW_FAILURE=true
- node_js: "10.6"
env: TEST=true ALLOW_FAILURE=true
- node_js: "10.5"
env: TEST=true ALLOW_FAILURE=true
- node_js: "10.4"
env: TEST=true ALLOW_FAILURE=true
- node_js: "10.3"
env: TEST=true ALLOW_FAILURE=true
- node_js: "10.2"
env: TEST=true ALLOW_FAILURE=true
- node_js: "10.1"
env: TEST=true ALLOW_FAILURE=true
- node_js: "10.0"
env: TEST=true ALLOW_FAILURE=true
- node_js: "9.10"
env: TEST=true ALLOW_FAILURE=true
- node_js: "9.9"
env: TEST=true ALLOW_FAILURE=true
- node_js: "9.8"
env: TEST=true ALLOW_FAILURE=true
- node_js: "9.7"
env: TEST=true ALLOW_FAILURE=true
- node_js: "9.6"
env: TEST=true ALLOW_FAILURE=true
- node_js: "9.5"
env: TEST=true ALLOW_FAILURE=true
- node_js: "9.4"
env: TEST=true ALLOW_FAILURE=true
- node_js: "9.3"
env: TEST=true ALLOW_FAILURE=true
- node_js: "9.2"
env: TEST=true ALLOW_FAILURE=true
- node_js: "9.1"
env: TEST=true ALLOW_FAILURE=true
- node_js: "9.0"
env: TEST=true ALLOW_FAILURE=true
- node_js: "8.15"
env: TEST=true ALLOW_FAILURE=true
- node_js: "8.14"
env: TEST=true ALLOW_FAILURE=true
- node_js: "8.13"
env: TEST=true ALLOW_FAILURE=true
- node_js: "8.12"
env: TEST=true ALLOW_FAILURE=true
- node_js: "8.11"
env: TEST=true ALLOW_FAILURE=true
- node_js: "8.10"
env: TEST=true ALLOW_FAILURE=true
- node_js: "8.9"
env: TEST=true ALLOW_FAILURE=true
- node_js: "8.8"
env: TEST=true ALLOW_FAILURE=true
- node_js: "8.7"
env: TEST=true ALLOW_FAILURE=true
- node_js: "8.6"
env: TEST=true ALLOW_FAILURE=true
- node_js: "8.5"
env: TEST=true ALLOW_FAILURE=true
- node_js: "8.4"
env: TEST=true ALLOW_FAILURE=true
- node_js: "8.3"
env: TEST=true ALLOW_FAILURE=true
- node_js: "8.2"
env: TEST=true ALLOW_FAILURE=true
- node_js: "8.1"
env: TEST=true ALLOW_FAILURE=true
- node_js: "8.0"
env: TEST=true ALLOW_FAILURE=true
- node_js: "7.9"
env: TEST=true ALLOW_FAILURE=true
- node_js: "7.8"
env: TEST=true ALLOW_FAILURE=true
- node_js: "7.7"
env: TEST=true ALLOW_FAILURE=true
- node_js: "7.6"
env: TEST=true ALLOW_FAILURE=true
- node_js: "7.5"
env: TEST=true ALLOW_FAILURE=true
- node_js: "7.4"
env: TEST=true ALLOW_FAILURE=true
- node_js: "7.3"
env: TEST=true ALLOW_FAILURE=true
- node_js: "7.2"
env: TEST=true ALLOW_FAILURE=true
- node_js: "7.1"
env: TEST=true ALLOW_FAILURE=true
- node_js: "7.0"
env: TEST=true ALLOW_FAILURE=true
- node_js: "6.16"
env: TEST=true ALLOW_FAILURE=true
- node_js: "6.15"
env: TEST=true ALLOW_FAILURE=true
- node_js: "6.14"
env: TEST=true ALLOW_FAILURE=true
- node_js: "6.13"
env: TEST=true ALLOW_FAILURE=true
- node_js: "6.12"
env: TEST=true ALLOW_FAILURE=true
- node_js: "6.11"
env: TEST=true ALLOW_FAILURE=true
- node_js: "6.10"
env: TEST=true ALLOW_FAILURE=true
- node_js: "6.9"
env: TEST=true ALLOW_FAILURE=true
- node_js: "6.8"
env: TEST=true ALLOW_FAILURE=true
- node_js: "6.7"
env: TEST=true ALLOW_FAILURE=true
- node_js: "6.6"
env: TEST=true ALLOW_FAILURE=true
- node_js: "6.5"
env: TEST=true ALLOW_FAILURE=true
- node_js: "6.4"
env: TEST=true ALLOW_FAILURE=true
- node_js: "6.3"
env: TEST=true ALLOW_FAILURE=true
- node_js: "6.2"
env: TEST=true ALLOW_FAILURE=true
- node_js: "6.1"
env: TEST=true ALLOW_FAILURE=true
- node_js: "6.0"
env: TEST=true ALLOW_FAILURE=true
- node_js: "5.11"
env: TEST=true ALLOW_FAILURE=true
- node_js: "5.10"
env: TEST=true ALLOW_FAILURE=true
- node_js: "5.9"
env: TEST=true ALLOW_FAILURE=true
- node_js: "5.8"
env: TEST=true ALLOW_FAILURE=true
- node_js: "5.7"
env: TEST=true ALLOW_FAILURE=true
- node_js: "5.6"
env: TEST=true ALLOW_FAILURE=true
- node_js: "5.5"
env: TEST=true ALLOW_FAILURE=true
- node_js: "5.4"
env: TEST=true ALLOW_FAILURE=true
- node_js: "5.3"
env: TEST=true ALLOW_FAILURE=true
- node_js: "5.2"
env: TEST=true ALLOW_FAILURE=true
- node_js: "5.1"
env: TEST=true ALLOW_FAILURE=true
- node_js: "5.0"
env: TEST=true ALLOW_FAILURE=true
- node_js: "4.8"
env: TEST=true ALLOW_FAILURE=true
- node_js: "4.7"
env: TEST=true ALLOW_FAILURE=true
- node_js: "4.6"
env: TEST=true ALLOW_FAILURE=true
- node_js: "4.5"
env: TEST=true ALLOW_FAILURE=true
- node_js: "4.4"
env: TEST=true ALLOW_FAILURE=true
- node_js: "4.3"
env: TEST=true ALLOW_FAILURE=true
- node_js: "4.2"
env: TEST=true ALLOW_FAILURE=true
- node_js: "4.1"
env: TEST=true ALLOW_FAILURE=true
- node_js: "4.0"
env: TEST=true ALLOW_FAILURE=true
- node_js: "iojs-v3.2"
env: TEST=true ALLOW_FAILURE=true
- node_js: "iojs-v3.1"
env: TEST=true ALLOW_FAILURE=true
- node_js: "iojs-v3.0"
env: TEST=true ALLOW_FAILURE=true
- node_js: "iojs-v2.4"
env: TEST=true ALLOW_FAILURE=true
- node_js: "iojs-v2.3"
env: TEST=true ALLOW_FAILURE=true
- node_js: "iojs-v2.2"
env: TEST=true ALLOW_FAILURE=true
- node_js: "iojs-v2.1"
env: TEST=true ALLOW_FAILURE=true
- node_js: "iojs-v2.0"
env: TEST=true ALLOW_FAILURE=true
- node_js: "iojs-v1.7"
env: TEST=true ALLOW_FAILURE=true
- node_js: "iojs-v1.6"
env: TEST=true ALLOW_FAILURE=true
- node_js: "iojs-v1.5"
env: TEST=true ALLOW_FAILURE=true
- node_js: "iojs-v1.4"
env: TEST=true ALLOW_FAILURE=true
- node_js: "iojs-v1.3"
env: TEST=true ALLOW_FAILURE=true
- node_js: "iojs-v1.2"
env: TEST=true ALLOW_FAILURE=true
- node_js: "iojs-v1.1"
env: TEST=true ALLOW_FAILURE=true
- node_js: "iojs-v1.0"
env: TEST=true ALLOW_FAILURE=true
- node_js: "0.11"
env: TEST=true ALLOW_FAILURE=true
- node_js: "0.9"
env: TEST=true ALLOW_FAILURE=true
- node_js: "0.6"
env: TEST=true ALLOW_FAILURE=true
- node_js: "0.4"
env: TEST=true ALLOW_FAILURE=true
allow_failures:
- os: osx
- env: TEST=true ALLOW_FAILURE=true
- env: COVERAGE=true

21
node_modules/deep-equal/LICENSE generated vendored Normal file
View File

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2012, 2013, 2014 James Halliday <mail@substack.net>, 2009 Thomas Robinson <280north.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.

11
node_modules/deep-equal/example/cmp.js generated vendored Normal file
View 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 }
)
]);

112
node_modules/deep-equal/index.js generated vendored Normal file
View File

@ -0,0 +1,112 @@
var objectKeys = require('object-keys');
var isArguments = require('is-arguments');
var is = require('object-is');
var isRegex = require('is-regex');
var flags = require('regexp.prototype.flags');
var isDate = require('is-date-object');
var getTime = Date.prototype.getTime;
function deepEqual(actual, expected, options) {
var opts = options || {};
// 7.1. All identical values are equivalent, as determined by ===.
if (opts.strict ? is(actual, expected) : actual === expected) {
return true;
}
// 7.3. Other pairs that do not both pass typeof value == 'object', equivalence is determined by ==.
if (!actual || !expected || (typeof actual !== 'object' && typeof expected !== 'object')) {
return opts.strict ? is(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.
*/
// eslint-disable-next-line no-use-before-define
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) {
/* eslint max-statements: [2, 50] */
var i, key;
if (typeof a !== typeof b) { return false; }
if (isUndefinedOrNull(a) || isUndefinedOrNull(b)) { return false; }
// an identical 'prototype' property.
if (a.prototype !== b.prototype) { return false; }
if (isArguments(a) !== isArguments(b)) { return false; }
var aIsRegex = isRegex(a);
var bIsRegex = isRegex(b);
if (aIsRegex !== bIsRegex) { return false; }
if (aIsRegex || bIsRegex) {
return a.source === b.source && flags(a) === flags(b);
}
if (isDate(a) && isDate(b)) {
return getTime.call(a) === getTime.call(b);
}
var aIsBuffer = isBuffer(a);
var bIsBuffer = isBuffer(b);
if (aIsBuffer !== bIsBuffer) { return false; }
if (aIsBuffer || bIsBuffer) { // && would work too, because both are true or both false here
if (a.length !== b.length) { return false; }
for (i = 0; i < a.length; i++) {
if (a[i] !== b[i]) { return false; }
}
return true;
}
if (typeof a !== typeof b) { return false; }
try {
var ka = objectKeys(a);
var 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 true;
}
module.exports = deepEqual;

1
node_modules/deep-equal/lib/is_arguments.js generated vendored Normal file
View File

@ -0,0 +1 @@
module.exports = require('is-arguments');

1
node_modules/deep-equal/lib/keys.js generated vendored Normal file
View File

@ -0,0 +1 @@
module.exports = require('object-keys');

100
node_modules/deep-equal/package.json generated vendored Normal file
View File

@ -0,0 +1,100 @@
{
"_from": "deep-equal@^1.0.1",
"_id": "deep-equal@1.1.0",
"_inBundle": false,
"_integrity": "sha512-ZbfWJq/wN1Z273o7mUSjILYqehAktR2NVoSrOukDkU9kg2v/Uv89yU4Cvz8seJeAmtN5oqiefKq8FPuXOboqLw==",
"_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.1.0.tgz",
"_shasum": "3103cdf8ab6d32cf4a8df7865458f2b8d33f3745",
"_spec": "deep-equal@^1.0.1",
"_where": "C:\\Users\\matia\\Documents\\GitHub\\FutoX-Musix\\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,
"dependencies": {
"is-arguments": "^1.0.4",
"is-date-object": "^1.0.1",
"is-regex": "^1.0.4",
"object-is": "^1.0.1",
"object-keys": "^1.1.1",
"regexp.prototype.flags": "^1.2.0"
},
"deprecated": false,
"description": "node's assert.deepEqual algorithm",
"devDependencies": {
"@ljharb/eslint-config": "^13.1.1",
"eslint": "^5.16.0",
"tape": "^4.11.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": {
"lint": "eslint .",
"pretest": "npm run lint",
"test": "npm run tests-only",
"tests-only": "tape test/*"
},
"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.1.0"
}

57
node_modules/deep-equal/readme.markdown generated vendored Normal file
View File

@ -0,0 +1,57 @@
# 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`.
[![browser support](https://ci.testling.com/substack/node-deep-equal.png)](https://ci.testling.com/substack/node-deep-equal)
[![build status](https://secure.travis-ci.org/substack/node-deep-equal.png)](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
```

21
node_modules/deep-equal/test/_tape.js generated vendored Normal file
View File

@ -0,0 +1,21 @@
var Test = require('tape/lib/test');
var is = require('object-is');
var equal = require('../');
function equalReversed(t, a, b, isEqual, msg, isStrict, skipReversed) {
var actual = isStrict ? equal(a, b, { strict: true }) : equal(a, b);
var suffix = isEqual ? ' are equal' : ' are not equal';
t.equal(actual, !!isEqual, msg + suffix);
if (typeof skipReversed === 'boolean' ? !skipReversed : !is(a, b)) {
var actualReverse = isStrict ? equal(b, a, { strict: true }) : equal(b, a);
t.equal(actualReverse, !!isEqual, msg + suffix + ' (reversed)');
}
}
function deepEqualTest(t, a, b, msg, isEqual, isStrictEqual, skipReversed) {
equalReversed(t, a, b, isEqual, msg, false, skipReversed);
equalReversed(t, a, b, isStrictEqual, 'strict: ' + msg, true, skipReversed);
}
Test.prototype.deepEqualTest = function (a, b, message, isEqual, isStrictEqual, skipReversed) {
return deepEqualTest(this, a, b, message, !!isEqual, !!isStrictEqual, skipReversed);
};

344
node_modules/deep-equal/test/cmp.js generated vendored Normal file
View File

@ -0,0 +1,344 @@
var test = require('tape');
require('./_tape');
var equal = require('../');
test('equal', function (t) {
t.deepEqualTest(
{ a: [2, 3], b: [4] },
{ a: [2, 3], b: [4] },
'two equal objects',
true,
true,
false
);
t.end();
});
test('not equal', function (t) {
t.deepEqualTest(
{ x: 5, y: [6] },
{ x: 5, y: 6 },
'two inequal objects are',
false,
false
);
t.end();
});
test('nested nulls', function (t) {
t.deepEqualTest(
[null, null, null],
[null, null, null],
'same-length arrays of nulls',
true,
true,
true
);
t.end();
});
test('objects with strings vs numbers', function (t) {
t.deepEqualTest(
[{ a: 3 }, { b: 4 }],
[{ a: '3' }, { b: '4' }],
'objects with equivalent string/number values',
true,
false
);
t.end();
});
test('non-objects', function (t) {
t.deepEqualTest(3, 3, 'same numbers', true, true, true);
t.deepEqualTest('beep', 'beep', 'same strings', true, true, true);
t.deepEqualTest('3', 3, 'numeric string and number', true, false);
t.deepEqualTest('3', [3], 'numeric string and array containing number', false, false);
t.deepEqualTest(3, [3], 'number and array containing number', false, false);
t.end();
});
test('infinities', function (t) {
t.deepEqualTest(Infinity, Infinity, '∞ and ∞', true, true, true);
t.deepEqualTest(-Infinity, -Infinity, '-∞ and -∞', true, true, true);
t.deepEqualTest(Infinity, -Infinity, '∞ and -∞', false, false);
t.end();
});
test('arguments class', function (t) {
function getArgs() {
return arguments;
}
t.ok(
equal(getArgs(1, 2, 3), getArgs(1, 2, 3)),
'equivalent arguments objects are equal'
);
t.deepEqualTest(
getArgs(1, 2, 3),
[1, 2, 3],
'array and arguments with same contents',
false,
false
);
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.deepEqualTest(d0, d1, 'equivalent Dates', true, true);
t.end();
});
test('buffers', function (t) {
/* eslint no-buffer-constructor: 1, new-cap: 1 */
t.ok(equal(Buffer('xyz'), Buffer('xyz')), 'buffers with same contents are equal');
t.ok(equal(Buffer('xyz'), Buffer('xyz'), { strict: true }), 'strict: buffers with same contents are equal');
t.deepEqualTest(
Buffer('abc'),
Buffer('xyz'),
'buffers with different contents',
false,
false
);
t.deepEqualTest(
Buffer(''),
[],
'empty buffer and empty array',
false,
false
);
t.end();
});
test('booleans and arrays', function (t) {
t.deepEqualTest(
true,
[],
'true and an empty array',
false,
false
);
t.deepEqualTest(
false,
[],
'false and an empty array',
true,
false
);
t.end();
});
test('arrays initiated', function (t) {
var a0 = [
undefined,
null,
-1,
0,
1,
false,
true,
undefined,
'',
'abc',
null,
undefined
],
a1 = [
undefined,
null,
-1,
0,
1,
false,
true,
undefined,
'',
'abc',
null,
undefined
];
t.ok(equal(a0, a1));
t.end();
});
// eslint-disable-next-line max-statements
test('arrays assigned', function (t) {
var a0 = [
undefined,
null,
-1,
0,
1,
false,
true,
undefined,
'',
'abc',
null,
undefined
];
var a1 = [];
a1[0] = undefined;
a1[1] = null;
a1[2] = -1;
a1[3] = 0;
a1[4] = 1;
a1[5] = false;
a1[6] = true;
a1[7] = undefined;
a1[8] = '';
a1[9] = 'abc';
a1[10] = null;
a1[11] = undefined;
a1.length = 12;
t.deepEqualTest(a0, a1, 'a literal array and an assigned array', true, true);
t.end();
});
// eslint-disable-next-line max-statements
test('arrays push', function (t) {
var a0 = [
undefined,
null,
-1,
0,
1,
false,
true,
undefined,
'',
'abc',
null,
undefined
],
a1 = [];
a1.push(undefined);
a1.push(null);
a1.push(-1);
a1.push(0);
a1.push(1);
a1.push(false);
a1.push(true);
a1.push(undefined);
a1.push('');
a1.push('abc');
a1.push(null);
a1.push(undefined);
a1.length = 12;
t.deepEqualTest(a0, a1, 'a literal array and a pushed array', true, true);
t.end();
});
test('null == undefined', function (t) {
t.deepEqualTest(null, undefined, 'null and undefined', true, false);
t.end();
});
test('NaNs', function (t) {
t.notOk(equal(NaN, NaN), 'NaN is not NaN');
t.ok(equal(NaN, NaN, { strict: true }), 'strict: NaN is NaN');
t.notOk(equal({ a: NaN }, { a: NaN }), 'two equiv objects with a NaN value are not equiv');
t.ok(equal({ a: NaN }, { a: NaN }, { strict: true }), 'strict: two equiv objects with a NaN value are equiv');
t.notOk(equal(NaN, 1), 'NaN !== 1');
t.notOk(equal(NaN, 1, { strict: true }), 'strict: NaN !== 1');
t.end();
});
test('zeroes', function (t) {
t.deepEqualTest(0, -0, '0 and -0', true, false);
t.deepEqualTest({ a: 0 }, { a: -0 }, 'two objects with a same-keyed 0/-0 value', true, false);
t.end();
});
test('Object.create', { skip: !Object.create }, function (t) {
var a = { a: 'A' };
var b = Object.create(a);
b.b = 'B';
var c = Object.create(a);
c.b = 'C';
t.deepEqualTest(
b,
c,
'two objects with the same [[Prototype]] but a different own property',
false,
false
);
t.end();
});
test('Object.create(null)', { skip: !Object.create }, function (t) {
t.deepEqualTest(
Object.create(null),
Object.create(null),
'two empty null objects',
true,
true,
true
);
t.deepEqualTest(
Object.create(null, { a: { value: 'b' } }),
Object.create(null, { a: { value: 'b' } }),
'two null objects with the same property pair',
true,
true,
true
);
t.end();
});
test('regexes vs dates', function (t) {
var d = new Date(1387585278000);
var r = /abc/;
t.deepEqualTest(d, r, 'Date and RegExp', false, false);
t.end();
});
test('regexen', function (t) {
t.deepEqualTest(/abc/, /xyz/, 'two different regexes', false, false);
t.deepEqualTest(/abc/, /abc/, 'two abc regexes', true, true, false);
t.deepEqualTest(/xyz/, /xyz/, 'two xyz regexes', true, true, false);
t.end();
});
test('arrays and objects', function (t) {
t.deepEqualTest([], {}, 'empty array and empty object', true, true);
t.deepEqualTest([], { length: 0 }, 'empty array and empty arraylike object', false, false);
t.deepEqualTest([1], { 0: 1 }, 'array and similar object', true, true);
t.end();
});
test('functions', function (t) {
function f() {}
t.deepEqualTest(f, f, 'a function and itself', true, true, true);
t.deepEqualTest(function () {}, function () {}, 'two distinct functions', false, false, true);
t.end();
});