mol_compare_deep 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +41 -1
- package/node.deps.json +1 -1
- package/package.json +1 -1
- package/web.deps.json +1 -1
package/README.md
CHANGED
|
@@ -4,4 +4,44 @@ Deeply compares two values. Supports cyclic references. Uses cache to prevent mu
|
|
|
4
4
|
|
|
5
5
|
## [Benchmark](https://perf.js.hyoo.ru/#!prefixes=%5B%22const%20compare%20%3D%20%24mol_compare_deep%22%2C%22const%20compare%20%3D%20%24mol_import.module%28%5Cn%5Ct'https%3A%2F%2Fesm.sh%2Fdeep-eql'%5Cn%29.default%22%2C%22const%20compare%20%3D%20%24mol_import.module%28%5Cn%5Ct'https%3A%2F%2Fesm.sh%2Fdeep-equal'%5Cn%29.default%22%2C%22const%20compare%20%3D%20%24mol_import.module%28%5Cn%5Ct'https%3A%2F%2Fesm.sh%2Ffast-equals'%5Cn%29.circularDeepEqual%22%5D/prefix=let%20base%20%3D%20%7B%7D%0Alet%20el%20%3D%20document.createElement%28%20'div'%20%29%0Alet%20res%20%3D%20false%0A%0Aconst%20make%20%3D%20%28%29%3D%3E%20%7B%0A%0A%09const%20next%20%3D%20%7B%0A%09%09val%3A%20%5B%20true%2C%201%2C%20'2'%20%5D%2C%0A%09%09obj%3A%20%5B%0A%09%09%09%2F3%2F%2C%0A%09%09%09el%2C%0A%09%09%09new%20Map%2C%0A%09%09%09new%20Set%2C%0A%09%09%09new%20Date%281%29%2C%0A%09%09%5D%2C%0A%09%7D%0A%0A%09next.obj.push%28%0A%09%09next%2C%0A%09%09next.val%2C%0A%09%09next.obj%2C%0A%09%29%0A%0A%09return%20next%0A%7D/sources=%5B%22const%20next%7B%23%7D%20%3D%20make%28%29%5Cnres%20%3D%20compare%28%20base%2C%20next%7B%23%7D%20%29%5Cnbase%20%3D%20next%7B%23%7D%22%2C%22const%20next%7B%23%7D%20%3D%20make%28%29%5Cnres%20%3D%20compare%28%20base%2C%20next%7B%23%7D%20%29%5Cnbase%20%3D%20next%7B%23%7D%22%2C%22const%20next%7B%23%7D%20%3D%20make%28%29%5Cnres%20%3D%20compare%28%20base%2C%20next%7B%23%7D%2C%20%7B%20strict%3A%20true%20%7D%20%29%5Cnbase%20%3D%20next%7B%23%7D%22%2C%22const%20next%7B%23%7D%20%3D%20make%28%29%5Cnres%20%3D%20compare%28%20base%2C%20next%7B%23%7D%20%29%5Cnbase%20%3D%20next%7B%23%7D%22%5D/postfix=const%20x%20%3D%20%5B1%5D%0A%24mol_assert_ok%28%20compare%28%0A%09%5B%7B%20a%3A%20%5B1%5D%2C%20b%3A%20%20x%20%20%7D%5D%2C%0A%09%5B%7B%20a%3A%20%20x%2C%20%20b%3A%20%5B1%5D%20%7D%5D%2C%0A%29%20%29%0A%0A%24mol_assert_not%28%20compare%28%20%7B%7D%2C%20make%28%29%20%29%20%29%0A%24mol_assert_ok%28%20compare%28%20make%28%29%2C%20make%28%29%20%29%20%29)
|
|
6
6
|
|
|
7
|
-

