ast-compare 3.0.10 → 3.0.11
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/LICENSE +1 -1
- package/README.md +2 -6
- package/dist/ast-compare.esm.js +1 -1
- package/dist/ast-compare.umd.js +4 -4
- package/package.json +6 -4
- package/types/index.d.ts +17 -7
package/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c) 2010-
|
|
3
|
+
Copyright (c) 2010-2022 Roy Revelt and other contributors
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining
|
|
6
6
|
a copy of this software and associated documentation files (the
|
package/README.md
CHANGED
|
@@ -26,14 +26,12 @@
|
|
|
26
26
|
|
|
27
27
|
## Install
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
The latest version is **ESM only**: Node 12+ is needed to use it and it must be `import`ed instead of `require`d. If your project is not on ESM yet and you want to use `require`, use an older version of this program, `2.1.0`.
|
|
30
30
|
|
|
31
31
|
```bash
|
|
32
32
|
npm i ast-compare
|
|
33
33
|
```
|
|
34
34
|
|
|
35
|
-
If you need a legacy version which works with `require`, use version 2.1.0
|
|
36
|
-
|
|
37
35
|
## Quick Take
|
|
38
36
|
|
|
39
37
|
```js
|
|
@@ -75,8 +73,6 @@ To report bugs or request features or assistance, [raise an issue](https://githu
|
|
|
75
73
|
|
|
76
74
|
MIT License
|
|
77
75
|
|
|
78
|
-
Copyright (c) 2010-
|
|
79
|
-
|
|
76
|
+
Copyright (c) 2010-2022 Roy Revelt and other contributors
|
|
80
77
|
|
|
81
78
|
<img src="https://codsen.com/images/png-codsen-ok.png" width="98" alt="ok" align="center"> <img src="https://codsen.com/images/png-codsen-1.png" width="148" alt="codsen" align="center"> <img src="https://codsen.com/images/png-codsen-star-small.png" width="32" alt="star" align="center">
|
|
82
|
-
|
package/dist/ast-compare.esm.js
CHANGED
package/dist/ast-compare.umd.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @name ast-compare
|
|
3
3
|
* @fileoverview Compare anything: AST, objects, arrays, strings and nested thereof
|
|
4
|
-
* @version 3.0.
|
|
4
|
+
* @version 3.0.11
|
|
5
5
|
* @author Roy Revelt, Codsen Ltd
|
|
6
6
|
* @license MIT
|
|
7
7
|
* {@link https://codsen.com/os/ast-compare/}
|
|
@@ -12,7 +12,7 @@ var astCompare=(()=>{var Et=Object.create;var M=Object.defineProperty,$t=Object.
|
|
|
12
12
|
/**
|
|
13
13
|
* @name ast-contains-only-empty-space
|
|
14
14
|
* @fileoverview Does AST contain only empty space?
|
|
15
|
-
* @version 3.0.
|
|
15
|
+
* @version 3.0.11
|
|
16
16
|
* @author Roy Revelt, Codsen Ltd
|
|
17
17
|
* @license MIT
|
|
18
18
|
* {@link https://codsen.com/os/ast-contains-only-empty-space/}
|
|
@@ -20,7 +20,7 @@ var astCompare=(()=>{var Et=Object.create;var M=Object.defineProperty,$t=Object.
|
|
|
20
20
|
/**
|
|
21
21
|
* @name ast-monkey-traverse
|
|
22
22
|
* @fileoverview Utility library to traverse AST
|
|
23
|
-
* @version 3.0.
|
|
23
|
+
* @version 3.0.11
|
|
24
24
|
* @author Roy Revelt, Codsen Ltd
|
|
25
25
|
* @license MIT
|
|
26
26
|
* {@link https://codsen.com/os/ast-monkey-traverse/}
|
|
@@ -28,7 +28,7 @@ var astCompare=(()=>{var Et=Object.create;var M=Object.defineProperty,$t=Object.
|
|
|
28
28
|
/**
|
|
29
29
|
* @name ast-monkey-util
|
|
30
30
|
* @fileoverview Utility library of AST helper functions
|
|
31
|
-
* @version 2.0.
|
|
31
|
+
* @version 2.0.11
|
|
32
32
|
* @author Roy Revelt, Codsen Ltd
|
|
33
33
|
* @license MIT
|
|
34
34
|
* {@link https://codsen.com/os/ast-monkey-util/}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ast-compare",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.11",
|
|
4
4
|
"description": "Compare anything: AST, objects, arrays, strings and nested thereof",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"array",
|
|
@@ -42,13 +42,15 @@
|
|
|
42
42
|
"scripts": {
|
|
43
43
|
"build": "node '../../ops/scripts/esbuild.js' && yarn run dts",
|
|
44
44
|
"dev": "DEV=true node '../../ops/scripts/esbuild.js' && yarn run dts",
|
|
45
|
-
"dts": "rollup -c",
|
|
45
|
+
"dts": "rollup -c && yarn run prettier 'types/index.d.ts' --write",
|
|
46
46
|
"examples": "node '../../ops/scripts/run-examples.js'",
|
|
47
47
|
"lect": "node '../../ops/lect/lect.js'",
|
|
48
48
|
"letspublish": "yarn publish || :",
|
|
49
49
|
"lint": "eslint . --fix",
|
|
50
50
|
"perf": "node perf/check.js",
|
|
51
51
|
"prepare": "echo 'ready'",
|
|
52
|
+
"prettier": "prettier",
|
|
53
|
+
"prettier:format": "prettier --write '**/*.{ts,tsx,md}' --no-error-on-unmatched-pattern",
|
|
52
54
|
"pretest": "yarn run lect && yarn run build",
|
|
53
55
|
"test": "c8 yarn run unit && yarn run examples && yarn run lint",
|
|
54
56
|
"unit": "uvu test"
|
|
@@ -71,7 +73,7 @@
|
|
|
71
73
|
}
|
|
72
74
|
},
|
|
73
75
|
"dependencies": {
|
|
74
|
-
"ast-contains-only-empty-space": "^3.0.
|
|
76
|
+
"ast-contains-only-empty-space": "^3.0.11",
|
|
75
77
|
"lodash.isplainobject": "^4.0.6",
|
|
76
78
|
"matcher": "^5.0.0",
|
|
77
79
|
"type-detect": "^4.0.8"
|
|
@@ -79,6 +81,6 @@
|
|
|
79
81
|
"devDependencies": {
|
|
80
82
|
"@types/lodash.isplainobject": "^4.0.6",
|
|
81
83
|
"@types/type-detect": "^4.0.1",
|
|
82
|
-
"type-fest": "^2.
|
|
84
|
+
"type-fest": "^2.9.0"
|
|
83
85
|
}
|
|
84
86
|
}
|
package/types/index.d.ts
CHANGED
|
@@ -1,17 +1,27 @@
|
|
|
1
|
-
declare type JsonValue =
|
|
1
|
+
declare type JsonValue =
|
|
2
|
+
| string
|
|
3
|
+
| number
|
|
4
|
+
| boolean
|
|
5
|
+
| null
|
|
6
|
+
| JsonObject
|
|
7
|
+
| JsonArray;
|
|
2
8
|
declare type JsonObject = {
|
|
3
|
-
|
|
9
|
+
[Key in string]?: JsonValue;
|
|
4
10
|
};
|
|
5
11
|
declare type JsonArray = JsonValue[];
|
|
6
12
|
interface Opts {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
13
|
+
hungryForWhitespace?: boolean;
|
|
14
|
+
matchStrictly?: boolean;
|
|
15
|
+
verboseWhenMismatches?: boolean;
|
|
16
|
+
useWildcards?: boolean;
|
|
11
17
|
}
|
|
12
18
|
/**
|
|
13
19
|
* Compare anything: AST, objects, arrays, strings and nested thereof
|
|
14
20
|
*/
|
|
15
|
-
declare function compare(
|
|
21
|
+
declare function compare(
|
|
22
|
+
b: JsonValue,
|
|
23
|
+
s: JsonValue,
|
|
24
|
+
originalOpts?: Opts
|
|
25
|
+
): boolean | string;
|
|
16
26
|
|
|
17
27
|
export { compare };
|