ast-compare 4.0.42 → 4.1.0
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/.eslintcache +1 -1
- package/CHANGELOG.md +6 -0
- package/dist/ast-compare.esm.js +2 -2
- package/dist/ast-compare.umd.js +6 -6
- package/package.json +3 -3
package/.eslintcache
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"/home/runner/work/codsen/codsen/packages/ast-compare/examples/_quickTake.js":"1","/home/runner/work/codsen/codsen/packages/ast-compare/examples/compare-arrays.js":"2","/home/runner/work/codsen/codsen/packages/ast-compare/examples/compare-objects.js":"3","/home/runner/work/codsen/codsen/packages/ast-compare/examples/compare-strings.js":"4","/home/runner/work/codsen/codsen/packages/ast-compare/examples/opts-hungryForWhitespace.js":"5","/home/runner/work/codsen/codsen/packages/ast-compare/examples/opts-useWildcards.js":"6","/home/runner/work/codsen/codsen/packages/ast-compare/examples/opts-verboseWhenMismatches.js":"7","/home/runner/work/codsen/codsen/packages/ast-compare/perf/check.js":"8","/home/runner/work/codsen/codsen/packages/ast-compare/rollup.config.js":"9","/home/runner/work/codsen/codsen/packages/ast-compare/src/main.ts":"10","/home/runner/work/codsen/codsen/packages/ast-compare/test/api.js":"11","/home/runner/work/codsen/codsen/packages/ast-compare/test/arrays.js":"12","/home/runner/work/codsen/codsen/packages/ast-compare/test/empty-arrays.js":"13","/home/runner/work/codsen/codsen/packages/ast-compare/test/loose-mode.js":"14","/home/runner/work/codsen/codsen/packages/ast-compare/test/nested.js":"15","/home/runner/work/codsen/codsen/packages/ast-compare/test/simples.js":"16","/home/runner/work/codsen/codsen/packages/ast-compare/test/strings.js":"17","/home/runner/work/codsen/codsen/packages/ast-compare/test/various.js":"18","/home/runner/work/codsen/codsen/packages/ast-compare/test/verboseWhenMismatches.js":"19","/home/runner/work/codsen/codsen/packages/ast-compare/test/wildcards.js":"20"},{"size":406,"mtime":1760280945874,"results":"21","hashOfConfig":"22"},{"size":584,"mtime":1760280945874,"results":"23","hashOfConfig":"22"},{"size":532,"mtime":1760280945874,"results":"24","hashOfConfig":"22"},{"size":205,"mtime":1760280945874,"results":"25","hashOfConfig":"22"},{"size":1146,"mtime":1760280945874,"results":"26","hashOfConfig":"22"},{"size":554,"mtime":1760280945874,"results":"27","hashOfConfig":"22"},{"size":831,"mtime":1760280945874,"results":"28","hashOfConfig":"22"},{"size":412,"mtime":1760280945874,"results":"29","hashOfConfig":"30"},{"size":373,"mtime":1760280945875,"results":"31","hashOfConfig":"22"},{"size":11306,"mtime":1760280945875,"results":"32","hashOfConfig":"30"},{"size":604,"mtime":1760280945875,"results":"33","hashOfConfig":"34"},{"size":10234,"mtime":1760280945875,"results":"35","hashOfConfig":"34"},{"size":3154,"mtime":1760280945875,"results":"36","hashOfConfig":"34"},{"size":1366,"mtime":1760280945875,"results":"37","hashOfConfig":"34"},{"size":3675,"mtime":1760280945875,"results":"38","hashOfConfig":"34"},{"size":11213,"mtime":1760280945875,"results":"39","hashOfConfig":"34"},{"size":4647,"mtime":1760280945875,"results":"40","hashOfConfig":"34"},{"size":15280,"mtime":1760280945875,"results":"41","hashOfConfig":"34"},{"size":675,"mtime":1760280945875,"results":"42","hashOfConfig":"34"},{"size":4416,"mtime":1760280945875,"results":"43","hashOfConfig":"34"},{"filePath":"44","messages":"45","suppressedMessages":"46","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"1f1u168",{"filePath":"47","messages":"48","suppressedMessages":"49","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"50","messages":"51","suppressedMessages":"52","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"53","messages":"54","suppressedMessages":"55","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"56","messages":"57","suppressedMessages":"58","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"59","messages":"60","suppressedMessages":"61","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"62","messages":"63","suppressedMessages":"64","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"65","messages":"66","suppressedMessages":"67","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"91l1rm",{"filePath":"68","messages":"69","suppressedMessages":"70","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"71","messages":"72","suppressedMessages":"73","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"74","messages":"75","suppressedMessages":"76","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"ns3qdb",{"filePath":"77","messages":"78","suppressedMessages":"79","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"80","messages":"81","suppressedMessages":"82","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"83","messages":"84","suppressedMessages":"85","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"86","messages":"87","suppressedMessages":"88","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"89","messages":"90","suppressedMessages":"91","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"92","messages":"93","suppressedMessages":"94","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"95","messages":"96","suppressedMessages":"97","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"98","messages":"99","suppressedMessages":"100","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"101","messages":"102","suppressedMessages":"103","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/home/runner/work/codsen/codsen/packages/ast-compare/examples/_quickTake.js",[],[],"/home/runner/work/codsen/codsen/packages/ast-compare/examples/compare-arrays.js",[],[],"/home/runner/work/codsen/codsen/packages/ast-compare/examples/compare-objects.js",[],[],"/home/runner/work/codsen/codsen/packages/ast-compare/examples/compare-strings.js",[],[],"/home/runner/work/codsen/codsen/packages/ast-compare/examples/opts-hungryForWhitespace.js",[],[],"/home/runner/work/codsen/codsen/packages/ast-compare/examples/opts-useWildcards.js",[],[],"/home/runner/work/codsen/codsen/packages/ast-compare/examples/opts-verboseWhenMismatches.js",[],[],"/home/runner/work/codsen/codsen/packages/ast-compare/perf/check.js",[],[],"/home/runner/work/codsen/codsen/packages/ast-compare/rollup.config.js",[],[],"/home/runner/work/codsen/codsen/packages/ast-compare/src/main.ts",[],["104"],"/home/runner/work/codsen/codsen/packages/ast-compare/test/api.js",[],["105","106","107","108","109","110"],"/home/runner/work/codsen/codsen/packages/ast-compare/test/arrays.js",[],["111","112","113","114","115"],"/home/runner/work/codsen/codsen/packages/ast-compare/test/empty-arrays.js",[],["116","117","118","119","120","121"],"/home/runner/work/codsen/codsen/packages/ast-compare/test/loose-mode.js",[],["122","123","124","125","126","127"],"/home/runner/work/codsen/codsen/packages/ast-compare/test/nested.js",[],["128","129","130","131","132","133"],"/home/runner/work/codsen/codsen/packages/ast-compare/test/simples.js",[],["134","135","136","137"],"/home/runner/work/codsen/codsen/packages/ast-compare/test/strings.js",[],["138","139","140","141","142"],"/home/runner/work/codsen/codsen/packages/ast-compare/test/various.js",[],["143","144","145","146","147","148"],"/home/runner/work/codsen/codsen/packages/ast-compare/test/verboseWhenMismatches.js",[],["149","150","151","152","153","154"],"/home/runner/work/codsen/codsen/packages/ast-compare/test/wildcards.js",[],["155","156","157","158","159","160"],{"ruleId":"161","severity":2,"message":"162","line":262,"column":10,"nodeType":"163","endLine":262,"endColumn":20,"fix":"164","suppressions":"165"},{"ruleId":"166","severity":2,"message":"167","line":3,"column":17,"nodeType":null,"messageId":"168","endLine":3,"endColumn":19,"suppressions":"169"},{"ruleId":"166","severity":2,"message":"170","line":3,"column":21,"nodeType":null,"messageId":"168","endLine":3,"endColumn":23,"suppressions":"171"},{"ruleId":"166","severity":2,"message":"172","line":3,"column":25,"nodeType":null,"messageId":"168","endLine":3,"endColumn":31,"suppressions":"173"},{"ruleId":"166","severity":2,"message":"174","line":3,"column":33,"nodeType":null,"messageId":"168","endLine":3,"endColumn":37,"suppressions":"175"},{"ruleId":"166","severity":2,"message":"176","line":3,"column":39,"nodeType":null,"messageId":"168","endLine":3,"endColumn":42,"suppressions":"177"},{"ruleId":"166","severity":2,"message":"178","line":3,"column":44,"nodeType":null,"messageId":"168","endLine":3,"endColumn":49,"suppressions":"179"},{"ruleId":"166","severity":2,"message":"167","line":3,"column":17,"nodeType":null,"messageId":"168","endLine":3,"endColumn":19,"suppressions":"180"},{"ruleId":"166","severity":2,"message":"170","line":3,"column":21,"nodeType":null,"messageId":"168","endLine":3,"endColumn":23,"suppressions":"181"},{"ruleId":"166","severity":2,"message":"172","line":3,"column":25,"nodeType":null,"messageId":"168","endLine":3,"endColumn":31,"suppressions":"182"},{"ruleId":"166","severity":2,"message":"174","line":3,"column":33,"nodeType":null,"messageId":"168","endLine":3,"endColumn":37,"suppressions":"183"},{"ruleId":"166","severity":2,"message":"178","line":3,"column":44,"nodeType":null,"messageId":"168","endLine":3,"endColumn":49,"suppressions":"184"},{"ruleId":"166","severity":2,"message":"167","line":3,"column":17,"nodeType":null,"messageId":"168","endLine":3,"endColumn":19,"suppressions":"185"},{"ruleId":"166","severity":2,"message":"170","line":3,"column":21,"nodeType":null,"messageId":"168","endLine":3,"endColumn":23,"suppressions":"186"},{"ruleId":"166","severity":2,"message":"172","line":3,"column":25,"nodeType":null,"messageId":"168","endLine":3,"endColumn":31,"suppressions":"187"},{"ruleId":"166","severity":2,"message":"174","line":3,"column":33,"nodeType":null,"messageId":"168","endLine":3,"endColumn":37,"suppressions":"188"},{"ruleId":"166","severity":2,"message":"176","line":3,"column":39,"nodeType":null,"messageId":"168","endLine":3,"endColumn":42,"suppressions":"189"},{"ruleId":"166","severity":2,"message":"178","line":3,"column":44,"nodeType":null,"messageId":"168","endLine":3,"endColumn":49,"suppressions":"190"},{"ruleId":"166","severity":2,"message":"167","line":3,"column":17,"nodeType":null,"messageId":"168","endLine":3,"endColumn":19,"suppressions":"191"},{"ruleId":"166","severity":2,"message":"170","line":3,"column":21,"nodeType":null,"messageId":"168","endLine":3,"endColumn":23,"suppressions":"192"},{"ruleId":"166","severity":2,"message":"172","line":3,"column":25,"nodeType":null,"messageId":"168","endLine":3,"endColumn":31,"suppressions":"193"},{"ruleId":"166","severity":2,"message":"174","line":3,"column":33,"nodeType":null,"messageId":"168","endLine":3,"endColumn":37,"suppressions":"194"},{"ruleId":"166","severity":2,"message":"176","line":3,"column":39,"nodeType":null,"messageId":"168","endLine":3,"endColumn":42,"suppressions":"195"},{"ruleId":"166","severity":2,"message":"178","line":3,"column":44,"nodeType":null,"messageId":"168","endLine":3,"endColumn":49,"suppressions":"196"},{"ruleId":"166","severity":2,"message":"167","line":3,"column":17,"nodeType":null,"messageId":"168","endLine":3,"endColumn":19,"suppressions":"197"},{"ruleId":"166","severity":2,"message":"170","line":3,"column":21,"nodeType":null,"messageId":"168","endLine":3,"endColumn":23,"suppressions":"198"},{"ruleId":"166","severity":2,"message":"172","line":3,"column":25,"nodeType":null,"messageId":"168","endLine":3,"endColumn":31,"suppressions":"199"},{"ruleId":"166","severity":2,"message":"174","line":3,"column":33,"nodeType":null,"messageId":"168","endLine":3,"endColumn":37,"suppressions":"200"},{"ruleId":"166","severity":2,"message":"176","line":3,"column":39,"nodeType":null,"messageId":"168","endLine":3,"endColumn":42,"suppressions":"201"},{"ruleId":"166","severity":2,"message":"178","line":3,"column":44,"nodeType":null,"messageId":"168","endLine":3,"endColumn":49,"suppressions":"202"},{"ruleId":"166","severity":2,"message":"170","line":3,"column":21,"nodeType":null,"messageId":"168","endLine":3,"endColumn":23,"suppressions":"203"},{"ruleId":"166","severity":2,"message":"172","line":3,"column":25,"nodeType":null,"messageId":"168","endLine":3,"endColumn":31,"suppressions":"204"},{"ruleId":"166","severity":2,"message":"176","line":3,"column":39,"nodeType":null,"messageId":"168","endLine":3,"endColumn":42,"suppressions":"205"},{"ruleId":"166","severity":2,"message":"178","line":3,"column":44,"nodeType":null,"messageId":"168","endLine":3,"endColumn":49,"suppressions":"206"},{"ruleId":"166","severity":2,"message":"167","line":3,"column":17,"nodeType":null,"messageId":"168","endLine":3,"endColumn":19,"suppressions":"207"},{"ruleId":"166","severity":2,"message":"170","line":3,"column":21,"nodeType":null,"messageId":"168","endLine":3,"endColumn":23,"suppressions":"208"},{"ruleId":"166","severity":2,"message":"172","line":3,"column":25,"nodeType":null,"messageId":"168","endLine":3,"endColumn":31,"suppressions":"209"},{"ruleId":"166","severity":2,"message":"174","line":3,"column":33,"nodeType":null,"messageId":"168","endLine":3,"endColumn":37,"suppressions":"210"},{"ruleId":"166","severity":2,"message":"178","line":3,"column":44,"nodeType":null,"messageId":"168","endLine":3,"endColumn":49,"suppressions":"211"},{"ruleId":"166","severity":2,"message":"167","line":3,"column":17,"nodeType":null,"messageId":"168","endLine":3,"endColumn":19,"suppressions":"212"},{"ruleId":"166","severity":2,"message":"170","line":3,"column":21,"nodeType":null,"messageId":"168","endLine":3,"endColumn":23,"suppressions":"213"},{"ruleId":"166","severity":2,"message":"172","line":3,"column":25,"nodeType":null,"messageId":"168","endLine":3,"endColumn":31,"suppressions":"214"},{"ruleId":"166","severity":2,"message":"174","line":3,"column":33,"nodeType":null,"messageId":"168","endLine":3,"endColumn":37,"suppressions":"215"},{"ruleId":"166","severity":2,"message":"176","line":3,"column":39,"nodeType":null,"messageId":"168","endLine":3,"endColumn":42,"suppressions":"216"},{"ruleId":"166","severity":2,"message":"178","line":3,"column":44,"nodeType":null,"messageId":"168","endLine":3,"endColumn":49,"suppressions":"217"},{"ruleId":"166","severity":2,"message":"218","line":3,"column":10,"nodeType":null,"messageId":"168","endLine":3,"endColumn":15,"suppressions":"219"},{"ruleId":"166","severity":2,"message":"167","line":3,"column":17,"nodeType":null,"messageId":"168","endLine":3,"endColumn":19,"suppressions":"220"},{"ruleId":"166","severity":2,"message":"170","line":3,"column":21,"nodeType":null,"messageId":"168","endLine":3,"endColumn":23,"suppressions":"221"},{"ruleId":"166","severity":2,"message":"172","line":3,"column":25,"nodeType":null,"messageId":"168","endLine":3,"endColumn":31,"suppressions":"222"},{"ruleId":"166","severity":2,"message":"176","line":3,"column":39,"nodeType":null,"messageId":"168","endLine":3,"endColumn":42,"suppressions":"223"},{"ruleId":"166","severity":2,"message":"178","line":3,"column":44,"nodeType":null,"messageId":"168","endLine":3,"endColumn":49,"suppressions":"224"},{"ruleId":"166","severity":2,"message":"167","line":3,"column":17,"nodeType":null,"messageId":"168","endLine":3,"endColumn":19,"suppressions":"225"},{"ruleId":"166","severity":2,"message":"170","line":3,"column":21,"nodeType":null,"messageId":"168","endLine":3,"endColumn":23,"suppressions":"226"},{"ruleId":"166","severity":2,"message":"172","line":3,"column":25,"nodeType":null,"messageId":"168","endLine":3,"endColumn":31,"suppressions":"227"},{"ruleId":"166","severity":2,"message":"174","line":3,"column":33,"nodeType":null,"messageId":"168","endLine":3,"endColumn":37,"suppressions":"228"},{"ruleId":"166","severity":2,"message":"176","line":3,"column":39,"nodeType":null,"messageId":"168","endLine":3,"endColumn":42,"suppressions":"229"},{"ruleId":"166","severity":2,"message":"178","line":3,"column":44,"nodeType":null,"messageId":"168","endLine":3,"endColumn":49,"suppressions":"230"},"prefer-let/prefer-let","`const` declaration outside top-level scope","VariableDeclaration",{"range":"231","text":"232"},["233"],"@typescript-eslint/no-unused-vars","'is' is defined but never used.","unusedVar",["234"],"'ok' is defined but never used.",["235"],"'throws' is defined but never used.",["236"],"'type' is defined but never used.",["237"],"'not' is defined but never used.",["238"],"'match' is defined but never used.",["239"],["240"],["241"],["242"],["243"],["244"],["245"],["246"],["247"],["248"],["249"],["250"],["251"],["252"],["253"],["254"],["255"],["256"],["257"],["258"],["259"],["260"],["261"],["262"],["263"],["264"],["265"],["266"],["267"],["268"],["269"],["270"],["271"],["272"],["273"],["274"],["275"],["276"],["277"],"'equal' is defined but never used.",["278"],["279"],["280"],["281"],["282"],["283"],["284"],["285"],["286"],["287"],["288"],["289"],[7297,7302],"let",{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},"directive",""]
|
|
1
|
+
[{"/home/runner/work/codsen/codsen/packages/ast-compare/examples/_quickTake.js":"1","/home/runner/work/codsen/codsen/packages/ast-compare/examples/compare-arrays.js":"2","/home/runner/work/codsen/codsen/packages/ast-compare/examples/compare-objects.js":"3","/home/runner/work/codsen/codsen/packages/ast-compare/examples/compare-strings.js":"4","/home/runner/work/codsen/codsen/packages/ast-compare/examples/opts-hungryForWhitespace.js":"5","/home/runner/work/codsen/codsen/packages/ast-compare/examples/opts-useWildcards.js":"6","/home/runner/work/codsen/codsen/packages/ast-compare/examples/opts-verboseWhenMismatches.js":"7","/home/runner/work/codsen/codsen/packages/ast-compare/perf/check.js":"8","/home/runner/work/codsen/codsen/packages/ast-compare/rollup.config.js":"9","/home/runner/work/codsen/codsen/packages/ast-compare/src/main.ts":"10","/home/runner/work/codsen/codsen/packages/ast-compare/test/api.js":"11","/home/runner/work/codsen/codsen/packages/ast-compare/test/arrays.js":"12","/home/runner/work/codsen/codsen/packages/ast-compare/test/empty-arrays.js":"13","/home/runner/work/codsen/codsen/packages/ast-compare/test/loose-mode.js":"14","/home/runner/work/codsen/codsen/packages/ast-compare/test/nested.js":"15","/home/runner/work/codsen/codsen/packages/ast-compare/test/simples.js":"16","/home/runner/work/codsen/codsen/packages/ast-compare/test/strings.js":"17","/home/runner/work/codsen/codsen/packages/ast-compare/test/various.js":"18","/home/runner/work/codsen/codsen/packages/ast-compare/test/verboseWhenMismatches.js":"19","/home/runner/work/codsen/codsen/packages/ast-compare/test/wildcards.js":"20"},{"size":406,"mtime":1760566739066,"results":"21","hashOfConfig":"22"},{"size":584,"mtime":1760566739066,"results":"23","hashOfConfig":"22"},{"size":532,"mtime":1760566739066,"results":"24","hashOfConfig":"22"},{"size":205,"mtime":1760566739066,"results":"25","hashOfConfig":"22"},{"size":1146,"mtime":1760566739066,"results":"26","hashOfConfig":"22"},{"size":554,"mtime":1760566739066,"results":"27","hashOfConfig":"22"},{"size":831,"mtime":1760566739066,"results":"28","hashOfConfig":"22"},{"size":412,"mtime":1760566739066,"results":"29","hashOfConfig":"30"},{"size":373,"mtime":1760566739066,"results":"31","hashOfConfig":"22"},{"size":11306,"mtime":1760566739066,"results":"32","hashOfConfig":"30"},{"size":604,"mtime":1760566739066,"results":"33","hashOfConfig":"34"},{"size":10234,"mtime":1760566739066,"results":"35","hashOfConfig":"34"},{"size":3154,"mtime":1760566739066,"results":"36","hashOfConfig":"34"},{"size":1366,"mtime":1760566739066,"results":"37","hashOfConfig":"34"},{"size":3675,"mtime":1760566739066,"results":"38","hashOfConfig":"34"},{"size":11213,"mtime":1760566739066,"results":"39","hashOfConfig":"34"},{"size":4647,"mtime":1760566739066,"results":"40","hashOfConfig":"34"},{"size":15280,"mtime":1760566739066,"results":"41","hashOfConfig":"34"},{"size":675,"mtime":1760566739067,"results":"42","hashOfConfig":"34"},{"size":4416,"mtime":1760566739067,"results":"43","hashOfConfig":"34"},{"filePath":"44","messages":"45","suppressedMessages":"46","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"1nlhngw",{"filePath":"47","messages":"48","suppressedMessages":"49","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"50","messages":"51","suppressedMessages":"52","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"53","messages":"54","suppressedMessages":"55","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"56","messages":"57","suppressedMessages":"58","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"59","messages":"60","suppressedMessages":"61","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"62","messages":"63","suppressedMessages":"64","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"65","messages":"66","suppressedMessages":"67","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"1xjytlu",{"filePath":"68","messages":"69","suppressedMessages":"70","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"71","messages":"72","suppressedMessages":"73","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"74","messages":"75","suppressedMessages":"76","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"nrihsz",{"filePath":"77","messages":"78","suppressedMessages":"79","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"80","messages":"81","suppressedMessages":"82","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"83","messages":"84","suppressedMessages":"85","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"86","messages":"87","suppressedMessages":"88","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"89","messages":"90","suppressedMessages":"91","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"92","messages":"93","suppressedMessages":"94","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"95","messages":"96","suppressedMessages":"97","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"98","messages":"99","suppressedMessages":"100","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"101","messages":"102","suppressedMessages":"103","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/home/runner/work/codsen/codsen/packages/ast-compare/examples/_quickTake.js",[],[],"/home/runner/work/codsen/codsen/packages/ast-compare/examples/compare-arrays.js",[],[],"/home/runner/work/codsen/codsen/packages/ast-compare/examples/compare-objects.js",[],[],"/home/runner/work/codsen/codsen/packages/ast-compare/examples/compare-strings.js",[],[],"/home/runner/work/codsen/codsen/packages/ast-compare/examples/opts-hungryForWhitespace.js",[],[],"/home/runner/work/codsen/codsen/packages/ast-compare/examples/opts-useWildcards.js",[],[],"/home/runner/work/codsen/codsen/packages/ast-compare/examples/opts-verboseWhenMismatches.js",[],[],"/home/runner/work/codsen/codsen/packages/ast-compare/perf/check.js",[],[],"/home/runner/work/codsen/codsen/packages/ast-compare/rollup.config.js",[],[],"/home/runner/work/codsen/codsen/packages/ast-compare/src/main.ts",[],["104"],"/home/runner/work/codsen/codsen/packages/ast-compare/test/api.js",[],["105","106","107","108","109","110"],"/home/runner/work/codsen/codsen/packages/ast-compare/test/arrays.js",[],["111","112","113","114","115"],"/home/runner/work/codsen/codsen/packages/ast-compare/test/empty-arrays.js",[],["116","117","118","119","120","121"],"/home/runner/work/codsen/codsen/packages/ast-compare/test/loose-mode.js",[],["122","123","124","125","126","127"],"/home/runner/work/codsen/codsen/packages/ast-compare/test/nested.js",[],["128","129","130","131","132","133"],"/home/runner/work/codsen/codsen/packages/ast-compare/test/simples.js",[],["134","135","136","137"],"/home/runner/work/codsen/codsen/packages/ast-compare/test/strings.js",[],["138","139","140","141","142"],"/home/runner/work/codsen/codsen/packages/ast-compare/test/various.js",[],["143","144","145","146","147","148"],"/home/runner/work/codsen/codsen/packages/ast-compare/test/verboseWhenMismatches.js",[],["149","150","151","152","153","154"],"/home/runner/work/codsen/codsen/packages/ast-compare/test/wildcards.js",[],["155","156","157","158","159","160"],{"ruleId":"161","severity":2,"message":"162","line":262,"column":10,"nodeType":"163","endLine":262,"endColumn":20,"fix":"164","suppressions":"165"},{"ruleId":"166","severity":2,"message":"167","line":3,"column":17,"nodeType":null,"messageId":"168","endLine":3,"endColumn":19,"suppressions":"169"},{"ruleId":"166","severity":2,"message":"170","line":3,"column":21,"nodeType":null,"messageId":"168","endLine":3,"endColumn":23,"suppressions":"171"},{"ruleId":"166","severity":2,"message":"172","line":3,"column":25,"nodeType":null,"messageId":"168","endLine":3,"endColumn":31,"suppressions":"173"},{"ruleId":"166","severity":2,"message":"174","line":3,"column":33,"nodeType":null,"messageId":"168","endLine":3,"endColumn":37,"suppressions":"175"},{"ruleId":"166","severity":2,"message":"176","line":3,"column":39,"nodeType":null,"messageId":"168","endLine":3,"endColumn":42,"suppressions":"177"},{"ruleId":"166","severity":2,"message":"178","line":3,"column":44,"nodeType":null,"messageId":"168","endLine":3,"endColumn":49,"suppressions":"179"},{"ruleId":"166","severity":2,"message":"167","line":3,"column":17,"nodeType":null,"messageId":"168","endLine":3,"endColumn":19,"suppressions":"180"},{"ruleId":"166","severity":2,"message":"170","line":3,"column":21,"nodeType":null,"messageId":"168","endLine":3,"endColumn":23,"suppressions":"181"},{"ruleId":"166","severity":2,"message":"172","line":3,"column":25,"nodeType":null,"messageId":"168","endLine":3,"endColumn":31,"suppressions":"182"},{"ruleId":"166","severity":2,"message":"174","line":3,"column":33,"nodeType":null,"messageId":"168","endLine":3,"endColumn":37,"suppressions":"183"},{"ruleId":"166","severity":2,"message":"178","line":3,"column":44,"nodeType":null,"messageId":"168","endLine":3,"endColumn":49,"suppressions":"184"},{"ruleId":"166","severity":2,"message":"167","line":3,"column":17,"nodeType":null,"messageId":"168","endLine":3,"endColumn":19,"suppressions":"185"},{"ruleId":"166","severity":2,"message":"170","line":3,"column":21,"nodeType":null,"messageId":"168","endLine":3,"endColumn":23,"suppressions":"186"},{"ruleId":"166","severity":2,"message":"172","line":3,"column":25,"nodeType":null,"messageId":"168","endLine":3,"endColumn":31,"suppressions":"187"},{"ruleId":"166","severity":2,"message":"174","line":3,"column":33,"nodeType":null,"messageId":"168","endLine":3,"endColumn":37,"suppressions":"188"},{"ruleId":"166","severity":2,"message":"176","line":3,"column":39,"nodeType":null,"messageId":"168","endLine":3,"endColumn":42,"suppressions":"189"},{"ruleId":"166","severity":2,"message":"178","line":3,"column":44,"nodeType":null,"messageId":"168","endLine":3,"endColumn":49,"suppressions":"190"},{"ruleId":"166","severity":2,"message":"167","line":3,"column":17,"nodeType":null,"messageId":"168","endLine":3,"endColumn":19,"suppressions":"191"},{"ruleId":"166","severity":2,"message":"170","line":3,"column":21,"nodeType":null,"messageId":"168","endLine":3,"endColumn":23,"suppressions":"192"},{"ruleId":"166","severity":2,"message":"172","line":3,"column":25,"nodeType":null,"messageId":"168","endLine":3,"endColumn":31,"suppressions":"193"},{"ruleId":"166","severity":2,"message":"174","line":3,"column":33,"nodeType":null,"messageId":"168","endLine":3,"endColumn":37,"suppressions":"194"},{"ruleId":"166","severity":2,"message":"176","line":3,"column":39,"nodeType":null,"messageId":"168","endLine":3,"endColumn":42,"suppressions":"195"},{"ruleId":"166","severity":2,"message":"178","line":3,"column":44,"nodeType":null,"messageId":"168","endLine":3,"endColumn":49,"suppressions":"196"},{"ruleId":"166","severity":2,"message":"167","line":3,"column":17,"nodeType":null,"messageId":"168","endLine":3,"endColumn":19,"suppressions":"197"},{"ruleId":"166","severity":2,"message":"170","line":3,"column":21,"nodeType":null,"messageId":"168","endLine":3,"endColumn":23,"suppressions":"198"},{"ruleId":"166","severity":2,"message":"172","line":3,"column":25,"nodeType":null,"messageId":"168","endLine":3,"endColumn":31,"suppressions":"199"},{"ruleId":"166","severity":2,"message":"174","line":3,"column":33,"nodeType":null,"messageId":"168","endLine":3,"endColumn":37,"suppressions":"200"},{"ruleId":"166","severity":2,"message":"176","line":3,"column":39,"nodeType":null,"messageId":"168","endLine":3,"endColumn":42,"suppressions":"201"},{"ruleId":"166","severity":2,"message":"178","line":3,"column":44,"nodeType":null,"messageId":"168","endLine":3,"endColumn":49,"suppressions":"202"},{"ruleId":"166","severity":2,"message":"170","line":3,"column":21,"nodeType":null,"messageId":"168","endLine":3,"endColumn":23,"suppressions":"203"},{"ruleId":"166","severity":2,"message":"172","line":3,"column":25,"nodeType":null,"messageId":"168","endLine":3,"endColumn":31,"suppressions":"204"},{"ruleId":"166","severity":2,"message":"176","line":3,"column":39,"nodeType":null,"messageId":"168","endLine":3,"endColumn":42,"suppressions":"205"},{"ruleId":"166","severity":2,"message":"178","line":3,"column":44,"nodeType":null,"messageId":"168","endLine":3,"endColumn":49,"suppressions":"206"},{"ruleId":"166","severity":2,"message":"167","line":3,"column":17,"nodeType":null,"messageId":"168","endLine":3,"endColumn":19,"suppressions":"207"},{"ruleId":"166","severity":2,"message":"170","line":3,"column":21,"nodeType":null,"messageId":"168","endLine":3,"endColumn":23,"suppressions":"208"},{"ruleId":"166","severity":2,"message":"172","line":3,"column":25,"nodeType":null,"messageId":"168","endLine":3,"endColumn":31,"suppressions":"209"},{"ruleId":"166","severity":2,"message":"174","line":3,"column":33,"nodeType":null,"messageId":"168","endLine":3,"endColumn":37,"suppressions":"210"},{"ruleId":"166","severity":2,"message":"178","line":3,"column":44,"nodeType":null,"messageId":"168","endLine":3,"endColumn":49,"suppressions":"211"},{"ruleId":"166","severity":2,"message":"167","line":3,"column":17,"nodeType":null,"messageId":"168","endLine":3,"endColumn":19,"suppressions":"212"},{"ruleId":"166","severity":2,"message":"170","line":3,"column":21,"nodeType":null,"messageId":"168","endLine":3,"endColumn":23,"suppressions":"213"},{"ruleId":"166","severity":2,"message":"172","line":3,"column":25,"nodeType":null,"messageId":"168","endLine":3,"endColumn":31,"suppressions":"214"},{"ruleId":"166","severity":2,"message":"174","line":3,"column":33,"nodeType":null,"messageId":"168","endLine":3,"endColumn":37,"suppressions":"215"},{"ruleId":"166","severity":2,"message":"176","line":3,"column":39,"nodeType":null,"messageId":"168","endLine":3,"endColumn":42,"suppressions":"216"},{"ruleId":"166","severity":2,"message":"178","line":3,"column":44,"nodeType":null,"messageId":"168","endLine":3,"endColumn":49,"suppressions":"217"},{"ruleId":"166","severity":2,"message":"218","line":3,"column":10,"nodeType":null,"messageId":"168","endLine":3,"endColumn":15,"suppressions":"219"},{"ruleId":"166","severity":2,"message":"167","line":3,"column":17,"nodeType":null,"messageId":"168","endLine":3,"endColumn":19,"suppressions":"220"},{"ruleId":"166","severity":2,"message":"170","line":3,"column":21,"nodeType":null,"messageId":"168","endLine":3,"endColumn":23,"suppressions":"221"},{"ruleId":"166","severity":2,"message":"172","line":3,"column":25,"nodeType":null,"messageId":"168","endLine":3,"endColumn":31,"suppressions":"222"},{"ruleId":"166","severity":2,"message":"176","line":3,"column":39,"nodeType":null,"messageId":"168","endLine":3,"endColumn":42,"suppressions":"223"},{"ruleId":"166","severity":2,"message":"178","line":3,"column":44,"nodeType":null,"messageId":"168","endLine":3,"endColumn":49,"suppressions":"224"},{"ruleId":"166","severity":2,"message":"167","line":3,"column":17,"nodeType":null,"messageId":"168","endLine":3,"endColumn":19,"suppressions":"225"},{"ruleId":"166","severity":2,"message":"170","line":3,"column":21,"nodeType":null,"messageId":"168","endLine":3,"endColumn":23,"suppressions":"226"},{"ruleId":"166","severity":2,"message":"172","line":3,"column":25,"nodeType":null,"messageId":"168","endLine":3,"endColumn":31,"suppressions":"227"},{"ruleId":"166","severity":2,"message":"174","line":3,"column":33,"nodeType":null,"messageId":"168","endLine":3,"endColumn":37,"suppressions":"228"},{"ruleId":"166","severity":2,"message":"176","line":3,"column":39,"nodeType":null,"messageId":"168","endLine":3,"endColumn":42,"suppressions":"229"},{"ruleId":"166","severity":2,"message":"178","line":3,"column":44,"nodeType":null,"messageId":"168","endLine":3,"endColumn":49,"suppressions":"230"},"prefer-let/prefer-let","`const` declaration outside top-level scope","VariableDeclaration",{"range":"231","text":"232"},["233"],"@typescript-eslint/no-unused-vars","'is' is defined but never used.","unusedVar",["234"],"'ok' is defined but never used.",["235"],"'throws' is defined but never used.",["236"],"'type' is defined but never used.",["237"],"'not' is defined but never used.",["238"],"'match' is defined but never used.",["239"],["240"],["241"],["242"],["243"],["244"],["245"],["246"],["247"],["248"],["249"],["250"],["251"],["252"],["253"],["254"],["255"],["256"],["257"],["258"],["259"],["260"],["261"],["262"],["263"],["264"],["265"],["266"],["267"],["268"],["269"],["270"],["271"],["272"],["273"],["274"],["275"],["276"],["277"],"'equal' is defined but never used.",["278"],["279"],["280"],["281"],["282"],["283"],["284"],["285"],["286"],["287"],["288"],["289"],[7297,7302],"let",{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},{"kind":"290","justification":"291"},"directive",""]
|
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,12 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## 4.1.0 (2025-10-15)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
- if value to be added is a number, keep it as is, don't stringify ([ce3e1a5](https://github.com/codsen/codsen/commit/ce3e1a525998ca3c0abf0142affef95b14cd1990))
|
|
11
|
+
|
|
6
12
|
## 4.0.0 (2022-12-01)
|
|
7
13
|
|
|
8
14
|
### BREAKING CHANGES
|
package/dist/ast-compare.esm.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @name ast-compare
|
|
3
3
|
* @fileoverview Compare anything: AST, objects, arrays, strings and nested thereof
|
|
4
|
-
* @version 4.0
|
|
4
|
+
* @version 4.1.0
|
|
5
5
|
* @author Roy Revelt
|
|
6
6
|
* @license MIT
|
|
7
7
|
* {@link https://codsen.com/os/ast-compare/}
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import i from"type-detect";import{empty as s}from"ast-contains-only-empty-space";import{isPlainObject as o,hasOwnProp as O}from"codsen-utils";import{isMatch as m}from"matcher";var f="4.0
|
|
10
|
+
import i from"type-detect";import{empty as s}from"ast-contains-only-empty-space";import{isPlainObject as o,hasOwnProp as O}from"codsen-utils";import{isMatch as m}from"matcher";var f="4.1.0";var J=f;function V(e){return o(e)?!Object.keys(e).length:Array.isArray(e)||typeof e=="string"?!e.length:!1}var j={hungryForWhitespace:!1,matchStrictly:!1,verboseWhenMismatches:!1,useWildcards:!1};function d(e,t,b){let c,u,h,g=0,r={...j,...b};if(r.hungryForWhitespace&&r.matchStrictly&&o(e)&&s(e)&&o(t)&&!Object.keys(t).length)return!0;if((!r.hungryForWhitespace||r.hungryForWhitespace&&!s(e)&&s(t))&&o(e)&&Object.keys(e).length!==0&&o(t)&&Object.keys(t).length===0||i(e)!==i(t)&&(!r.hungryForWhitespace||r.hungryForWhitespace&&!s(e)))return!1;if(typeof e=="string"&&typeof t=="string")return r.hungryForWhitespace&&s(e)&&s(t)?!0:r.verboseWhenMismatches?e===t?!0:`Given string ${t} is not matched! We have ${e} on the other end.`:r.useWildcards?m(e,t,{caseSensitive:!0}):e===t;if(Array.isArray(e)&&Array.isArray(t)){if(r.hungryForWhitespace&&s(t)&&(!r.matchStrictly||r.matchStrictly&&e.length===t.length))return!0;if(!r.hungryForWhitespace&&t.length>e.length||r.matchStrictly&&t.length!==e.length)return r.verboseWhenMismatches?`The length of a given array, ${JSON.stringify(t,null,4)} is ${t.length} but the length of an array on the other end, ${JSON.stringify(e,null,4)} is ${e.length}`:!1;if(t.length===0)return e.length===0?!0:r.verboseWhenMismatches?`The given array has no elements, but the array on the other end, ${JSON.stringify(e,null,4)} does have some`:!1;for(let n=0,a=t.length;n<a;n++){h=!1;for(let l=g,y=e.length;l<y;l++)if(g+=1,d(e[l],t[n],r)===!0){h=!0;break}if(!h)return r.verboseWhenMismatches?`The given array ${JSON.stringify(t,null,4)} is not a subset of an array on the other end, ${JSON.stringify(e,null,4)}`:!1}}else if(o(e)&&o(t)){if(c=new Set(Object.keys(t)),u=new Set(Object.keys(e)),r.matchStrictly&&c.size!==u.size){if(!r.verboseWhenMismatches)return!1;let n=new Set([...c].filter(p=>!u.has(p))),a=n.size?` First object has unique keys: ${JSON.stringify(n,null,4)}.`:"",l=new Set([...u].filter(p=>!c.has(p))),y=l.size?` Second object has unique keys:
|
|
11
11
|
${JSON.stringify(l,null,4)}.`:"";return`When matching strictly, we found that both objects have different amount of keys.${a}${y}`}for(let n of c){if(!O(e,n))return!r.useWildcards||r.useWildcards&&!n.includes("*")?r.verboseWhenMismatches?`The given object has key "${n}" which the other-one does not have.`:!1:Object.keys(e).some(a=>m(a,n,{caseSensitive:!0}))?!0:r.verboseWhenMismatches?`The given object has key "${n}" which the other-one does not have.`:!1;if(e[n]!=null&&i(e[n])!==i(t[n])){if(!(s(e[n])&&s(t[n])&&r.hungryForWhitespace))return r.verboseWhenMismatches?`The given key ${n} is of a different type on both objects. On the first-one, it's ${i(t[n])}, on the second-one, it's ${i(e[n])}`:!1}else if(d(e[n],t[n],r)!==!0)return r.verboseWhenMismatches?`The given piece ${JSON.stringify(t[n],null,4)} and ${JSON.stringify(e[n],null,4)} don't match.`:!1}}else return r.hungryForWhitespace&&s(e)&&s(t)&&(!r.matchStrictly||r.matchStrictly&&V(t))?!0:e===t;return!0}export{d as compare,j as defaults,J as version};
|
package/dist/ast-compare.umd.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @name ast-compare
|
|
3
3
|
* @fileoverview Compare anything: AST, objects, arrays, strings and nested thereof
|
|
4
|
-
* @version 4.0
|
|
4
|
+
* @version 4.1.0
|
|
5
5
|
* @author Roy Revelt
|
|
6
6
|
* @license MIT
|
|
7
7
|
* {@link https://codsen.com/os/ast-compare/}
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
"use strict";var astCompare=(()=>{var ae=Object.create,J=Object.freeze,v=Object.defineProperty,le=Object.defineProperties,ce=Object.getOwnPropertyDescriptor,ue=Object.getOwnPropertyDescriptors,fe=Object.getOwnPropertyNames,I=Object.getOwnPropertySymbols,pe=Object.getPrototypeOf,_=Object.prototype.hasOwnProperty,ye=Object.prototype.propertyIsEnumerable;var F=(e,t,i)=>t in e?v(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,b=(e,t)=>{for(var i in t||(t={}))_.call(t,i)&&F(e,i,t[i]);if(I)for(var i of I(t))ye.call(t,i)&&F(e,i,t[i]);return e},w=(e,t)=>le(e,ue(t));var K=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),ge=(e,t)=>{for(var i in t)v(e,i,{get:t[i],enumerable:!0})},R=(e,t,i,c)=>{if(t&&typeof t=="object"||typeof t=="function")for(let u of fe(t))!_.call(e,u)&&u!==i&&v(e,u,{get:()=>t[u],enumerable:!(c=ce(t,u))||c.enumerable});return e};var x=(e,t,i)=>(i=e!=null?ae(pe(e)):{},R(t||!e||!e.__esModule?v(i,"default",{value:e,enumerable:!0}):i,e)),he=e=>R(v({},"__esModule",{value:!0}),e);var j=(e,t)=>J(v(e,"raw",{value:J(t||e.slice())}));var H=K((V,k)=>{(function(e,t){typeof V=="object"&&typeof k<"u"?k.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self,e.typeDetect=t())})(V,(function(){"use strict";var e=typeof Promise=="function",t=(function(y){if(typeof globalThis=="object")return globalThis;Object.defineProperty(y,"typeDetectGlobalObject",{get:function(){return this},configurable:!0});var $=typeDetectGlobalObject;return delete y.typeDetectGlobalObject,$})(Object.prototype),i=typeof Symbol<"u",c=typeof Map<"u",u=typeof Set<"u",f=typeof WeakMap<"u",l=typeof WeakSet<"u",n=typeof DataView<"u",r=i&&typeof Symbol.iterator<"u",o=i&&typeof Symbol.toStringTag<"u",a=u&&typeof Set.prototype.entries=="function",s=c&&typeof Map.prototype.entries=="function",p=a&&Object.getPrototypeOf(new Set().entries()),d=s&&Object.getPrototypeOf(new Map().entries()),g=r&&typeof Array.prototype[Symbol.iterator]=="function",E=g&&Object.getPrototypeOf([][Symbol.iterator]()),L=r&&typeof String.prototype[Symbol.iterator]=="function",ne=L&&Object.getPrototypeOf(""[Symbol.iterator]()),oe=8,se=-1;function ie(y){var $=typeof y;if($!=="object")return $;if(y===null)return"null";if(y===t)return"global";if(Array.isArray(y)&&(o===!1||!(Symbol.toStringTag in y)))return"Array";if(typeof window=="object"&&window!==null){if(typeof window.location=="object"&&y===window.location)return"Location";if(typeof window.document=="object"&&y===window.document)return"Document";if(typeof window.navigator=="object"){if(typeof window.navigator.mimeTypes=="object"&&y===window.navigator.mimeTypes)return"MimeTypeArray";if(typeof window.navigator.plugins=="object"&&y===window.navigator.plugins)return"PluginArray"}if((typeof window.HTMLElement=="function"||typeof window.HTMLElement=="object")&&y instanceof window.HTMLElement){if(y.tagName==="BLOCKQUOTE")return"HTMLQuoteElement";if(y.tagName==="TD")return"HTMLTableDataCellElement";if(y.tagName==="TH")return"HTMLTableHeaderCellElement"}}var D=o&&y[Symbol.toStringTag];if(typeof D=="string")return D;var h=Object.getPrototypeOf(y);return h===RegExp.prototype?"RegExp":h===Date.prototype?"Date":e&&h===Promise.prototype?"Promise":u&&h===Set.prototype?"Set":c&&h===Map.prototype?"Map":l&&h===WeakSet.prototype?"WeakSet":f&&h===WeakMap.prototype?"WeakMap":n&&h===DataView.prototype?"DataView":c&&h===d?"Map Iterator":u&&h===p?"Set Iterator":g&&h===E?"Array Iterator":L&&h===ne?"String Iterator":h===null?"Object":Object.prototype.toString.call(y).slice(oe,se)}return ie}))});var T=K((je,Q)=>{"use strict";Q.exports=de;function S(e){return e instanceof Buffer?Buffer.from(e):new e.constructor(e.buffer.slice(),e.byteOffset,e.length)}function de(e){if(e=e||{},e.circles)return me(e);let t=new Map;if(t.set(Date,l=>new Date(l)),t.set(Map,(l,n)=>new Map(c(Array.from(l),n))),t.set(Set,(l,n)=>new Set(c(Array.from(l),n))),e.constructorHandlers)for(let l of e.constructorHandlers)t.set(l[0],l[1]);let i=null;return e.proto?f:u;function c(l,n){let r=Object.keys(l),o=new Array(r.length);for(let a=0;a<r.length;a++){let s=r[a],p=l[s];typeof p!="object"||p===null?o[s]=p:p.constructor!==Object&&(i=t.get(p.constructor))?o[s]=i(p,n):ArrayBuffer.isView(p)?o[s]=S(p):o[s]=n(p)}return o}function u(l){if(typeof l!="object"||l===null)return l;if(Array.isArray(l))return c(l,u);if(l.constructor!==Object&&(i=t.get(l.constructor)))return i(l,u);let n={};for(let r in l){if(Object.hasOwnProperty.call(l,r)===!1)continue;let o=l[r];typeof o!="object"||o===null?n[r]=o:o.constructor!==Object&&(i=t.get(o.constructor))?n[r]=i(o,u):ArrayBuffer.isView(o)?n[r]=S(o):n[r]=u(o)}return n}function f(l){if(typeof l!="object"||l===null)return l;if(Array.isArray(l))return c(l,f);if(l.constructor!==Object&&(i=t.get(l.constructor)))return i(l,f);let n={};for(let r in l){let o=l[r];typeof o!="object"||o===null?n[r]=o:o.constructor!==Object&&(i=t.get(o.constructor))?n[r]=i(o,f):ArrayBuffer.isView(o)?n[r]=S(o):n[r]=f(o)}return n}}function me(e){let t=[],i=[],c=new Map;if(c.set(Date,r=>new Date(r)),c.set(Map,(r,o)=>new Map(f(Array.from(r),o))),c.set(Set,(r,o)=>new Set(f(Array.from(r),o))),e.constructorHandlers)for(let r of e.constructorHandlers)c.set(r[0],r[1]);let u=null;return e.proto?n:l;function f(r,o){let a=Object.keys(r),s=new Array(a.length);for(let p=0;p<a.length;p++){let d=a[p],g=r[d];if(typeof g!="object"||g===null)s[d]=g;else if(g.constructor!==Object&&(u=c.get(g.constructor)))s[d]=u(g,o);else if(ArrayBuffer.isView(g))s[d]=S(g);else{let E=t.indexOf(g);E!==-1?s[d]=i[E]:s[d]=o(g)}}return s}function l(r){if(typeof r!="object"||r===null)return r;if(Array.isArray(r))return f(r,l);if(r.constructor!==Object&&(u=c.get(r.constructor)))return u(r,l);let o={};t.push(r),i.push(o);for(let a in r){if(Object.hasOwnProperty.call(r,a)===!1)continue;let s=r[a];if(typeof s!="object"||s===null)o[a]=s;else if(s.constructor!==Object&&(u=c.get(s.constructor)))o[a]=u(s,l);else if(ArrayBuffer.isView(s))o[a]=S(s);else{let p=t.indexOf(s);p!==-1?o[a]=i[p]:o[a]=l(s)}}return t.pop(),i.pop(),o}function n(r){if(typeof r!="object"||r===null)return r;if(Array.isArray(r))return f(r,n);if(r.constructor!==Object&&(u=c.get(r.constructor)))return u(r,n);let o={};t.push(r),i.push(o);for(let a in r){let s=r[a];if(typeof s!="object"||s===null)o[a]=s;else if(s.constructor!==Object&&(u=c.get(s.constructor)))o[a]=u(s,n);else if(ArrayBuffer.isView(s))o[a]=S(s);else{let p=t.indexOf(s);p!==-1?o[a]=i[p]:o[a]=n(s)}}return t.pop(),i.pop(),o}}});var Ee={};ge(Ee,{compare:()=>B,defaults:()=>re,version:()=>Se});var A=x(H(),1);var z=x(T(),1);var q=x(T(),1);var De=(0,q.default)();function O(e){if(e==null||typeof e!="object")return!1;let t=Object.getPrototypeOf(e);return t!==null&&t!==Object.prototype&&Object.getPrototypeOf(t)!==null?!1:!(Symbol.iterator in e)&&!(Symbol.toStringTag in e)}function be(e){return typeof e=="string"}function U(e,t){return O(e)&&be(t)&&t in e}function M(e){if(e.includes(".")){let t=e.lastIndexOf(".");if(!e.slice(0,t).includes("."))return e.slice(0,t);for(let i=t-1;i--;)if(e[i]===".")return e.slice(i+1,t)}return null}var C=(0,z.default)();function G(e,t){let i={now:!1};function c(u,f,l,n){let r=C(u),o,a=b({depth:-1,path:""},l);if(a.depth+=1,Array.isArray(r))for(let s=0,p=r.length;s<p&&!n.now;s++){let d=a.path?"".concat(a.path,".").concat(s):"".concat(s);r[s]!==void 0?(a.parent=C(r),a.parentType="array",a.parentKey=M(d),o=c(f(r[s],void 0,w(b({},a),{path:d}),n),f,w(b({},a),{path:d}),n),Number.isNaN(o)&&s<r.length?(r.splice(s,1),s-=1):r[s]=o):r.splice(s,1)}else if(O(r))for(let s in r){if(n.now&&s!=null)break;let p=a.path?"".concat(a.path,".").concat(s):s;a.depth===0&&s!=null&&(a.topmostKey=s),a.parent=C(r),a.parentType="object",a.parentKey=M(p),o=c(f(s,r[s],w(b({},a),{path:p}),n),f,w(b({},a),{path:p}),n),Number.isNaN(o)?delete r[s]:r[s]=o}return r}return c(e,t,{},i)}function m(e){if(typeof e=="string")return!e.trim();if(!["object","string"].includes(typeof e)||!e)return!1;let t=!0;return e=G(e,(i,c,u,f)=>{let l=c!==void 0?c:i;return typeof l=="string"&&l.trim()&&(t=!1,f.now=!0),l}),t}function P(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}var W=new Map,Z=(e,t)=>{if(!Array.isArray(e))switch(typeof e){case"string":{e=[e];break}case"undefined":{e=[];break}default:throw new TypeError("Expected '".concat(t,"' to be a string or an array, but got a type of '").concat(typeof e,"'"))}return e.filter(i=>{if(typeof i!="string"){if(i===void 0)return!1;throw new TypeError("Expected '".concat(t,"' to be an array of strings, but found a type of '").concat(typeof i,"' in the array"))}return!0})},X,Y,ee,Oe=(e,t)=>{t=b({caseSensitive:!1},t);let i="s"+(t.caseSensitive?"":"i"),c=e+"|"+i;if(W.has(c))return W.get(c);let u=e[0]==="!";u&&(e=e.slice(1)),e=e.replaceAll(String.raw(X||(X=j(["*"],["\\*"]))),"__ESCAPED_STAR__").replaceAll("\\\\","__ESCAPED_BACKSLASH__").replaceAll(/\\(.)/g,"$1"),e=P(e).replaceAll(String.raw(Y||(Y=j(["*"],["\\*"]))),".*"),e=e.replaceAll("__ESCAPED_STAR__",String.raw(ee||(ee=j(["*"],["\\*"])))).replaceAll("__ESCAPED_BACKSLASH__","\\\\");let f=new RegExp("^".concat(e,"$"),i);return f.negated=u,W.set(c,f),f},Ae=(e,t,i,c)=>{if(e=Z(e,"inputs"),t=Z(t,"patterns"),t.length===0)return[];t=t.map(r=>Oe(r,i));let u=t.filter(r=>r.negated),f=t.filter(r=>!r.negated),{allPatterns:l}=i||{},n=[];if(l&&c&&u.length>1&&f.length===0){for(let r of e)for(let o of u)if(o.test(r))return[];return e.slice(0,1)}for(let r of e){let o=!1;for(let a of u)if(a.test(r)){o=!0;break}if(!o){if(f.length===0)n.push(r);else if(l){let a=Array.from({length:f.length},()=>!1);for(let[s,p]of f.entries())p.test(r)&&(a[s]=!0);a.every(Boolean)&&n.push(r)}else{let a=!1;for(let s of f)if(s.test(r)){a=!0;break}a&&n.push(r)}if(c&&n.length>0)break}}return n};function N(e,t,i){return Ae(e,t,i,!0).length>0}var te="4.0.42";var Se=te;function we(e){return O(e)?!Object.keys(e).length:Array.isArray(e)||typeof e=="string"?!e.length:!1}var re={hungryForWhitespace:!1,matchStrictly:!1,verboseWhenMismatches:!1,useWildcards:!1};function B(e,t,i){let c,u,f,l=0,n=b(b({},re),i);if(n.hungryForWhitespace&&n.matchStrictly&&O(e)&&m(e)&&O(t)&&!Object.keys(t).length)return!0;if((!n.hungryForWhitespace||n.hungryForWhitespace&&!m(e)&&m(t))&&O(e)&&Object.keys(e).length!==0&&O(t)&&Object.keys(t).length===0||(0,A.default)(e)!==(0,A.default)(t)&&(!n.hungryForWhitespace||n.hungryForWhitespace&&!m(e)))return!1;if(typeof e=="string"&&typeof t=="string")return n.hungryForWhitespace&&m(e)&&m(t)?!0:n.verboseWhenMismatches?e===t?!0:"Given string ".concat(t," is not matched! We have ").concat(e," on the other end."):n.useWildcards?N(e,t,{caseSensitive:!0}):e===t;if(Array.isArray(e)&&Array.isArray(t)){if(n.hungryForWhitespace&&m(t)&&(!n.matchStrictly||n.matchStrictly&&e.length===t.length))return!0;if(!n.hungryForWhitespace&&t.length>e.length||n.matchStrictly&&t.length!==e.length)return n.verboseWhenMismatches?"The length of a given array, ".concat(JSON.stringify(t,null,4)," is ").concat(t.length," but the length of an array on the other end, ").concat(JSON.stringify(e,null,4)," is ").concat(e.length):!1;if(t.length===0)return e.length===0?!0:n.verboseWhenMismatches?"The given array has no elements, but the array on the other end, ".concat(JSON.stringify(e,null,4)," does have some"):!1;for(let r=0,o=t.length;r<o;r++){f=!1;for(let a=l,s=e.length;a<s;a++)if(l+=1,B(e[a],t[r],n)===!0){f=!0;break}if(!f)return n.verboseWhenMismatches?"The given array ".concat(JSON.stringify(t,null,4)," is not a subset of an array on the other end, ").concat(JSON.stringify(e,null,4)):!1}}else if(O(e)&&O(t)){if(c=new Set(Object.keys(t)),u=new Set(Object.keys(e)),n.matchStrictly&&c.size!==u.size){if(!n.verboseWhenMismatches)return!1;let r=new Set([...c].filter(p=>!u.has(p))),o=r.size?" First object has unique keys: ".concat(JSON.stringify(r,null,4),"."):"",a=new Set([...u].filter(p=>!c.has(p))),s=a.size?" Second object has unique keys:\n ".concat(JSON.stringify(a,null,4),"."):"";return"When matching strictly, we found that both objects have different amount of keys.".concat(o).concat(s)}for(let r of c){if(!U(e,r))return!n.useWildcards||n.useWildcards&&!r.includes("*")?n.verboseWhenMismatches?'The given object has key "'.concat(r,'" which the other-one does not have.'):!1:Object.keys(e).some(o=>N(o,r,{caseSensitive:!0}))?!0:n.verboseWhenMismatches?'The given object has key "'.concat(r,'" which the other-one does not have.'):!1;if(e[r]!=null&&(0,A.default)(e[r])!==(0,A.default)(t[r])){if(!(m(e[r])&&m(t[r])&&n.hungryForWhitespace))return n.verboseWhenMismatches?"The given key ".concat(r," is of a different type on both objects. On the first-one, it's ").concat((0,A.default)(t[r]),", on the second-one, it's ").concat((0,A.default)(e[r])):!1}else if(B(e[r],t[r],n)!==!0)return n.verboseWhenMismatches?"The given piece ".concat(JSON.stringify(t[r],null,4)," and ").concat(JSON.stringify(e[r],null,4)," don't match."):!1}}else return n.hungryForWhitespace&&m(e)&&m(t)&&(!n.matchStrictly||n.matchStrictly&&we(t))?!0:e===t;return!0}return he(Ee);})();
|
|
10
|
+
"use strict";var astCompare=(()=>{var ae=Object.create,J=Object.freeze,v=Object.defineProperty,le=Object.defineProperties,ce=Object.getOwnPropertyDescriptor,ue=Object.getOwnPropertyDescriptors,fe=Object.getOwnPropertyNames,I=Object.getOwnPropertySymbols,pe=Object.getPrototypeOf,_=Object.prototype.hasOwnProperty,ye=Object.prototype.propertyIsEnumerable;var F=(e,t,i)=>t in e?v(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,b=(e,t)=>{for(var i in t||(t={}))_.call(t,i)&&F(e,i,t[i]);if(I)for(var i of I(t))ye.call(t,i)&&F(e,i,t[i]);return e},w=(e,t)=>le(e,ue(t));var K=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),ge=(e,t)=>{for(var i in t)v(e,i,{get:t[i],enumerable:!0})},R=(e,t,i,c)=>{if(t&&typeof t=="object"||typeof t=="function")for(let u of fe(t))!_.call(e,u)&&u!==i&&v(e,u,{get:()=>t[u],enumerable:!(c=ce(t,u))||c.enumerable});return e};var x=(e,t,i)=>(i=e!=null?ae(pe(e)):{},R(t||!e||!e.__esModule?v(i,"default",{value:e,enumerable:!0}):i,e)),he=e=>R(v({},"__esModule",{value:!0}),e);var j=(e,t)=>J(v(e,"raw",{value:J(t||e.slice())}));var H=K((V,k)=>{(function(e,t){typeof V=="object"&&typeof k<"u"?k.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self,e.typeDetect=t())})(V,(function(){"use strict";var e=typeof Promise=="function",t=(function(y){if(typeof globalThis=="object")return globalThis;Object.defineProperty(y,"typeDetectGlobalObject",{get:function(){return this},configurable:!0});var $=typeDetectGlobalObject;return delete y.typeDetectGlobalObject,$})(Object.prototype),i=typeof Symbol<"u",c=typeof Map<"u",u=typeof Set<"u",f=typeof WeakMap<"u",l=typeof WeakSet<"u",n=typeof DataView<"u",r=i&&typeof Symbol.iterator<"u",o=i&&typeof Symbol.toStringTag<"u",a=u&&typeof Set.prototype.entries=="function",s=c&&typeof Map.prototype.entries=="function",p=a&&Object.getPrototypeOf(new Set().entries()),d=s&&Object.getPrototypeOf(new Map().entries()),g=r&&typeof Array.prototype[Symbol.iterator]=="function",E=g&&Object.getPrototypeOf([][Symbol.iterator]()),L=r&&typeof String.prototype[Symbol.iterator]=="function",ne=L&&Object.getPrototypeOf(""[Symbol.iterator]()),oe=8,se=-1;function ie(y){var $=typeof y;if($!=="object")return $;if(y===null)return"null";if(y===t)return"global";if(Array.isArray(y)&&(o===!1||!(Symbol.toStringTag in y)))return"Array";if(typeof window=="object"&&window!==null){if(typeof window.location=="object"&&y===window.location)return"Location";if(typeof window.document=="object"&&y===window.document)return"Document";if(typeof window.navigator=="object"){if(typeof window.navigator.mimeTypes=="object"&&y===window.navigator.mimeTypes)return"MimeTypeArray";if(typeof window.navigator.plugins=="object"&&y===window.navigator.plugins)return"PluginArray"}if((typeof window.HTMLElement=="function"||typeof window.HTMLElement=="object")&&y instanceof window.HTMLElement){if(y.tagName==="BLOCKQUOTE")return"HTMLQuoteElement";if(y.tagName==="TD")return"HTMLTableDataCellElement";if(y.tagName==="TH")return"HTMLTableHeaderCellElement"}}var D=o&&y[Symbol.toStringTag];if(typeof D=="string")return D;var h=Object.getPrototypeOf(y);return h===RegExp.prototype?"RegExp":h===Date.prototype?"Date":e&&h===Promise.prototype?"Promise":u&&h===Set.prototype?"Set":c&&h===Map.prototype?"Map":l&&h===WeakSet.prototype?"WeakSet":f&&h===WeakMap.prototype?"WeakMap":n&&h===DataView.prototype?"DataView":c&&h===d?"Map Iterator":u&&h===p?"Set Iterator":g&&h===E?"Array Iterator":L&&h===ne?"String Iterator":h===null?"Object":Object.prototype.toString.call(y).slice(oe,se)}return ie}))});var T=K((je,Q)=>{"use strict";Q.exports=de;function S(e){return e instanceof Buffer?Buffer.from(e):new e.constructor(e.buffer.slice(),e.byteOffset,e.length)}function de(e){if(e=e||{},e.circles)return me(e);let t=new Map;if(t.set(Date,l=>new Date(l)),t.set(Map,(l,n)=>new Map(c(Array.from(l),n))),t.set(Set,(l,n)=>new Set(c(Array.from(l),n))),e.constructorHandlers)for(let l of e.constructorHandlers)t.set(l[0],l[1]);let i=null;return e.proto?f:u;function c(l,n){let r=Object.keys(l),o=new Array(r.length);for(let a=0;a<r.length;a++){let s=r[a],p=l[s];typeof p!="object"||p===null?o[s]=p:p.constructor!==Object&&(i=t.get(p.constructor))?o[s]=i(p,n):ArrayBuffer.isView(p)?o[s]=S(p):o[s]=n(p)}return o}function u(l){if(typeof l!="object"||l===null)return l;if(Array.isArray(l))return c(l,u);if(l.constructor!==Object&&(i=t.get(l.constructor)))return i(l,u);let n={};for(let r in l){if(Object.hasOwnProperty.call(l,r)===!1)continue;let o=l[r];typeof o!="object"||o===null?n[r]=o:o.constructor!==Object&&(i=t.get(o.constructor))?n[r]=i(o,u):ArrayBuffer.isView(o)?n[r]=S(o):n[r]=u(o)}return n}function f(l){if(typeof l!="object"||l===null)return l;if(Array.isArray(l))return c(l,f);if(l.constructor!==Object&&(i=t.get(l.constructor)))return i(l,f);let n={};for(let r in l){let o=l[r];typeof o!="object"||o===null?n[r]=o:o.constructor!==Object&&(i=t.get(o.constructor))?n[r]=i(o,f):ArrayBuffer.isView(o)?n[r]=S(o):n[r]=f(o)}return n}}function me(e){let t=[],i=[],c=new Map;if(c.set(Date,r=>new Date(r)),c.set(Map,(r,o)=>new Map(f(Array.from(r),o))),c.set(Set,(r,o)=>new Set(f(Array.from(r),o))),e.constructorHandlers)for(let r of e.constructorHandlers)c.set(r[0],r[1]);let u=null;return e.proto?n:l;function f(r,o){let a=Object.keys(r),s=new Array(a.length);for(let p=0;p<a.length;p++){let d=a[p],g=r[d];if(typeof g!="object"||g===null)s[d]=g;else if(g.constructor!==Object&&(u=c.get(g.constructor)))s[d]=u(g,o);else if(ArrayBuffer.isView(g))s[d]=S(g);else{let E=t.indexOf(g);E!==-1?s[d]=i[E]:s[d]=o(g)}}return s}function l(r){if(typeof r!="object"||r===null)return r;if(Array.isArray(r))return f(r,l);if(r.constructor!==Object&&(u=c.get(r.constructor)))return u(r,l);let o={};t.push(r),i.push(o);for(let a in r){if(Object.hasOwnProperty.call(r,a)===!1)continue;let s=r[a];if(typeof s!="object"||s===null)o[a]=s;else if(s.constructor!==Object&&(u=c.get(s.constructor)))o[a]=u(s,l);else if(ArrayBuffer.isView(s))o[a]=S(s);else{let p=t.indexOf(s);p!==-1?o[a]=i[p]:o[a]=l(s)}}return t.pop(),i.pop(),o}function n(r){if(typeof r!="object"||r===null)return r;if(Array.isArray(r))return f(r,n);if(r.constructor!==Object&&(u=c.get(r.constructor)))return u(r,n);let o={};t.push(r),i.push(o);for(let a in r){let s=r[a];if(typeof s!="object"||s===null)o[a]=s;else if(s.constructor!==Object&&(u=c.get(s.constructor)))o[a]=u(s,n);else if(ArrayBuffer.isView(s))o[a]=S(s);else{let p=t.indexOf(s);p!==-1?o[a]=i[p]:o[a]=n(s)}}return t.pop(),i.pop(),o}}});var Ee={};ge(Ee,{compare:()=>B,defaults:()=>re,version:()=>Se});var A=x(H(),1);var z=x(T(),1);var q=x(T(),1);var De=(0,q.default)();function O(e){if(e==null||typeof e!="object")return!1;let t=Object.getPrototypeOf(e);return t!==null&&t!==Object.prototype&&Object.getPrototypeOf(t)!==null?!1:!(Symbol.iterator in e)&&!(Symbol.toStringTag in e)}function be(e){return typeof e=="string"}function U(e,t){return O(e)&&be(t)&&t in e}function M(e){if(e.includes(".")){let t=e.lastIndexOf(".");if(!e.slice(0,t).includes("."))return e.slice(0,t);for(let i=t-1;i--;)if(e[i]===".")return e.slice(i+1,t)}return null}var C=(0,z.default)();function G(e,t){let i={now:!1};function c(u,f,l,n){let r=C(u),o,a=b({depth:-1,path:""},l);if(a.depth+=1,Array.isArray(r))for(let s=0,p=r.length;s<p&&!n.now;s++){let d=a.path?"".concat(a.path,".").concat(s):"".concat(s);r[s]!==void 0?(a.parent=C(r),a.parentType="array",a.parentKey=M(d),o=c(f(r[s],void 0,w(b({},a),{path:d}),n),f,w(b({},a),{path:d}),n),Number.isNaN(o)&&s<r.length?(r.splice(s,1),s-=1):r[s]=o):r.splice(s,1)}else if(O(r))for(let s in r){if(n.now&&s!=null)break;let p=a.path?"".concat(a.path,".").concat(s):s;a.depth===0&&s!=null&&(a.topmostKey=s),a.parent=C(r),a.parentType="object",a.parentKey=M(p),o=c(f(s,r[s],w(b({},a),{path:p}),n),f,w(b({},a),{path:p}),n),Number.isNaN(o)?delete r[s]:r[s]=o}return r}return c(e,t,{},i)}function m(e){if(typeof e=="string")return!e.trim();if(!["object","string"].includes(typeof e)||!e)return!1;let t=!0;return e=G(e,(i,c,u,f)=>{let l=c!==void 0?c:i;return typeof l=="string"&&l.trim()&&(t=!1,f.now=!0),l}),t}function P(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}var W=new Map,Z=(e,t)=>{if(!Array.isArray(e))switch(typeof e){case"string":{e=[e];break}case"undefined":{e=[];break}default:throw new TypeError("Expected '".concat(t,"' to be a string or an array, but got a type of '").concat(typeof e,"'"))}return e.filter(i=>{if(typeof i!="string"){if(i===void 0)return!1;throw new TypeError("Expected '".concat(t,"' to be an array of strings, but found a type of '").concat(typeof i,"' in the array"))}return!0})},X,Y,ee,Oe=(e,t)=>{t=b({caseSensitive:!1},t);let i="s"+(t.caseSensitive?"":"i"),c=e+"|"+i;if(W.has(c))return W.get(c);let u=e[0]==="!";u&&(e=e.slice(1)),e=e.replaceAll(String.raw(X||(X=j(["*"],["\\*"]))),"__ESCAPED_STAR__").replaceAll("\\\\","__ESCAPED_BACKSLASH__").replaceAll(/\\(.)/g,"$1"),e=P(e).replaceAll(String.raw(Y||(Y=j(["*"],["\\*"]))),".*"),e=e.replaceAll("__ESCAPED_STAR__",String.raw(ee||(ee=j(["*"],["\\*"])))).replaceAll("__ESCAPED_BACKSLASH__","\\\\");let f=new RegExp("^".concat(e,"$"),i);return f.negated=u,W.set(c,f),f},Ae=(e,t,i,c)=>{if(e=Z(e,"inputs"),t=Z(t,"patterns"),t.length===0)return[];t=t.map(r=>Oe(r,i));let u=t.filter(r=>r.negated),f=t.filter(r=>!r.negated),{allPatterns:l}=i||{},n=[];if(l&&c&&u.length>1&&f.length===0){for(let r of e)for(let o of u)if(o.test(r))return[];return e.slice(0,1)}for(let r of e){let o=!1;for(let a of u)if(a.test(r)){o=!0;break}if(!o){if(f.length===0)n.push(r);else if(l){let a=Array.from({length:f.length},()=>!1);for(let[s,p]of f.entries())p.test(r)&&(a[s]=!0);a.every(Boolean)&&n.push(r)}else{let a=!1;for(let s of f)if(s.test(r)){a=!0;break}a&&n.push(r)}if(c&&n.length>0)break}}return n};function N(e,t,i){return Ae(e,t,i,!0).length>0}var te="4.1.0";var Se=te;function we(e){return O(e)?!Object.keys(e).length:Array.isArray(e)||typeof e=="string"?!e.length:!1}var re={hungryForWhitespace:!1,matchStrictly:!1,verboseWhenMismatches:!1,useWildcards:!1};function B(e,t,i){let c,u,f,l=0,n=b(b({},re),i);if(n.hungryForWhitespace&&n.matchStrictly&&O(e)&&m(e)&&O(t)&&!Object.keys(t).length)return!0;if((!n.hungryForWhitespace||n.hungryForWhitespace&&!m(e)&&m(t))&&O(e)&&Object.keys(e).length!==0&&O(t)&&Object.keys(t).length===0||(0,A.default)(e)!==(0,A.default)(t)&&(!n.hungryForWhitespace||n.hungryForWhitespace&&!m(e)))return!1;if(typeof e=="string"&&typeof t=="string")return n.hungryForWhitespace&&m(e)&&m(t)?!0:n.verboseWhenMismatches?e===t?!0:"Given string ".concat(t," is not matched! We have ").concat(e," on the other end."):n.useWildcards?N(e,t,{caseSensitive:!0}):e===t;if(Array.isArray(e)&&Array.isArray(t)){if(n.hungryForWhitespace&&m(t)&&(!n.matchStrictly||n.matchStrictly&&e.length===t.length))return!0;if(!n.hungryForWhitespace&&t.length>e.length||n.matchStrictly&&t.length!==e.length)return n.verboseWhenMismatches?"The length of a given array, ".concat(JSON.stringify(t,null,4)," is ").concat(t.length," but the length of an array on the other end, ").concat(JSON.stringify(e,null,4)," is ").concat(e.length):!1;if(t.length===0)return e.length===0?!0:n.verboseWhenMismatches?"The given array has no elements, but the array on the other end, ".concat(JSON.stringify(e,null,4)," does have some"):!1;for(let r=0,o=t.length;r<o;r++){f=!1;for(let a=l,s=e.length;a<s;a++)if(l+=1,B(e[a],t[r],n)===!0){f=!0;break}if(!f)return n.verboseWhenMismatches?"The given array ".concat(JSON.stringify(t,null,4)," is not a subset of an array on the other end, ").concat(JSON.stringify(e,null,4)):!1}}else if(O(e)&&O(t)){if(c=new Set(Object.keys(t)),u=new Set(Object.keys(e)),n.matchStrictly&&c.size!==u.size){if(!n.verboseWhenMismatches)return!1;let r=new Set([...c].filter(p=>!u.has(p))),o=r.size?" First object has unique keys: ".concat(JSON.stringify(r,null,4),"."):"",a=new Set([...u].filter(p=>!c.has(p))),s=a.size?" Second object has unique keys:\n ".concat(JSON.stringify(a,null,4),"."):"";return"When matching strictly, we found that both objects have different amount of keys.".concat(o).concat(s)}for(let r of c){if(!U(e,r))return!n.useWildcards||n.useWildcards&&!r.includes("*")?n.verboseWhenMismatches?'The given object has key "'.concat(r,'" which the other-one does not have.'):!1:Object.keys(e).some(o=>N(o,r,{caseSensitive:!0}))?!0:n.verboseWhenMismatches?'The given object has key "'.concat(r,'" which the other-one does not have.'):!1;if(e[r]!=null&&(0,A.default)(e[r])!==(0,A.default)(t[r])){if(!(m(e[r])&&m(t[r])&&n.hungryForWhitespace))return n.verboseWhenMismatches?"The given key ".concat(r," is of a different type on both objects. On the first-one, it's ").concat((0,A.default)(t[r]),", on the second-one, it's ").concat((0,A.default)(e[r])):!1}else if(B(e[r],t[r],n)!==!0)return n.verboseWhenMismatches?"The given piece ".concat(JSON.stringify(t[r],null,4)," and ").concat(JSON.stringify(e[r],null,4)," don't match."):!1}}else return n.hungryForWhitespace&&m(e)&&m(t)&&(!n.matchStrictly||n.matchStrictly&&we(t))?!0:e===t;return!0}return he(Ee);})();
|
|
11
11
|
/**
|
|
12
12
|
* @name codsen-utils
|
|
13
13
|
* @fileoverview Various utility functions
|
|
14
|
-
* @version 1.
|
|
14
|
+
* @version 1.7.0
|
|
15
15
|
* @author Roy Revelt
|
|
16
16
|
* @license MIT
|
|
17
17
|
* {@link https://codsen.com/os/codsen-utils/}
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
/**
|
|
20
20
|
* @name ast-monkey-util
|
|
21
21
|
* @fileoverview Utility library of AST helper functions
|
|
22
|
-
* @version 3.0
|
|
22
|
+
* @version 3.1.0
|
|
23
23
|
* @author Roy Revelt
|
|
24
24
|
* @license MIT
|
|
25
25
|
* {@link https://codsen.com/os/ast-monkey-util/}
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
/**
|
|
28
28
|
* @name ast-monkey-traverse
|
|
29
29
|
* @fileoverview Utility library to traverse AST
|
|
30
|
-
* @version 4.0
|
|
30
|
+
* @version 4.1.0
|
|
31
31
|
* @author Roy Revelt
|
|
32
32
|
* @license MIT
|
|
33
33
|
* {@link https://codsen.com/os/ast-monkey-traverse/}
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
/**
|
|
36
36
|
* @name ast-contains-only-empty-space
|
|
37
37
|
* @fileoverview Does AST contain only empty space?
|
|
38
|
-
* @version 4.0
|
|
38
|
+
* @version 4.1.0
|
|
39
39
|
* @author Roy Revelt
|
|
40
40
|
* @license MIT
|
|
41
41
|
* {@link https://codsen.com/os/ast-contains-only-empty-space/}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ast-compare",
|
|
3
|
-
"version": "4.0
|
|
3
|
+
"version": "4.1.0",
|
|
4
4
|
"description": "Compare anything: AST, objects, arrays, strings and nested thereof",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"array",
|
|
@@ -77,8 +77,8 @@
|
|
|
77
77
|
}
|
|
78
78
|
},
|
|
79
79
|
"dependencies": {
|
|
80
|
-
"ast-contains-only-empty-space": "^4.0
|
|
81
|
-
"codsen-utils": "^1.
|
|
80
|
+
"ast-contains-only-empty-space": "^4.1.0",
|
|
81
|
+
"codsen-utils": "^1.7.0",
|
|
82
82
|
"matcher": "^6.0.0",
|
|
83
83
|
"type-detect": "^4.1.0"
|
|
84
84
|
},
|