dot.dot.dot.exampol

This commit is contained in:
Captain Nick Lucifer* 2023-03-10 23:21:16 +05:45
commit a0bc2d79de
406 changed files with 34577 additions and 0 deletions

55
node_modules/deep-equal/README.markdown generated vendored Normal file
View file

@ -0,0 +1,55 @@
deep-equal
==========
Node's `assert.deepEqual() algorithm` as a standalone module.
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
=======
var deepEqual = require('deep-equal')
deepEqual(a, b)
---------------
Compare objects `a` and `b`, returning whether they are equal according to a
recursive equality algorithm.
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.

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 }
)
]);

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

@ -0,0 +1,84 @@
var pSlice = Array.prototype.slice;
var Object_keys = typeof Object.keys === 'function'
? Object.keys
: function (obj) {
var keys = [];
for (var key in obj) keys.push(key);
return keys;
}
;
var deepEqual = module.exports = function (actual, expected) {
// 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 (typeof actual != 'object' && typeof expected != 'object') {
return 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);
}
}
function isUndefinedOrNull(value) {
return value === null || value === undefined;
}
function isArguments(object) {
return Object.prototype.toString.call(object) == '[object Arguments]';
}
function objEquiv(a, b) {
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);
}
try {
var ka = Object_keys(a),
kb = Object_keys(b),
key, i;
} 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])) return false;
}
return true;
}

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

@ -0,0 +1,33 @@
{
"name" : "deep-equal",
"version" : "0.0.0",
"description" : "node's assert.deepEqual algorithm",
"main" : "index.js",
"directories" : {
"lib" : ".",
"example" : "example",
"test" : "test"
},
"scripts" : {
"test" : "tap test/*.js"
},
"devDependencies" : {
"tap" : "0.0.x"
},
"repository" : {
"type" : "git",
"url" : "http://github.com/substack/node-deep-equal.git"
},
"keywords" : [
"equality",
"equal",
"compare"
],
"author" : {
"name" : "James Halliday",
"email" : "mail@substack.net",
"url" : "http://substack.net"
},
"license" : "MIT/X11",
"engine" : { "node" : ">=0.4" }
}

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

@ -0,0 +1,18 @@
var test = require('tap').test;
var equal = require('../');
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();
});