|
|
8
|
+
|
|
9
|
+
## Usage from MAM
|
|
10
|
+
|
|
11
|
+
```js
|
|
12
|
+
|
|
13
|
+
let x, y
|
|
14
|
+
|
|
15
|
+
// true, equals
|
|
16
|
+
$mol_compare_deep(
|
|
17
|
+
x = { a: [1], b: x },
|
|
18
|
+
y = { a: [1], b: y }],
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
// false, don't equals
|
|
22
|
+
$mol_compare_deep(
|
|
23
|
+
x = { a: [1], b: x },
|
|
24
|
+
y = { a: [1], b: x }],
|
|
25
|
+
)
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Usage from NPM
|
|
29
|
+
|
|
30
|
+
```sh
|
|
31
|
+
npm install mol_compare_deep
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
[](https://bundlephobia.com/package/mol_compare_deep)
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
**Import as ESM**
|
|
38
|
+
|
|
39
|
+
```js
|
|
40
|
+
import { $mol_compare_deep } from 'mol_compare_deep'
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
**Import as CJS**
|
|
44
|
+
|
|
45
|
+
```js
|
|
46
|
+
const { $mol_compare_deep } = require( 'mol_compare_deep' )
|
|
47
|
+
```
|
package/node.deps.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"files":["LICENSE","README.md","lang.lang.tree","mam.jam.js","mam.ts","package.json","sandbox.config.json","tsconfig.json","tsfmt.json","yarn.lock","mol/CNAME","mol/CODE_OF_CONDUCT.md","mol/CONTRIBUTING.md","mol/LICENSE","mol/index.html","mol/mol.meta.tree","mol/readme.md","mol/compare/deep/README.md","mol/compare/deep/deep.ts"],"mods":{},"deps_in":{"mol/compare":{"mol/compare/deep":-9007199254740991},"mol":{"mol/compare":-9007199254740991},"":{"mol":-9007199254740991}},"deps_out":{"mol/compare/deep":{"mol/compare":-9007199254740991},"mol/compare":{"mol":-9007199254740991},"mol":{"":-9007199254740991}},"sloc":{"LICENSE":113,"md":
|
|
1
|
+
{"files":["LICENSE","README.md","lang.lang.tree","mam.jam.js","mam.ts","package.json","sandbox.config.json","tsconfig.json","tsfmt.json","yarn.lock","mol/CNAME","mol/CODE_OF_CONDUCT.md","mol/CONTRIBUTING.md","mol/LICENSE","mol/index.html","mol/mol.meta.tree","mol/readme.md","mol/compare/deep/README.md","mol/compare/deep/deep.ts"],"mods":{},"deps_in":{"mol/compare":{"mol/compare/deep":-9007199254740991},"mol":{"mol/compare":-9007199254740991},"":{"mol":-9007199254740991}},"deps_out":{"mol/compare/deep":{"mol/compare":-9007199254740991},"mol/compare":{"mol":-9007199254740991},"mol":{"":-9007199254740991}},"sloc":{"LICENSE":113,"md":530,"tree":31,"js":10,"ts":109,"json":85,"lock":939,"CNAME":1,"html":1},"deps":{"mol/compare/deep":{"..":-9007199254740991,"/mol/compare/deep/cache":-1,"/mol/compare/deep":-1,"/mol/compare/deep/cache/get":-2,"/mol/compare/deep/cache/set":-3},"mol/compare":{"..":-9007199254740991},"mol":{"..":-9007199254740991},"":{}}}
|
package/package.json
CHANGED
package/web.deps.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"files":["LICENSE","README.md","lang.lang.tree","mam.jam.js","mam.ts","package.json","sandbox.config.json","tsconfig.json","tsfmt.json","yarn.lock","mol/CNAME","mol/CODE_OF_CONDUCT.md","mol/CONTRIBUTING.md","mol/LICENSE","mol/index.html","mol/mol.meta.tree","mol/readme.md","mol/compare/deep/README.md","mol/compare/deep/deep.ts"],"mods":{},"deps_in":{"mol/compare":{"mol/compare/deep":-9007199254740991},"mol":{"mol/compare":-9007199254740991},"":{"mol":-9007199254740991}},"deps_out":{"mol/compare/deep":{"mol/compare":-9007199254740991},"mol/compare":{"mol":-9007199254740991},"mol":{"":-9007199254740991}},"sloc":{"LICENSE":113,"md":
|
|
1
|
+
{"files":["LICENSE","README.md","lang.lang.tree","mam.jam.js","mam.ts","package.json","sandbox.config.json","tsconfig.json","tsfmt.json","yarn.lock","mol/CNAME","mol/CODE_OF_CONDUCT.md","mol/CONTRIBUTING.md","mol/LICENSE","mol/index.html","mol/mol.meta.tree","mol/readme.md","mol/compare/deep/README.md","mol/compare/deep/deep.ts"],"mods":{},"deps_in":{"mol/compare":{"mol/compare/deep":-9007199254740991},"mol":{"mol/compare":-9007199254740991},"":{"mol":-9007199254740991}},"deps_out":{"mol/compare/deep":{"mol/compare":-9007199254740991},"mol/compare":{"mol":-9007199254740991},"mol":{"":-9007199254740991}},"sloc":{"LICENSE":113,"md":530,"tree":31,"js":10,"ts":109,"json":85,"lock":939,"CNAME":1,"html":1},"deps":{"mol/compare/deep":{"..":-9007199254740991,"/mol/compare/deep/cache":-1,"/mol/compare/deep":-1,"/mol/compare/deep/cache/get":-2,"/mol/compare/deep/cache/set":-3},"mol/compare":{"..":-9007199254740991},"mol":{"..":-9007199254740991},"":{}}}
|