@colbymchenry/codegraph-win32-arm64 1.6.2 → 1.6.4
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/bin/codegraph +1 -1
- package/bin/codegraph.cmd +1 -1
- package/lib/dist/.test-build-engine.json +1 -1
- package/lib/dist/.test-build-viewer.json +1 -1
- package/lib/dist/bin/codegraph.d.ts +3 -0
- package/lib/dist/bin/codegraph.d.ts.map +1 -1
- package/lib/dist/bin/codegraph.js +507 -702
- package/lib/dist/bin/codegraph.js.map +1 -1
- package/lib/dist/bin/command-supervision.js +1 -57
- package/lib/dist/bin/command-supervision.js.map +1 -1
- package/lib/dist/bin/fatal-handler.js +0 -46
- package/lib/dist/bin/fatal-handler.js.map +1 -1
- package/lib/dist/bin/node-version-check.js +0 -33
- package/lib/dist/bin/node-version-check.js.map +1 -1
- package/lib/dist/bin/uninstall.js +0 -19
- package/lib/dist/bin/uninstall.js.map +1 -1
- package/lib/dist/bin/viewer-gate.js +0 -14
- package/lib/dist/bin/viewer-gate.js.map +1 -1
- package/lib/dist/compile-cache.d.ts +2 -0
- package/lib/dist/compile-cache.d.ts.map +1 -0
- package/lib/dist/compile-cache.js +45 -0
- package/lib/dist/compile-cache.js.map +1 -0
- package/lib/dist/context/formatter.js +3 -66
- package/lib/dist/context/formatter.js.map +1 -1
- package/lib/dist/context/index.d.ts +44 -1
- package/lib/dist/context/index.d.ts.map +1 -1
- package/lib/dist/context/index.js +123 -430
- package/lib/dist/context/index.js.map +1 -1
- package/lib/dist/context/markers.js +0 -17
- package/lib/dist/context/markers.js.map +1 -1
- package/lib/dist/db/index.d.ts +44 -1
- package/lib/dist/db/index.d.ts.map +1 -1
- package/lib/dist/db/index.js +123 -395
- package/lib/dist/db/index.js.map +1 -1
- package/lib/dist/db/migrations.d.ts +11 -1
- package/lib/dist/db/migrations.d.ts.map +1 -1
- package/lib/dist/db/migrations.js +71 -79
- package/lib/dist/db/migrations.js.map +1 -1
- package/lib/dist/db/name-substring-index.d.ts +63 -0
- package/lib/dist/db/name-substring-index.d.ts.map +1 -0
- package/lib/dist/db/name-substring-index.js +151 -0
- package/lib/dist/db/name-substring-index.js.map +1 -0
- package/lib/dist/db/node-sqlite.d.ts +19 -0
- package/lib/dist/db/node-sqlite.d.ts.map +1 -0
- package/lib/dist/db/node-sqlite.js +23 -0
- package/lib/dist/db/node-sqlite.js.map +1 -0
- package/lib/dist/db/open-error.d.ts +36 -0
- package/lib/dist/db/open-error.d.ts.map +1 -0
- package/lib/dist/db/open-error.js +63 -0
- package/lib/dist/db/open-error.js.map +1 -0
- package/lib/dist/db/parameter-flow-queries.d.ts +120 -0
- package/lib/dist/db/parameter-flow-queries.d.ts.map +1 -0
- package/lib/dist/db/parameter-flow-queries.js +168 -0
- package/lib/dist/db/parameter-flow-queries.js.map +1 -0
- package/lib/dist/db/queries.d.ts +654 -34
- package/lib/dist/db/queries.d.ts.map +1 -1
- package/lib/dist/db/queries.js +1466 -1470
- package/lib/dist/db/queries.js.map +1 -1
- package/lib/dist/db/reference-tail.d.ts +83 -0
- package/lib/dist/db/reference-tail.d.ts.map +1 -0
- package/lib/dist/db/reference-tail.js +68 -0
- package/lib/dist/db/reference-tail.js.map +1 -0
- package/lib/dist/db/schema.sql +18 -2
- package/lib/dist/db/sqlite-adapter.d.ts +18 -1
- package/lib/dist/db/sqlite-adapter.d.ts.map +1 -1
- package/lib/dist/db/sqlite-adapter.js +12 -62
- package/lib/dist/db/sqlite-adapter.js.map +1 -1
- package/lib/dist/db/synthesis-stage.d.ts.map +1 -1
- package/lib/dist/db/synthesis-stage.js +2 -6
- package/lib/dist/db/synthesis-stage.js.map +1 -1
- package/lib/dist/db/wal-valve.js +1 -153
- package/lib/dist/db/wal-valve.js.map +1 -1
- package/lib/dist/db/wsl-shared-index.js +0 -37
- package/lib/dist/db/wsl-shared-index.js.map +1 -1
- package/lib/dist/directory.d.ts +51 -0
- package/lib/dist/directory.d.ts.map +1 -1
- package/lib/dist/directory.js +76 -530
- package/lib/dist/directory.js.map +1 -1
- package/lib/dist/engine.d.ts +15 -0
- package/lib/dist/engine.d.ts.map +1 -0
- package/lib/dist/engine.js +35 -0
- package/lib/dist/engine.js.map +1 -0
- package/lib/dist/errors.d.ts +10 -0
- package/lib/dist/errors.d.ts.map +1 -1
- package/lib/dist/errors.js +8 -101
- package/lib/dist/errors.js.map +1 -1
- package/lib/dist/extraction/astro-extractor.d.ts.map +1 -1
- package/lib/dist/extraction/astro-extractor.js +11 -101
- package/lib/dist/extraction/astro-extractor.js.map +1 -1
- package/lib/dist/extraction/cfml-extractor.d.ts +27 -1
- package/lib/dist/extraction/cfml-extractor.d.ts.map +1 -1
- package/lib/dist/extraction/cfml-extractor.js +70 -206
- package/lib/dist/extraction/cfml-extractor.js.map +1 -1
- package/lib/dist/extraction/commonjs-requires.js +0 -31
- package/lib/dist/extraction/commonjs-requires.js.map +1 -1
- package/lib/dist/extraction/dfm-extractor.js +0 -21
- package/lib/dist/extraction/dfm-extractor.js.map +1 -1
- package/lib/dist/extraction/extraction-version.d.ts +1 -1
- package/lib/dist/extraction/extraction-version.js +1 -24
- package/lib/dist/extraction/extraction-version.js.map +1 -1
- package/lib/dist/extraction/function-ref.d.ts +40 -0
- package/lib/dist/extraction/function-ref.d.ts.map +1 -1
- package/lib/dist/extraction/function-ref.js +157 -207
- package/lib/dist/extraction/function-ref.js.map +1 -1
- package/lib/dist/extraction/generated-detection.js +0 -165
- package/lib/dist/extraction/generated-detection.js.map +1 -1
- package/lib/dist/extraction/grammars.d.ts +73 -4
- package/lib/dist/extraction/grammars.d.ts.map +1 -1
- package/lib/dist/extraction/grammars.js +160 -431
- package/lib/dist/extraction/grammars.js.map +1 -1
- package/lib/dist/extraction/index.d.ts +208 -7
- package/lib/dist/extraction/index.d.ts.map +1 -1
- package/lib/dist/extraction/index.js +594 -1383
- package/lib/dist/extraction/index.js.map +1 -1
- package/lib/dist/extraction/kernel/decode.js +0 -16
- package/lib/dist/extraction/kernel/decode.js.map +1 -1
- package/lib/dist/extraction/kernel/index.d.ts +3 -1
- package/lib/dist/extraction/kernel/index.d.ts.map +1 -1
- package/lib/dist/extraction/kernel/index.js +48 -135
- package/lib/dist/extraction/kernel/index.js.map +1 -1
- package/lib/dist/extraction/kernel/layout.js +42 -76
- package/lib/dist/extraction/kernel/layout.js.map +1 -1
- package/lib/dist/extraction/kernel/loader.d.ts +5 -1
- package/lib/dist/extraction/kernel/loader.d.ts.map +1 -1
- package/lib/dist/extraction/kernel/loader.js +0 -37
- package/lib/dist/extraction/kernel/loader.js.map +1 -1
- package/lib/dist/extraction/languages/arkts.js +0 -59
- package/lib/dist/extraction/languages/arkts.js.map +1 -1
- package/lib/dist/extraction/languages/c-cpp.d.ts +125 -28
- package/lib/dist/extraction/languages/c-cpp.d.ts.map +1 -1
- package/lib/dist/extraction/languages/c-cpp.js +789 -856
- package/lib/dist/extraction/languages/c-cpp.js.map +1 -1
- package/lib/dist/extraction/languages/cfquery.js +0 -9
- package/lib/dist/extraction/languages/cfquery.js.map +1 -1
- package/lib/dist/extraction/languages/cfscript.d.ts +20 -0
- package/lib/dist/extraction/languages/cfscript.d.ts.map +1 -1
- package/lib/dist/extraction/languages/cfscript.js +80 -9
- package/lib/dist/extraction/languages/cfscript.js.map +1 -1
- package/lib/dist/extraction/languages/cobol.js +0 -114
- package/lib/dist/extraction/languages/cobol.js.map +1 -1
- package/lib/dist/extraction/languages/cpp-brace-scopes.d.ts +66 -0
- package/lib/dist/extraction/languages/cpp-brace-scopes.d.ts.map +1 -0
- package/lib/dist/extraction/languages/cpp-brace-scopes.js +343 -0
- package/lib/dist/extraction/languages/cpp-brace-scopes.js.map +1 -0
- package/lib/dist/extraction/languages/cpp-macro-methods.d.ts +41 -0
- package/lib/dist/extraction/languages/cpp-macro-methods.d.ts.map +1 -0
- package/lib/dist/extraction/languages/cpp-macro-methods.js +487 -0
- package/lib/dist/extraction/languages/cpp-macro-methods.js.map +1 -0
- package/lib/dist/extraction/languages/csharp.js +3 -55
- package/lib/dist/extraction/languages/csharp.js.map +1 -1
- package/lib/dist/extraction/languages/dart.d.ts +129 -0
- package/lib/dist/extraction/languages/dart.d.ts.map +1 -1
- package/lib/dist/extraction/languages/dart.js +517 -162
- package/lib/dist/extraction/languages/dart.js.map +1 -1
- package/lib/dist/extraction/languages/erlang.d.ts.map +1 -1
- package/lib/dist/extraction/languages/erlang.js +15 -102
- package/lib/dist/extraction/languages/erlang.js.map +1 -1
- package/lib/dist/extraction/languages/go.d.ts +48 -0
- package/lib/dist/extraction/languages/go.d.ts.map +1 -1
- package/lib/dist/extraction/languages/go.js +102 -31
- package/lib/dist/extraction/languages/go.js.map +1 -1
- package/lib/dist/extraction/languages/index.js +0 -6
- package/lib/dist/extraction/languages/index.js.map +1 -1
- package/lib/dist/extraction/languages/java.d.ts.map +1 -1
- package/lib/dist/extraction/languages/java.js +67 -78
- package/lib/dist/extraction/languages/java.js.map +1 -1
- package/lib/dist/extraction/languages/javascript.d.ts.map +1 -1
- package/lib/dist/extraction/languages/javascript.js +2 -12
- package/lib/dist/extraction/languages/javascript.js.map +1 -1
- package/lib/dist/extraction/languages/kotlin.d.ts +11 -0
- package/lib/dist/extraction/languages/kotlin.d.ts.map +1 -1
- package/lib/dist/extraction/languages/kotlin.js +43 -197
- package/lib/dist/extraction/languages/kotlin.js.map +1 -1
- package/lib/dist/extraction/languages/lua.js +2 -39
- package/lib/dist/extraction/languages/lua.js.map +1 -1
- package/lib/dist/extraction/languages/luau.js +0 -14
- package/lib/dist/extraction/languages/luau.js.map +1 -1
- package/lib/dist/extraction/languages/nix.js +0 -16
- package/lib/dist/extraction/languages/nix.js.map +1 -1
- package/lib/dist/extraction/languages/objc.d.ts.map +1 -1
- package/lib/dist/extraction/languages/objc.js +5 -16
- package/lib/dist/extraction/languages/objc.js.map +1 -1
- package/lib/dist/extraction/languages/pascal-preparse.d.ts +66 -0
- package/lib/dist/extraction/languages/pascal-preparse.d.ts.map +1 -0
- package/lib/dist/extraction/languages/pascal-preparse.js +958 -0
- package/lib/dist/extraction/languages/pascal-preparse.js.map +1 -0
- package/lib/dist/extraction/languages/pascal-system.d.ts +11 -0
- package/lib/dist/extraction/languages/pascal-system.d.ts.map +1 -0
- package/lib/dist/extraction/languages/pascal-system.js +23 -0
- package/lib/dist/extraction/languages/pascal-system.js.map +1 -0
- package/lib/dist/extraction/languages/pascal.d.ts.map +1 -1
- package/lib/dist/extraction/languages/pascal.js +3 -4
- package/lib/dist/extraction/languages/pascal.js.map +1 -1
- package/lib/dist/extraction/languages/php.d.ts +9 -0
- package/lib/dist/extraction/languages/php.d.ts.map +1 -1
- package/lib/dist/extraction/languages/php.js +207 -44
- package/lib/dist/extraction/languages/php.js.map +1 -1
- package/lib/dist/extraction/languages/python.js +2 -20
- package/lib/dist/extraction/languages/python.js.map +1 -1
- package/lib/dist/extraction/languages/r.js +8 -78
- package/lib/dist/extraction/languages/r.js.map +1 -1
- package/lib/dist/extraction/languages/ruby.d.ts.map +1 -1
- package/lib/dist/extraction/languages/ruby.js +17 -25
- package/lib/dist/extraction/languages/ruby.js.map +1 -1
- package/lib/dist/extraction/languages/rust-macro-calls.d.ts +32 -0
- package/lib/dist/extraction/languages/rust-macro-calls.d.ts.map +1 -0
- package/lib/dist/extraction/languages/rust-macro-calls.js +306 -0
- package/lib/dist/extraction/languages/rust-macro-calls.js.map +1 -0
- package/lib/dist/extraction/languages/rust.d.ts +10 -0
- package/lib/dist/extraction/languages/rust.d.ts.map +1 -1
- package/lib/dist/extraction/languages/rust.js +15 -47
- package/lib/dist/extraction/languages/rust.js.map +1 -1
- package/lib/dist/extraction/languages/scala.js +5 -41
- package/lib/dist/extraction/languages/scala.js.map +1 -1
- package/lib/dist/extraction/languages/solidity.js +1 -82
- package/lib/dist/extraction/languages/solidity.js.map +1 -1
- package/lib/dist/extraction/languages/swift.js +3 -47
- package/lib/dist/extraction/languages/swift.js.map +1 -1
- package/lib/dist/extraction/languages/terraform.js +6 -152
- package/lib/dist/extraction/languages/terraform.js.map +1 -1
- package/lib/dist/extraction/languages/typescript.d.ts +64 -0
- package/lib/dist/extraction/languages/typescript.d.ts.map +1 -1
- package/lib/dist/extraction/languages/typescript.js +73 -49
- package/lib/dist/extraction/languages/typescript.js.map +1 -1
- package/lib/dist/extraction/languages/vbnet.d.ts.map +1 -1
- package/lib/dist/extraction/languages/vbnet.js +9 -42
- package/lib/dist/extraction/languages/vbnet.js.map +1 -1
- package/lib/dist/extraction/lazy-frameworks.d.ts +15 -0
- package/lib/dist/extraction/lazy-frameworks.d.ts.map +1 -0
- package/lib/dist/extraction/lazy-frameworks.js +8 -0
- package/lib/dist/extraction/lazy-frameworks.js.map +1 -0
- package/lib/dist/extraction/liquid-extractor.d.ts +29 -3
- package/lib/dist/extraction/liquid-extractor.d.ts.map +1 -1
- package/lib/dist/extraction/liquid-extractor.js +89 -148
- package/lib/dist/extraction/liquid-extractor.js.map +1 -1
- package/lib/dist/extraction/mybatis-extractor.js +0 -78
- package/lib/dist/extraction/mybatis-extractor.js.map +1 -1
- package/lib/dist/extraction/parse-budget.d.ts +42 -7
- package/lib/dist/extraction/parse-budget.d.ts.map +1 -1
- package/lib/dist/extraction/parse-budget.js +39 -15
- package/lib/dist/extraction/parse-budget.js.map +1 -1
- package/lib/dist/extraction/parse-pool.d.ts +29 -17
- package/lib/dist/extraction/parse-pool.d.ts.map +1 -1
- package/lib/dist/extraction/parse-pool.js +49 -193
- package/lib/dist/extraction/parse-pool.js.map +1 -1
- package/lib/dist/extraction/parse-worker.d.ts +1 -1
- package/lib/dist/extraction/parse-worker.d.ts.map +1 -1
- package/lib/dist/extraction/parse-worker.js +5 -58
- package/lib/dist/extraction/parse-worker.js.map +1 -1
- package/lib/dist/extraction/razor-extractor.d.ts +9 -0
- package/lib/dist/extraction/razor-extractor.d.ts.map +1 -1
- package/lib/dist/extraction/razor-extractor.js +45 -69
- package/lib/dist/extraction/razor-extractor.js.map +1 -1
- package/lib/dist/extraction/razor-script.d.ts +23 -0
- package/lib/dist/extraction/razor-script.d.ts.map +1 -0
- package/lib/dist/extraction/razor-script.js +244 -0
- package/lib/dist/extraction/razor-script.js.map +1 -0
- package/lib/dist/extraction/sfc-script.d.ts +42 -0
- package/lib/dist/extraction/sfc-script.d.ts.map +1 -1
- package/lib/dist/extraction/sfc-script.js +32 -31
- package/lib/dist/extraction/sfc-script.js.map +1 -1
- package/lib/dist/extraction/store-worker.d.ts +1 -1
- package/lib/dist/extraction/store-worker.d.ts.map +1 -1
- package/lib/dist/extraction/store-worker.js +1 -38
- package/lib/dist/extraction/store-worker.js.map +1 -1
- package/lib/dist/extraction/store-writer.js +2 -34
- package/lib/dist/extraction/store-writer.js.map +1 -1
- package/lib/dist/extraction/svelte-extractor.d.ts.map +1 -1
- package/lib/dist/extraction/svelte-extractor.js +11 -87
- package/lib/dist/extraction/svelte-extractor.js.map +1 -1
- package/lib/dist/extraction/syntax-tokens.d.ts +6 -5
- package/lib/dist/extraction/syntax-tokens.d.ts.map +1 -1
- package/lib/dist/extraction/syntax-tokens.js +4 -152
- package/lib/dist/extraction/syntax-tokens.js.map +1 -1
- package/lib/dist/extraction/tree-sitter-helpers.d.ts +37 -1
- package/lib/dist/extraction/tree-sitter-helpers.d.ts.map +1 -1
- package/lib/dist/extraction/tree-sitter-helpers.js +76 -68
- package/lib/dist/extraction/tree-sitter-helpers.js.map +1 -1
- package/lib/dist/extraction/tree-sitter-types.d.ts +102 -22
- package/lib/dist/extraction/tree-sitter-types.d.ts.map +1 -1
- package/lib/dist/extraction/tree-sitter-types.js +0 -7
- package/lib/dist/extraction/tree-sitter-types.js.map +1 -1
- package/lib/dist/extraction/tree-sitter.d.ts +518 -10
- package/lib/dist/extraction/tree-sitter.d.ts.map +1 -1
- package/lib/dist/extraction/tree-sitter.js +2118 -2554
- package/lib/dist/extraction/tree-sitter.js.map +1 -1
- package/lib/dist/extraction/vue-extractor.d.ts +13 -0
- package/lib/dist/extraction/vue-extractor.d.ts.map +1 -1
- package/lib/dist/extraction/vue-extractor.js +52 -92
- package/lib/dist/extraction/vue-extractor.js.map +1 -1
- package/lib/dist/extraction/vue-options-api.js +0 -32
- package/lib/dist/extraction/vue-options-api.js.map +1 -1
- package/lib/dist/extraction/vue-template-calls.d.ts +37 -0
- package/lib/dist/extraction/vue-template-calls.d.ts.map +1 -0
- package/lib/dist/extraction/vue-template-calls.js +497 -0
- package/lib/dist/extraction/vue-template-calls.js.map +1 -0
- package/lib/dist/extraction/wasm/tree-sitter-dart.wasm +0 -0
- package/lib/dist/extraction/wasm/tree-sitter-kotlin.wasm +0 -0
- package/lib/dist/extraction/wasm/tree-sitter-swift.wasm +0 -0
- package/lib/dist/extraction/wasm/tree-sitter-vbnet.wasm +0 -0
- package/lib/dist/extraction/wasm-runtime-flags.d.ts +15 -0
- package/lib/dist/extraction/wasm-runtime-flags.d.ts.map +1 -1
- package/lib/dist/extraction/wasm-runtime-flags.js +18 -89
- package/lib/dist/extraction/wasm-runtime-flags.js.map +1 -1
- package/lib/dist/file-limits.d.ts +8 -0
- package/lib/dist/file-limits.d.ts.map +1 -1
- package/lib/dist/file-limits.js +13 -28
- package/lib/dist/file-limits.js.map +1 -1
- package/lib/dist/graph/branch-guards.d.ts.map +1 -1
- package/lib/dist/graph/branch-guards.js +4 -251
- package/lib/dist/graph/branch-guards.js.map +1 -1
- package/lib/dist/graph/call-sites.d.ts +12 -0
- package/lib/dist/graph/call-sites.d.ts.map +1 -0
- package/lib/dist/graph/call-sites.js +17 -0
- package/lib/dist/graph/call-sites.js.map +1 -0
- package/lib/dist/graph/cobol-copybooks.d.ts +75 -0
- package/lib/dist/graph/cobol-copybooks.d.ts.map +1 -0
- package/lib/dist/graph/cobol-copybooks.js +45 -0
- package/lib/dist/graph/cobol-copybooks.js.map +1 -0
- package/lib/dist/graph/dead-code.d.ts +26 -4
- package/lib/dist/graph/dead-code.d.ts.map +1 -1
- package/lib/dist/graph/dead-code.js +157 -311
- package/lib/dist/graph/dead-code.js.map +1 -1
- package/lib/dist/graph/dynamic-boundary-report.js +1 -88
- package/lib/dist/graph/dynamic-boundary-report.js.map +1 -1
- package/lib/dist/graph/file-cycles.d.ts +20 -0
- package/lib/dist/graph/file-cycles.d.ts.map +1 -0
- package/lib/dist/graph/file-cycles.js +79 -0
- package/lib/dist/graph/file-cycles.js.map +1 -0
- package/lib/dist/graph/file-drift.d.ts +35 -0
- package/lib/dist/graph/file-drift.d.ts.map +1 -0
- package/lib/dist/graph/file-drift.js +46 -0
- package/lib/dist/graph/file-drift.js.map +1 -0
- package/lib/dist/graph/go-package.d.ts +27 -0
- package/lib/dist/graph/go-package.d.ts.map +1 -0
- package/lib/dist/graph/go-package.js +49 -0
- package/lib/dist/graph/go-package.js.map +1 -0
- package/lib/dist/graph/index.d.ts +2 -0
- package/lib/dist/graph/index.d.ts.map +1 -1
- package/lib/dist/graph/index.js +4 -6
- package/lib/dist/graph/index.js.map +1 -1
- package/lib/dist/graph/named-symbol-flow.d.ts +5 -1
- package/lib/dist/graph/named-symbol-flow.d.ts.map +1 -1
- package/lib/dist/graph/named-symbol-flow.js +82 -223
- package/lib/dist/graph/named-symbol-flow.js.map +1 -1
- package/lib/dist/graph/owning-package.d.ts +59 -0
- package/lib/dist/graph/owning-package.d.ts.map +1 -0
- package/lib/dist/graph/owning-package.js +120 -0
- package/lib/dist/graph/owning-package.js.map +1 -0
- package/lib/dist/graph/queries.d.ts +6 -3
- package/lib/dist/graph/queries.d.ts.map +1 -1
- package/lib/dist/graph/queries.js +4 -137
- package/lib/dist/graph/queries.js.map +1 -1
- package/lib/dist/graph/symbol-lookup.d.ts +15 -3
- package/lib/dist/graph/symbol-lookup.d.ts.map +1 -1
- package/lib/dist/graph/symbol-lookup.js +47 -89
- package/lib/dist/graph/symbol-lookup.js.map +1 -1
- package/lib/dist/graph/symbol-references.d.ts +86 -0
- package/lib/dist/graph/symbol-references.d.ts.map +1 -0
- package/lib/dist/graph/symbol-references.js +304 -0
- package/lib/dist/graph/symbol-references.js.map +1 -0
- package/lib/dist/graph/synthesized-hop.d.ts +37 -0
- package/lib/dist/graph/synthesized-hop.d.ts.map +1 -0
- package/lib/dist/graph/synthesized-hop.js +62 -0
- package/lib/dist/graph/synthesized-hop.js.map +1 -0
- package/lib/dist/graph/test-code.d.ts +33 -0
- package/lib/dist/graph/test-code.d.ts.map +1 -0
- package/lib/dist/graph/test-code.js +104 -0
- package/lib/dist/graph/test-code.js.map +1 -0
- package/lib/dist/graph/traversal.d.ts +31 -2
- package/lib/dist/graph/traversal.d.ts.map +1 -1
- package/lib/dist/graph/traversal.js +96 -226
- package/lib/dist/graph/traversal.js.map +1 -1
- package/lib/dist/graph/type-hierarchy.js +0 -138
- package/lib/dist/graph/type-hierarchy.js.map +1 -1
- package/lib/dist/index.d.ts +214 -26
- package/lib/dist/index.d.ts.map +1 -1
- package/lib/dist/index.js +736 -1112
- package/lib/dist/index.js.map +1 -1
- package/lib/dist/installer/beta-signup.js +0 -39
- package/lib/dist/installer/beta-signup.js.map +1 -1
- package/lib/dist/installer/config-writer.js +0 -24
- package/lib/dist/installer/config-writer.js.map +1 -1
- package/lib/dist/installer/index.d.ts +13 -6
- package/lib/dist/installer/index.d.ts.map +1 -1
- package/lib/dist/installer/index.js +27 -160
- package/lib/dist/installer/index.js.map +1 -1
- package/lib/dist/installer/instructions-template.d.ts +16 -1
- package/lib/dist/installer/instructions-template.d.ts.map +1 -1
- package/lib/dist/installer/instructions-template.js +10 -38
- package/lib/dist/installer/instructions-template.js.map +1 -1
- package/lib/dist/installer/targets/antigravity.js +0 -113
- package/lib/dist/installer/targets/antigravity.js.map +1 -1
- package/lib/dist/installer/targets/bob.d.ts +20 -0
- package/lib/dist/installer/targets/bob.d.ts.map +1 -0
- package/lib/dist/installer/targets/bob.js +83 -0
- package/lib/dist/installer/targets/bob.js.map +1 -0
- package/lib/dist/installer/targets/claude.d.ts.map +1 -1
- package/lib/dist/installer/targets/claude.js +1 -185
- package/lib/dist/installer/targets/claude.js.map +1 -1
- package/lib/dist/installer/targets/codex.d.ts.map +1 -1
- package/lib/dist/installer/targets/codex.js +17 -109
- package/lib/dist/installer/targets/codex.js.map +1 -1
- package/lib/dist/installer/targets/copilot-cli.d.ts.map +1 -1
- package/lib/dist/installer/targets/copilot-cli.js +2 -54
- package/lib/dist/installer/targets/copilot-cli.js.map +1 -1
- package/lib/dist/installer/targets/copilot-jetbrains.js +0 -57
- package/lib/dist/installer/targets/copilot-jetbrains.js.map +1 -1
- package/lib/dist/installer/targets/copilot-vscode.js +0 -58
- package/lib/dist/installer/targets/copilot-vscode.js.map +1 -1
- package/lib/dist/installer/targets/cursor.js +7 -88
- package/lib/dist/installer/targets/cursor.js.map +1 -1
- package/lib/dist/installer/targets/droid.d.ts +18 -0
- package/lib/dist/installer/targets/droid.d.ts.map +1 -0
- package/lib/dist/installer/targets/droid.js +92 -0
- package/lib/dist/installer/targets/droid.js.map +1 -0
- package/lib/dist/installer/targets/dsh.d.ts +35 -0
- package/lib/dist/installer/targets/dsh.d.ts.map +1 -0
- package/lib/dist/installer/targets/dsh.js +267 -0
- package/lib/dist/installer/targets/dsh.js.map +1 -0
- package/lib/dist/installer/targets/gemini.js +0 -37
- package/lib/dist/installer/targets/gemini.js.map +1 -1
- package/lib/dist/installer/targets/grok.d.ts +25 -0
- package/lib/dist/installer/targets/grok.d.ts.map +1 -0
- package/lib/dist/installer/targets/grok.js +96 -0
- package/lib/dist/installer/targets/grok.js.map +1 -0
- package/lib/dist/installer/targets/hermes.d.ts +19 -7
- package/lib/dist/installer/targets/hermes.d.ts.map +1 -1
- package/lib/dist/installer/targets/hermes.js +218 -214
- package/lib/dist/installer/targets/hermes.js.map +1 -1
- package/lib/dist/installer/targets/json-config.d.ts +45 -0
- package/lib/dist/installer/targets/json-config.d.ts.map +1 -0
- package/lib/dist/installer/targets/json-config.js +128 -0
- package/lib/dist/installer/targets/json-config.js.map +1 -0
- package/lib/dist/installer/targets/kimi.d.ts +21 -0
- package/lib/dist/installer/targets/kimi.d.ts.map +1 -0
- package/lib/dist/installer/targets/kimi.js +97 -0
- package/lib/dist/installer/targets/kimi.js.map +1 -0
- package/lib/dist/installer/targets/kiro.js +1 -41
- package/lib/dist/installer/targets/kiro.js.map +1 -1
- package/lib/dist/installer/targets/opencode.d.ts.map +1 -1
- package/lib/dist/installer/targets/opencode.js +1 -103
- package/lib/dist/installer/targets/opencode.js.map +1 -1
- package/lib/dist/installer/targets/pi.d.ts +24 -0
- package/lib/dist/installer/targets/pi.d.ts.map +1 -0
- package/lib/dist/installer/targets/pi.js +100 -0
- package/lib/dist/installer/targets/pi.js.map +1 -0
- package/lib/dist/installer/targets/qoder.d.ts +23 -0
- package/lib/dist/installer/targets/qoder.d.ts.map +1 -0
- package/lib/dist/installer/targets/qoder.js +83 -0
- package/lib/dist/installer/targets/qoder.js.map +1 -0
- package/lib/dist/installer/targets/qwen.d.ts +21 -0
- package/lib/dist/installer/targets/qwen.d.ts.map +1 -0
- package/lib/dist/installer/targets/qwen.js +115 -0
- package/lib/dist/installer/targets/qwen.js.map +1 -0
- package/lib/dist/installer/targets/registry.d.ts.map +1 -1
- package/lib/dist/installer/targets/registry.js +18 -25
- package/lib/dist/installer/targets/registry.js.map +1 -1
- package/lib/dist/installer/targets/shared.d.ts +83 -13
- package/lib/dist/installer/targets/shared.d.ts.map +1 -1
- package/lib/dist/installer/targets/shared.js +201 -131
- package/lib/dist/installer/targets/shared.js.map +1 -1
- package/lib/dist/installer/targets/toml.d.ts +82 -6
- package/lib/dist/installer/targets/toml.d.ts.map +1 -1
- package/lib/dist/installer/targets/toml.js +318 -112
- package/lib/dist/installer/targets/toml.js.map +1 -1
- package/lib/dist/installer/targets/types.d.ts +1 -1
- package/lib/dist/installer/targets/types.d.ts.map +1 -1
- package/lib/dist/installer/targets/types.js +0 -13
- package/lib/dist/installer/targets/types.js.map +1 -1
- package/lib/dist/installer/targets/windsurf.d.ts +22 -0
- package/lib/dist/installer/targets/windsurf.d.ts.map +1 -0
- package/lib/dist/installer/targets/windsurf.js +90 -0
- package/lib/dist/installer/targets/windsurf.js.map +1 -0
- package/lib/dist/lazy-engine.d.ts +22 -0
- package/lib/dist/lazy-engine.d.ts.map +1 -0
- package/lib/dist/lazy-engine.js +16 -0
- package/lib/dist/lazy-engine.js.map +1 -0
- package/lib/dist/mcp/answer-freshness.js +0 -6
- package/lib/dist/mcp/answer-freshness.js.map +1 -1
- package/lib/dist/mcp/daemon-manager.js +2 -23
- package/lib/dist/mcp/daemon-manager.js.map +1 -1
- package/lib/dist/mcp/daemon-paths.d.ts +2 -0
- package/lib/dist/mcp/daemon-paths.d.ts.map +1 -1
- package/lib/dist/mcp/daemon-paths.js +9 -85
- package/lib/dist/mcp/daemon-paths.js.map +1 -1
- package/lib/dist/mcp/daemon-proof.d.ts +19 -0
- package/lib/dist/mcp/daemon-proof.d.ts.map +1 -0
- package/lib/dist/mcp/daemon-proof.js +126 -0
- package/lib/dist/mcp/daemon-proof.js.map +1 -0
- package/lib/dist/mcp/daemon-registry.d.ts +47 -2
- package/lib/dist/mcp/daemon-registry.d.ts.map +1 -1
- package/lib/dist/mcp/daemon-registry.js +188 -139
- package/lib/dist/mcp/daemon-registry.js.map +1 -1
- package/lib/dist/mcp/daemon.d.ts +69 -0
- package/lib/dist/mcp/daemon.d.ts.map +1 -1
- package/lib/dist/mcp/daemon.js +186 -376
- package/lib/dist/mcp/daemon.js.map +1 -1
- package/lib/dist/mcp/dynamic-boundaries.js +4 -78
- package/lib/dist/mcp/dynamic-boundaries.js.map +1 -1
- package/lib/dist/mcp/early-ppid.js +0 -24
- package/lib/dist/mcp/early-ppid.js.map +1 -1
- package/lib/dist/mcp/engine.d.ts +24 -0
- package/lib/dist/mcp/engine.d.ts.map +1 -1
- package/lib/dist/mcp/engine.js +47 -152
- package/lib/dist/mcp/engine.js.map +1 -1
- package/lib/dist/mcp/explore-dedup.js +0 -108
- package/lib/dist/mcp/explore-dedup.js.map +1 -1
- package/lib/dist/mcp/explore-diagnostics.d.ts +6 -0
- package/lib/dist/mcp/explore-diagnostics.d.ts.map +1 -1
- package/lib/dist/mcp/explore-diagnostics.js +8 -116
- package/lib/dist/mcp/explore-diagnostics.js.map +1 -1
- package/lib/dist/mcp/explore-one-symbol.d.ts +77 -0
- package/lib/dist/mcp/explore-one-symbol.d.ts.map +1 -0
- package/lib/dist/mcp/explore-one-symbol.js +431 -0
- package/lib/dist/mcp/explore-one-symbol.js.map +1 -0
- package/lib/dist/mcp/explore-session-state.js +0 -129
- package/lib/dist/mcp/explore-session-state.js.map +1 -1
- package/lib/dist/mcp/hook-client.d.ts +44 -0
- package/lib/dist/mcp/hook-client.d.ts.map +1 -0
- package/lib/dist/mcp/hook-client.js +202 -0
- package/lib/dist/mcp/hook-client.js.map +1 -0
- package/lib/dist/mcp/index-freshness-worker.js +1 -6
- package/lib/dist/mcp/index-freshness-worker.js.map +1 -1
- package/lib/dist/mcp/index-freshness.js +0 -15
- package/lib/dist/mcp/index-freshness.js.map +1 -1
- package/lib/dist/mcp/index-version-warning.d.ts +21 -0
- package/lib/dist/mcp/index-version-warning.d.ts.map +1 -0
- package/lib/dist/mcp/index-version-warning.js +38 -0
- package/lib/dist/mcp/index-version-warning.js.map +1 -0
- package/lib/dist/mcp/index.d.ts +29 -1
- package/lib/dist/mcp/index.d.ts.map +1 -1
- package/lib/dist/mcp/index.js +131 -300
- package/lib/dist/mcp/index.js.map +1 -1
- package/lib/dist/mcp/liveness-watchdog.d.ts +13 -3
- package/lib/dist/mcp/liveness-watchdog.d.ts.map +1 -1
- package/lib/dist/mcp/liveness-watchdog.js +106 -121
- package/lib/dist/mcp/liveness-watchdog.js.map +1 -1
- package/lib/dist/mcp/opencode-tool-names.d.ts +32 -0
- package/lib/dist/mcp/opencode-tool-names.d.ts.map +1 -0
- package/lib/dist/mcp/opencode-tool-names.js +24 -0
- package/lib/dist/mcp/opencode-tool-names.js.map +1 -0
- package/lib/dist/mcp/ppid-watchdog.js +0 -24
- package/lib/dist/mcp/ppid-watchdog.js.map +1 -1
- package/lib/dist/mcp/process-identity.d.ts +42 -0
- package/lib/dist/mcp/process-identity.d.ts.map +1 -0
- package/lib/dist/mcp/process-identity.js +130 -0
- package/lib/dist/mcp/process-identity.js.map +1 -0
- package/lib/dist/mcp/project-lifecycle.d.ts +6 -0
- package/lib/dist/mcp/project-lifecycle.d.ts.map +1 -1
- package/lib/dist/mcp/project-lifecycle.js +70 -19
- package/lib/dist/mcp/project-lifecycle.js.map +1 -1
- package/lib/dist/mcp/prompt-explore.d.ts +19 -0
- package/lib/dist/mcp/prompt-explore.d.ts.map +1 -0
- package/lib/dist/mcp/prompt-explore.js +6 -0
- package/lib/dist/mcp/prompt-explore.js.map +1 -0
- package/lib/dist/mcp/proxy.d.ts +25 -7
- package/lib/dist/mcp/proxy.d.ts.map +1 -1
- package/lib/dist/mcp/proxy.js +145 -274
- package/lib/dist/mcp/proxy.js.map +1 -1
- package/lib/dist/mcp/query-pool.d.ts +52 -3
- package/lib/dist/mcp/query-pool.d.ts.map +1 -1
- package/lib/dist/mcp/query-pool.js +114 -123
- package/lib/dist/mcp/query-pool.js.map +1 -1
- package/lib/dist/mcp/query-worker.js +24 -36
- package/lib/dist/mcp/query-worker.js.map +1 -1
- package/lib/dist/mcp/server-instructions.d.ts +18 -0
- package/lib/dist/mcp/server-instructions.d.ts.map +1 -1
- package/lib/dist/mcp/server-instructions.js +12 -32
- package/lib/dist/mcp/server-instructions.js.map +1 -1
- package/lib/dist/mcp/session.d.ts +46 -0
- package/lib/dist/mcp/session.d.ts.map +1 -1
- package/lib/dist/mcp/session.js +70 -132
- package/lib/dist/mcp/session.js.map +1 -1
- package/lib/dist/mcp/startup-handshake.js +1 -48
- package/lib/dist/mcp/startup-handshake.js.map +1 -1
- package/lib/dist/mcp/stdin-teardown.js +0 -28
- package/lib/dist/mcp/stdin-teardown.js.map +1 -1
- package/lib/dist/mcp/stdout-teardown.d.ts +26 -0
- package/lib/dist/mcp/stdout-teardown.d.ts.map +1 -0
- package/lib/dist/mcp/stdout-teardown.js +20 -0
- package/lib/dist/mcp/stdout-teardown.js.map +1 -0
- package/lib/dist/mcp/tools.d.ts +157 -18
- package/lib/dist/mcp/tools.d.ts.map +1 -1
- package/lib/dist/mcp/tools.js +797 -3621
- package/lib/dist/mcp/tools.js.map +1 -1
- package/lib/dist/mcp/transport.d.ts.map +1 -1
- package/lib/dist/mcp/transport.js +4 -96
- package/lib/dist/mcp/transport.js.map +1 -1
- package/lib/dist/mcp/version.d.ts +13 -1
- package/lib/dist/mcp/version.d.ts.map +1 -1
- package/lib/dist/mcp/version.js +19 -21
- package/lib/dist/mcp/version.js.map +1 -1
- package/lib/dist/mcp/writer-lock.d.ts +11 -0
- package/lib/dist/mcp/writer-lock.d.ts.map +1 -1
- package/lib/dist/mcp/writer-lock.js +49 -46
- package/lib/dist/mcp/writer-lock.js.map +1 -1
- package/lib/dist/project-config.d.ts +20 -0
- package/lib/dist/project-config.d.ts.map +1 -1
- package/lib/dist/project-config.js +31 -140
- package/lib/dist/project-config.js.map +1 -1
- package/lib/dist/resolution/alias-binding.d.ts +7 -0
- package/lib/dist/resolution/alias-binding.d.ts.map +1 -1
- package/lib/dist/resolution/alias-binding.js +7 -56
- package/lib/dist/resolution/alias-binding.js.map +1 -1
- package/lib/dist/resolution/ambient-modules.d.ts +185 -0
- package/lib/dist/resolution/ambient-modules.d.ts.map +1 -0
- package/lib/dist/resolution/ambient-modules.js +732 -0
- package/lib/dist/resolution/ambient-modules.js.map +1 -0
- package/lib/dist/resolution/angular-template-synthesizer.d.ts +48 -1
- package/lib/dist/resolution/angular-template-synthesizer.d.ts.map +1 -1
- package/lib/dist/resolution/angular-template-synthesizer.js +401 -65
- package/lib/dist/resolution/angular-template-synthesizer.js.map +1 -1
- package/lib/dist/resolution/c-feature-variants.d.ts +40 -0
- package/lib/dist/resolution/c-feature-variants.d.ts.map +1 -0
- package/lib/dist/resolution/c-feature-variants.js +249 -0
- package/lib/dist/resolution/c-feature-variants.js.map +1 -0
- package/lib/dist/resolution/c-fnptr-synthesizer.d.ts.map +1 -1
- package/lib/dist/resolution/c-fnptr-synthesizer.js +23 -391
- package/lib/dist/resolution/c-fnptr-synthesizer.js.map +1 -1
- package/lib/dist/resolution/c-macro-renames.d.ts +25 -0
- package/lib/dist/resolution/c-macro-renames.d.ts.map +1 -0
- package/lib/dist/resolution/c-macro-renames.js +95 -0
- package/lib/dist/resolution/c-macro-renames.js.map +1 -0
- package/lib/dist/resolution/callback-synthesizer.d.ts +19 -5
- package/lib/dist/resolution/callback-synthesizer.d.ts.map +1 -1
- package/lib/dist/resolution/callback-synthesizer.js +1395 -1343
- package/lib/dist/resolution/callback-synthesizer.js.map +1 -1
- package/lib/dist/resolution/const-alias-synthesizer.d.ts +48 -0
- package/lib/dist/resolution/const-alias-synthesizer.d.ts.map +1 -0
- package/lib/dist/resolution/const-alias-synthesizer.js +234 -0
- package/lib/dist/resolution/const-alias-synthesizer.js.map +1 -0
- package/lib/dist/resolution/cooperative-yield.js +0 -27
- package/lib/dist/resolution/cooperative-yield.js.map +1 -1
- package/lib/dist/resolution/cpp-constructor.d.ts.map +1 -1
- package/lib/dist/resolution/cpp-constructor.js +15 -17
- package/lib/dist/resolution/cpp-constructor.js.map +1 -1
- package/lib/dist/resolution/cpp-includers.d.ts +46 -0
- package/lib/dist/resolution/cpp-includers.d.ts.map +1 -0
- package/lib/dist/resolution/cpp-includers.js +153 -0
- package/lib/dist/resolution/cpp-includers.js.map +1 -0
- package/lib/dist/resolution/cpp-macro-visibility.d.ts +16 -0
- package/lib/dist/resolution/cpp-macro-visibility.d.ts.map +1 -1
- package/lib/dist/resolution/cpp-macro-visibility.js +17 -68
- package/lib/dist/resolution/cpp-macro-visibility.js.map +1 -1
- package/lib/dist/resolution/cpp-namespaces.d.ts +54 -0
- package/lib/dist/resolution/cpp-namespaces.d.ts.map +1 -0
- package/lib/dist/resolution/cpp-namespaces.js +151 -0
- package/lib/dist/resolution/cpp-namespaces.js.map +1 -0
- package/lib/dist/resolution/cpp-raw-strings.d.ts +33 -0
- package/lib/dist/resolution/cpp-raw-strings.d.ts.map +1 -0
- package/lib/dist/resolution/cpp-raw-strings.js +167 -0
- package/lib/dist/resolution/cpp-raw-strings.js.map +1 -0
- package/lib/dist/resolution/cpp-supertypes.d.ts +118 -0
- package/lib/dist/resolution/cpp-supertypes.d.ts.map +1 -0
- package/lib/dist/resolution/cpp-supertypes.js +322 -0
- package/lib/dist/resolution/cpp-supertypes.js.map +1 -0
- package/lib/dist/resolution/cpp-template-instantiations.d.ts +83 -0
- package/lib/dist/resolution/cpp-template-instantiations.d.ts.map +1 -0
- package/lib/dist/resolution/cpp-template-instantiations.js +983 -0
- package/lib/dist/resolution/cpp-template-instantiations.js.map +1 -0
- package/lib/dist/resolution/cpp-type-aliases.d.ts +194 -0
- package/lib/dist/resolution/cpp-type-aliases.d.ts.map +1 -0
- package/lib/dist/resolution/cpp-type-aliases.js +648 -0
- package/lib/dist/resolution/cpp-type-aliases.js.map +1 -0
- package/lib/dist/resolution/dart-libraries.d.ts +75 -0
- package/lib/dist/resolution/dart-libraries.d.ts.map +1 -0
- package/lib/dist/resolution/dart-libraries.js +721 -0
- package/lib/dist/resolution/dart-libraries.js.map +1 -0
- package/lib/dist/resolution/dart-local-scope.d.ts +41 -0
- package/lib/dist/resolution/dart-local-scope.d.ts.map +1 -0
- package/lib/dist/resolution/dart-local-scope.js +565 -0
- package/lib/dist/resolution/dart-local-scope.js.map +1 -0
- package/lib/dist/resolution/event-emitter-synthesizer.d.ts +39 -0
- package/lib/dist/resolution/event-emitter-synthesizer.d.ts.map +1 -0
- package/lib/dist/resolution/event-emitter-synthesizer.js +656 -0
- package/lib/dist/resolution/event-emitter-synthesizer.js.map +1 -0
- package/lib/dist/resolution/expo-router-synthesizer.js +0 -52
- package/lib/dist/resolution/expo-router-synthesizer.js.map +1 -1
- package/lib/dist/resolution/frameworks/angular-router.d.ts.map +1 -1
- package/lib/dist/resolution/frameworks/angular-router.js +41 -208
- package/lib/dist/resolution/frameworks/angular-router.js.map +1 -1
- package/lib/dist/resolution/frameworks/aspnet-routes.d.ts +62 -0
- package/lib/dist/resolution/frameworks/aspnet-routes.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/aspnet-routes.js +382 -0
- package/lib/dist/resolution/frameworks/aspnet-routes.js.map +1 -0
- package/lib/dist/resolution/frameworks/astro.d.ts.map +1 -1
- package/lib/dist/resolution/frameworks/astro.js +4 -60
- package/lib/dist/resolution/frameworks/astro.js.map +1 -1
- package/lib/dist/resolution/frameworks/cargo-workspace.d.ts +18 -1
- package/lib/dist/resolution/frameworks/cargo-workspace.d.ts.map +1 -1
- package/lib/dist/resolution/frameworks/cargo-workspace.js +65 -15
- package/lib/dist/resolution/frameworks/cargo-workspace.js.map +1 -1
- package/lib/dist/resolution/frameworks/cics.d.ts.map +1 -1
- package/lib/dist/resolution/frameworks/cics.js +7 -33
- package/lib/dist/resolution/frameworks/cics.js.map +1 -1
- package/lib/dist/resolution/frameworks/codeigniter.d.ts +23 -0
- package/lib/dist/resolution/frameworks/codeigniter.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/codeigniter.js +271 -0
- package/lib/dist/resolution/frameworks/codeigniter.js.map +1 -0
- package/lib/dist/resolution/frameworks/component-folder.d.ts +17 -0
- package/lib/dist/resolution/frameworks/component-folder.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/component-folder.js +11 -0
- package/lib/dist/resolution/frameworks/component-folder.js.map +1 -0
- package/lib/dist/resolution/frameworks/csharp.d.ts.map +1 -1
- package/lib/dist/resolution/frameworks/csharp.js +85 -102
- package/lib/dist/resolution/frameworks/csharp.js.map +1 -1
- package/lib/dist/resolution/frameworks/drupal.d.ts +17 -8
- package/lib/dist/resolution/frameworks/drupal.d.ts.map +1 -1
- package/lib/dist/resolution/frameworks/drupal.js +377 -142
- package/lib/dist/resolution/frameworks/drupal.js.map +1 -1
- package/lib/dist/resolution/frameworks/elysia.d.ts +38 -0
- package/lib/dist/resolution/frameworks/elysia.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/elysia.js +683 -0
- package/lib/dist/resolution/frameworks/elysia.js.map +1 -0
- package/lib/dist/resolution/frameworks/expo-modules.d.ts.map +1 -1
- package/lib/dist/resolution/frameworks/expo-modules.js +8 -88
- package/lib/dist/resolution/frameworks/expo-modules.js.map +1 -1
- package/lib/dist/resolution/frameworks/expo-router.d.ts.map +1 -1
- package/lib/dist/resolution/frameworks/expo-router.js +9 -190
- package/lib/dist/resolution/frameworks/expo-router.js.map +1 -1
- package/lib/dist/resolution/frameworks/express.d.ts +48 -1
- package/lib/dist/resolution/frameworks/express.d.ts.map +1 -1
- package/lib/dist/resolution/frameworks/express.js +193 -199
- package/lib/dist/resolution/frameworks/express.js.map +1 -1
- package/lib/dist/resolution/frameworks/fabric.js +1 -104
- package/lib/dist/resolution/frameworks/fabric.js.map +1 -1
- package/lib/dist/resolution/frameworks/go.d.ts.map +1 -1
- package/lib/dist/resolution/frameworks/go.js +14 -43
- package/lib/dist/resolution/frameworks/go.js.map +1 -1
- package/lib/dist/resolution/frameworks/goframe.js +1 -55
- package/lib/dist/resolution/frameworks/goframe.js.map +1 -1
- package/lib/dist/resolution/frameworks/index.d.ts +14 -0
- package/lib/dist/resolution/frameworks/index.d.ts.map +1 -1
- package/lib/dist/resolution/frameworks/index.js +16 -50
- package/lib/dist/resolution/frameworks/index.js.map +1 -1
- package/lib/dist/resolution/frameworks/java.d.ts.map +1 -1
- package/lib/dist/resolution/frameworks/java.js +203 -129
- package/lib/dist/resolution/frameworks/java.js.map +1 -1
- package/lib/dist/resolution/frameworks/laravel.d.ts.map +1 -1
- package/lib/dist/resolution/frameworks/laravel.js +71 -136
- package/lib/dist/resolution/frameworks/laravel.js.map +1 -1
- package/lib/dist/resolution/frameworks/name-heuristic.js +0 -12
- package/lib/dist/resolution/frameworks/name-heuristic.js.map +1 -1
- package/lib/dist/resolution/frameworks/nestjs.js +2 -199
- package/lib/dist/resolution/frameworks/nestjs.js.map +1 -1
- package/lib/dist/resolution/frameworks/next-proxy.d.ts +67 -0
- package/lib/dist/resolution/frameworks/next-proxy.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/next-proxy.js +239 -0
- package/lib/dist/resolution/frameworks/next-proxy.js.map +1 -0
- package/lib/dist/resolution/frameworks/nextjs.d.ts.map +1 -1
- package/lib/dist/resolution/frameworks/nextjs.js +10 -66
- package/lib/dist/resolution/frameworks/nextjs.js.map +1 -1
- package/lib/dist/resolution/frameworks/object-literal.js +0 -21
- package/lib/dist/resolution/frameworks/object-literal.js.map +1 -1
- package/lib/dist/resolution/frameworks/package-deps.d.ts +11 -7
- package/lib/dist/resolution/frameworks/package-deps.d.ts.map +1 -1
- package/lib/dist/resolution/frameworks/package-deps.js +35 -26
- package/lib/dist/resolution/frameworks/package-deps.js.map +1 -1
- package/lib/dist/resolution/frameworks/page-component.js +0 -14
- package/lib/dist/resolution/frameworks/page-component.js.map +1 -1
- package/lib/dist/resolution/frameworks/play.d.ts.map +1 -1
- package/lib/dist/resolution/frameworks/play.js +26 -34
- package/lib/dist/resolution/frameworks/play.js.map +1 -1
- package/lib/dist/resolution/frameworks/python.js +5 -102
- package/lib/dist/resolution/frameworks/python.js.map +1 -1
- package/lib/dist/resolution/frameworks/react-native.d.ts.map +1 -1
- package/lib/dist/resolution/frameworks/react-native.js +1 -166
- package/lib/dist/resolution/frameworks/react-native.js.map +1 -1
- package/lib/dist/resolution/frameworks/react-router.d.ts +13 -4
- package/lib/dist/resolution/frameworks/react-router.d.ts.map +1 -1
- package/lib/dist/resolution/frameworks/react-router.js +10 -82
- package/lib/dist/resolution/frameworks/react-router.js.map +1 -1
- package/lib/dist/resolution/frameworks/react.d.ts +57 -0
- package/lib/dist/resolution/frameworks/react.d.ts.map +1 -1
- package/lib/dist/resolution/frameworks/react.js +1449 -191
- package/lib/dist/resolution/frameworks/react.js.map +1 -1
- package/lib/dist/resolution/frameworks/ruby.js +1 -61
- package/lib/dist/resolution/frameworks/ruby.js.map +1 -1
- package/lib/dist/resolution/frameworks/rust.d.ts.map +1 -1
- package/lib/dist/resolution/frameworks/rust.js +35 -56
- package/lib/dist/resolution/frameworks/rust.js.map +1 -1
- package/lib/dist/resolution/frameworks/svelte.d.ts.map +1 -1
- package/lib/dist/resolution/frameworks/svelte.js +7 -75
- package/lib/dist/resolution/frameworks/svelte.js.map +1 -1
- package/lib/dist/resolution/frameworks/sveltekit-router.d.ts.map +1 -1
- package/lib/dist/resolution/frameworks/sveltekit-router.js +8 -46
- package/lib/dist/resolution/frameworks/sveltekit-router.js.map +1 -1
- package/lib/dist/resolution/frameworks/swift-objc.js +0 -97
- package/lib/dist/resolution/frameworks/swift-objc.js.map +1 -1
- package/lib/dist/resolution/frameworks/swift.js +0 -97
- package/lib/dist/resolution/frameworks/swift.js.map +1 -1
- package/lib/dist/resolution/frameworks/tanstack-router.d.ts.map +1 -1
- package/lib/dist/resolution/frameworks/tanstack-router.js +9 -130
- package/lib/dist/resolution/frameworks/tanstack-router.js.map +1 -1
- package/lib/dist/resolution/frameworks/terraform.js +1 -85
- package/lib/dist/resolution/frameworks/terraform.js.map +1 -1
- package/lib/dist/resolution/frameworks/vue-router.d.ts.map +1 -1
- package/lib/dist/resolution/frameworks/vue-router.js +11 -134
- package/lib/dist/resolution/frameworks/vue-router.js.map +1 -1
- package/lib/dist/resolution/frameworks/vue.d.ts.map +1 -1
- package/lib/dist/resolution/frameworks/vue.js +42 -114
- package/lib/dist/resolution/frameworks/vue.js.map +1 -1
- package/lib/dist/resolution/go-func-field-synthesizer.d.ts +58 -0
- package/lib/dist/resolution/go-func-field-synthesizer.d.ts.map +1 -0
- package/lib/dist/resolution/go-func-field-synthesizer.js +696 -0
- package/lib/dist/resolution/go-func-field-synthesizer.js.map +1 -0
- package/lib/dist/resolution/go-module.d.ts +23 -7
- package/lib/dist/resolution/go-module.d.ts.map +1 -1
- package/lib/dist/resolution/go-module.js +21 -24
- package/lib/dist/resolution/go-module.js.map +1 -1
- package/lib/dist/resolution/go-stdlib-methods.d.ts +9 -0
- package/lib/dist/resolution/go-stdlib-methods.d.ts.map +1 -0
- package/lib/dist/resolution/go-stdlib-methods.js +224 -0
- package/lib/dist/resolution/go-stdlib-methods.js.map +1 -0
- package/lib/dist/resolution/goframe-synthesizer.js +2 -53
- package/lib/dist/resolution/goframe-synthesizer.js.map +1 -1
- package/lib/dist/resolution/import-resolver.d.ts +278 -29
- package/lib/dist/resolution/import-resolver.d.ts.map +1 -1
- package/lib/dist/resolution/import-resolver.js +1825 -1396
- package/lib/dist/resolution/import-resolver.js.map +1 -1
- package/lib/dist/resolution/index.d.ts +517 -6
- package/lib/dist/resolution/index.d.ts.map +1 -1
- package/lib/dist/resolution/index.js +1604 -1042
- package/lib/dist/resolution/index.js.map +1 -1
- package/lib/dist/resolution/js-builtins.d.ts +23 -0
- package/lib/dist/resolution/js-builtins.d.ts.map +1 -1
- package/lib/dist/resolution/js-builtins.js +34 -14
- package/lib/dist/resolution/js-builtins.js.map +1 -1
- package/lib/dist/resolution/js-class-expressions.d.ts +48 -0
- package/lib/dist/resolution/js-class-expressions.d.ts.map +1 -0
- package/lib/dist/resolution/js-class-expressions.js +25 -0
- package/lib/dist/resolution/js-class-expressions.js.map +1 -0
- package/lib/dist/resolution/js-super-calls.d.ts +18 -0
- package/lib/dist/resolution/js-super-calls.d.ts.map +1 -0
- package/lib/dist/resolution/js-super-calls.js +94 -0
- package/lib/dist/resolution/js-super-calls.js.map +1 -0
- package/lib/dist/resolution/jsx-code.d.ts +28 -0
- package/lib/dist/resolution/jsx-code.d.ts.map +1 -0
- package/lib/dist/resolution/jsx-code.js +459 -0
- package/lib/dist/resolution/jsx-code.js.map +1 -0
- package/lib/dist/resolution/lru-cache.d.ts +5 -13
- package/lib/dist/resolution/lru-cache.d.ts.map +1 -1
- package/lib/dist/resolution/lru-cache.js +43 -32
- package/lib/dist/resolution/lru-cache.js.map +1 -1
- package/lib/dist/resolution/memory-budget.js +0 -52
- package/lib/dist/resolution/memory-budget.js.map +1 -1
- package/lib/dist/resolution/module-importers.d.ts +210 -0
- package/lib/dist/resolution/module-importers.d.ts.map +1 -0
- package/lib/dist/resolution/module-importers.js +673 -0
- package/lib/dist/resolution/module-importers.js.map +1 -0
- package/lib/dist/resolution/name-matcher.d.ts +986 -7
- package/lib/dist/resolution/name-matcher.d.ts.map +1 -1
- package/lib/dist/resolution/name-matcher.js +24176 -6745
- package/lib/dist/resolution/name-matcher.js.map +1 -1
- package/lib/dist/resolution/next-router-synthesizer.d.ts +19 -0
- package/lib/dist/resolution/next-router-synthesizer.d.ts.map +1 -1
- package/lib/dist/resolution/next-router-synthesizer.js +46 -28
- package/lib/dist/resolution/next-router-synthesizer.js.map +1 -1
- package/lib/dist/resolution/override-parameters.d.ts +40 -0
- package/lib/dist/resolution/override-parameters.d.ts.map +1 -0
- package/lib/dist/resolution/override-parameters.js +339 -0
- package/lib/dist/resolution/override-parameters.js.map +1 -0
- package/lib/dist/resolution/parameter-flow.d.ts +218 -0
- package/lib/dist/resolution/parameter-flow.d.ts.map +1 -0
- package/lib/dist/resolution/parameter-flow.js +474 -0
- package/lib/dist/resolution/parameter-flow.js.map +1 -0
- package/lib/dist/resolution/pascal-scope.d.ts +91 -0
- package/lib/dist/resolution/pascal-scope.d.ts.map +1 -0
- package/lib/dist/resolution/pascal-scope.js +961 -0
- package/lib/dist/resolution/pascal-scope.js.map +1 -0
- package/lib/dist/resolution/path-aliases.d.ts +32 -4
- package/lib/dist/resolution/path-aliases.d.ts.map +1 -1
- package/lib/dist/resolution/path-aliases.js +43 -110
- package/lib/dist/resolution/path-aliases.js.map +1 -1
- package/lib/dist/resolution/php-web-root.d.ts +39 -0
- package/lib/dist/resolution/php-web-root.d.ts.map +1 -0
- package/lib/dist/resolution/php-web-root.js +141 -0
- package/lib/dist/resolution/php-web-root.js.map +1 -0
- package/lib/dist/resolution/project-scans.d.ts +38 -0
- package/lib/dist/resolution/project-scans.d.ts.map +1 -0
- package/lib/dist/resolution/project-scans.js +30 -0
- package/lib/dist/resolution/project-scans.js.map +1 -0
- package/lib/dist/resolution/python-overloads.d.ts +10 -0
- package/lib/dist/resolution/python-overloads.d.ts.map +1 -0
- package/lib/dist/resolution/python-overloads.js +75 -0
- package/lib/dist/resolution/python-overloads.js.map +1 -0
- package/lib/dist/resolution/react-router-synthesizer.d.ts.map +1 -1
- package/lib/dist/resolution/react-router-synthesizer.js +3 -55
- package/lib/dist/resolution/react-router-synthesizer.js.map +1 -1
- package/lib/dist/resolution/resolver-pool.d.ts +23 -2
- package/lib/dist/resolution/resolver-pool.d.ts.map +1 -1
- package/lib/dist/resolution/resolver-pool.js +43 -111
- package/lib/dist/resolution/resolver-pool.js.map +1 -1
- package/lib/dist/resolution/resolver-worker.d.ts +1 -1
- package/lib/dist/resolution/resolver-worker.d.ts.map +1 -1
- package/lib/dist/resolution/resolver-worker.js +8 -37
- package/lib/dist/resolution/resolver-worker.js.map +1 -1
- package/lib/dist/resolution/resurrect-ref.d.ts +25 -0
- package/lib/dist/resolution/resurrect-ref.d.ts.map +1 -0
- package/lib/dist/resolution/resurrect-ref.js +19 -0
- package/lib/dist/resolution/resurrect-ref.js.map +1 -0
- package/lib/dist/resolution/ruby-constant-paths.d.ts +56 -0
- package/lib/dist/resolution/ruby-constant-paths.d.ts.map +1 -0
- package/lib/dist/resolution/ruby-constant-paths.js +255 -0
- package/lib/dist/resolution/ruby-constant-paths.js.map +1 -0
- package/lib/dist/resolution/ruby-parameter-flow.d.ts +10 -0
- package/lib/dist/resolution/ruby-parameter-flow.d.ts.map +1 -0
- package/lib/dist/resolution/ruby-parameter-flow.js +801 -0
- package/lib/dist/resolution/ruby-parameter-flow.js.map +1 -0
- package/lib/dist/resolution/rust-scopes.d.ts +120 -0
- package/lib/dist/resolution/rust-scopes.d.ts.map +1 -0
- package/lib/dist/resolution/rust-scopes.js +730 -0
- package/lib/dist/resolution/rust-scopes.js.map +1 -0
- package/lib/dist/resolution/shopify-themes.d.ts +10 -0
- package/lib/dist/resolution/shopify-themes.d.ts.map +1 -0
- package/lib/dist/resolution/shopify-themes.js +19 -0
- package/lib/dist/resolution/shopify-themes.js.map +1 -0
- package/lib/dist/resolution/strip-comments.d.ts +20 -1
- package/lib/dist/resolution/strip-comments.d.ts.map +1 -1
- package/lib/dist/resolution/strip-comments.js +164 -119
- package/lib/dist/resolution/strip-comments.js.map +1 -1
- package/lib/dist/resolution/sveltekit-synthesizer.js +0 -64
- package/lib/dist/resolution/sveltekit-synthesizer.js.map +1 -1
- package/lib/dist/resolution/swift-objc-bridge.js +0 -160
- package/lib/dist/resolution/swift-objc-bridge.js.map +1 -1
- package/lib/dist/resolution/swift-type-visibility.d.ts.map +1 -1
- package/lib/dist/resolution/swift-type-visibility.js +62 -104
- package/lib/dist/resolution/swift-type-visibility.js.map +1 -1
- package/lib/dist/resolution/synth-utils.js +1 -22
- package/lib/dist/resolution/synth-utils.js.map +1 -1
- package/lib/dist/resolution/tanstack-router-synthesizer.js +0 -32
- package/lib/dist/resolution/tanstack-router-synthesizer.js.map +1 -1
- package/lib/dist/resolution/tauri-synthesizer.d.ts +37 -0
- package/lib/dist/resolution/tauri-synthesizer.d.ts.map +1 -0
- package/lib/dist/resolution/tauri-synthesizer.js +1038 -0
- package/lib/dist/resolution/tauri-synthesizer.js.map +1 -0
- package/lib/dist/resolution/tier-synthesizer.d.ts.map +1 -1
- package/lib/dist/resolution/tier-synthesizer.js +35 -177
- package/lib/dist/resolution/tier-synthesizer.js.map +1 -1
- package/lib/dist/resolution/type-parameters.d.ts +23 -0
- package/lib/dist/resolution/type-parameters.d.ts.map +1 -1
- package/lib/dist/resolution/type-parameters.js +52 -54
- package/lib/dist/resolution/type-parameters.js.map +1 -1
- package/lib/dist/resolution/types.d.ts +192 -11
- package/lib/dist/resolution/types.d.ts.map +1 -1
- package/lib/dist/resolution/types.js +0 -47
- package/lib/dist/resolution/types.js.map +1 -1
- package/lib/dist/resolution/vbnet-receivers.d.ts +92 -0
- package/lib/dist/resolution/vbnet-receivers.d.ts.map +1 -0
- package/lib/dist/resolution/vbnet-receivers.js +1482 -0
- package/lib/dist/resolution/vbnet-receivers.js.map +1 -0
- package/lib/dist/resolution/vue-router-synthesizer.js +0 -31
- package/lib/dist/resolution/vue-router-synthesizer.js.map +1 -1
- package/lib/dist/resolution/workspace-packages.d.ts +206 -15
- package/lib/dist/resolution/workspace-packages.d.ts.map +1 -1
- package/lib/dist/resolution/workspace-packages.js +573 -152
- package/lib/dist/resolution/workspace-packages.js.map +1 -1
- package/lib/dist/search/identifier-segments.js +2 -93
- package/lib/dist/search/identifier-segments.js.map +1 -1
- package/lib/dist/search/query-parser.js +0 -54
- package/lib/dist/search/query-parser.js.map +1 -1
- package/lib/dist/search/query-paths.js +0 -167
- package/lib/dist/search/query-paths.js.map +1 -1
- package/lib/dist/search/query-utils.d.ts +44 -0
- package/lib/dist/search/query-utils.d.ts.map +1 -1
- package/lib/dist/search/query-utils.js +120 -198
- package/lib/dist/search/query-utils.js.map +1 -1
- package/lib/dist/sync/git-hooks.d.ts +14 -5
- package/lib/dist/sync/git-hooks.d.ts.map +1 -1
- package/lib/dist/sync/git-hooks.js +118 -65
- package/lib/dist/sync/git-hooks.js.map +1 -1
- package/lib/dist/sync/index.js +0 -14
- package/lib/dist/sync/index.js.map +1 -1
- package/lib/dist/sync/watch-policy.js +0 -45
- package/lib/dist/sync/watch-policy.js.map +1 -1
- package/lib/dist/sync/watcher.d.ts +29 -11
- package/lib/dist/sync/watcher.d.ts.map +1 -1
- package/lib/dist/sync/watcher.js +83 -487
- package/lib/dist/sync/watcher.js.map +1 -1
- package/lib/dist/sync/worktree.d.ts +7 -2
- package/lib/dist/sync/worktree.d.ts.map +1 -1
- package/lib/dist/sync/worktree.js +24 -97
- package/lib/dist/sync/worktree.js.map +1 -1
- package/lib/dist/telemetry/index.d.ts.map +1 -1
- package/lib/dist/telemetry/index.js +15 -135
- package/lib/dist/telemetry/index.js.map +1 -1
- package/lib/dist/types.d.ts +46 -0
- package/lib/dist/types.d.ts.map +1 -1
- package/lib/dist/types.js +15 -44
- package/lib/dist/types.js.map +1 -1
- package/lib/dist/ui/color.js +0 -19
- package/lib/dist/ui/color.js.map +1 -1
- package/lib/dist/ui/glyphs.js +2 -45
- package/lib/dist/ui/glyphs.js.map +1 -1
- package/lib/dist/ui/shimmer-progress.js +0 -21
- package/lib/dist/ui/shimmer-progress.js.map +1 -1
- package/lib/dist/ui/shimmer-worker.js +0 -22
- package/lib/dist/ui/shimmer-worker.js.map +1 -1
- package/lib/dist/ui-server/api/deadcode.d.ts.map +1 -1
- package/lib/dist/ui-server/api/deadcode.js +2 -31
- package/lib/dist/ui-server/api/deadcode.js.map +1 -1
- package/lib/dist/ui-server/api/effects.js +0 -111
- package/lib/dist/ui-server/api/effects.js.map +1 -1
- package/lib/dist/ui-server/api/entrypoints.js +0 -142
- package/lib/dist/ui-server/api/entrypoints.js.map +1 -1
- package/lib/dist/ui-server/api/events.js +0 -145
- package/lib/dist/ui-server/api/events.js.map +1 -1
- package/lib/dist/ui-server/api/file.js +0 -80
- package/lib/dist/ui-server/api/file.js.map +1 -1
- package/lib/dist/ui-server/api/filecode.js +0 -95
- package/lib/dist/ui-server/api/filecode.js.map +1 -1
- package/lib/dist/ui-server/api/flow.js +0 -149
- package/lib/dist/ui-server/api/flow.js.map +1 -1
- package/lib/dist/ui-server/api/hierarchy.js +0 -28
- package/lib/dist/ui-server/api/hierarchy.js.map +1 -1
- package/lib/dist/ui-server/api/index.js +0 -88
- package/lib/dist/ui-server/api/index.js.map +1 -1
- package/lib/dist/ui-server/api/map.d.ts.map +1 -1
- package/lib/dist/ui-server/api/map.js +4 -317
- package/lib/dist/ui-server/api/map.js.map +1 -1
- package/lib/dist/ui-server/api/node.js +0 -111
- package/lib/dist/ui-server/api/node.js.map +1 -1
- package/lib/dist/ui-server/api/nodes.js +0 -16
- package/lib/dist/ui-server/api/nodes.js.map +1 -1
- package/lib/dist/ui-server/api/program.js +0 -90
- package/lib/dist/ui-server/api/program.js.map +1 -1
- package/lib/dist/ui-server/api/respond.js +0 -60
- package/lib/dist/ui-server/api/respond.js.map +1 -1
- package/lib/dist/ui-server/api/route-roots.d.ts.map +1 -1
- package/lib/dist/ui-server/api/route-roots.js +2 -44
- package/lib/dist/ui-server/api/route-roots.js.map +1 -1
- package/lib/dist/ui-server/api/routes.d.ts.map +1 -1
- package/lib/dist/ui-server/api/routes.js +4 -60
- package/lib/dist/ui-server/api/routes.js.map +1 -1
- package/lib/dist/ui-server/api/screens.d.ts.map +1 -1
- package/lib/dist/ui-server/api/screens.js +4 -174
- package/lib/dist/ui-server/api/screens.js.map +1 -1
- package/lib/dist/ui-server/api/search.js +0 -62
- package/lib/dist/ui-server/api/search.js.map +1 -1
- package/lib/dist/ui-server/api/session.js +0 -58
- package/lib/dist/ui-server/api/session.js.map +1 -1
- package/lib/dist/ui-server/api/source.d.ts.map +1 -1
- package/lib/dist/ui-server/api/source.js +0 -161
- package/lib/dist/ui-server/api/source.js.map +1 -1
- package/lib/dist/ui-server/api/stats.js +0 -58
- package/lib/dist/ui-server/api/stats.js.map +1 -1
- package/lib/dist/ui-server/api/steps.d.ts.map +1 -1
- package/lib/dist/ui-server/api/steps.js +5 -381
- package/lib/dist/ui-server/api/steps.js.map +1 -1
- package/lib/dist/ui-server/api/trail-store.d.ts +3 -3
- package/lib/dist/ui-server/api/trail-store.d.ts.map +1 -1
- package/lib/dist/ui-server/api/trail-store.js +24 -106
- package/lib/dist/ui-server/api/trail-store.js.map +1 -1
- package/lib/dist/ui-server/api/trails.d.ts.map +1 -1
- package/lib/dist/ui-server/api/trails.js +19 -94
- package/lib/dist/ui-server/api/trails.js.map +1 -1
- package/lib/dist/ui-server/api/when.js +0 -36
- package/lib/dist/ui-server/api/when.js.map +1 -1
- package/lib/dist/ui-server/api/wire.js +0 -58
- package/lib/dist/ui-server/api/wire.js.map +1 -1
- package/lib/dist/ui-server/assets.js +0 -35
- package/lib/dist/ui-server/assets.js.map +1 -1
- package/lib/dist/ui-server/constants.js +0 -26
- package/lib/dist/ui-server/constants.js.map +1 -1
- package/lib/dist/ui-server/highlight/bounded-tokenize.js +0 -25
- package/lib/dist/ui-server/highlight/bounded-tokenize.js.map +1 -1
- package/lib/dist/ui-server/highlight/index.js +1 -132
- package/lib/dist/ui-server/highlight/index.js.map +1 -1
- package/lib/dist/ui-server/highlight/languages.d.ts +3 -3
- package/lib/dist/ui-server/highlight/languages.js +0 -31
- package/lib/dist/ui-server/highlight/languages.js.map +1 -1
- package/lib/dist/ui-server/highlight/tokenize-worker.js +0 -5
- package/lib/dist/ui-server/highlight/tokenize-worker.js.map +1 -1
- package/lib/dist/ui-server/index.d.ts +25 -0
- package/lib/dist/ui-server/index.d.ts.map +1 -1
- package/lib/dist/ui-server/index.js +35 -103
- package/lib/dist/ui-server/index.js.map +1 -1
- package/lib/dist/ui-server/open-browser.js +0 -34
- package/lib/dist/ui-server/open-browser.js.map +1 -1
- package/lib/dist/ui-server/security.d.ts +5 -0
- package/lib/dist/ui-server/security.d.ts.map +1 -1
- package/lib/dist/ui-server/security.js +11 -147
- package/lib/dist/ui-server/security.js.map +1 -1
- package/lib/dist/ui-server/static.js +0 -41
- package/lib/dist/ui-server/static.js.map +1 -1
- package/lib/dist/upgrade/index.d.ts +18 -5
- package/lib/dist/upgrade/index.d.ts.map +1 -1
- package/lib/dist/upgrade/index.js +73 -229
- package/lib/dist/upgrade/index.js.map +1 -1
- package/lib/dist/upgrade/remove-binary.js +2 -67
- package/lib/dist/upgrade/remove-binary.js.map +1 -1
- package/lib/dist/upgrade/update-check.js +1 -81
- package/lib/dist/upgrade/update-check.js.map +1 -1
- package/lib/dist/utils.d.ts +69 -1
- package/lib/dist/utils.d.ts.map +1 -1
- package/lib/dist/utils.js +224 -266
- package/lib/dist/utils.js.map +1 -1
- package/lib/dist/worker-teardown.js +0 -47
- package/lib/dist/worker-teardown.js.map +1 -1
- package/lib/kernel/codegraph-kernel.node +2 -2
- package/lib/node_modules/.package-lock.json +4 -4
- package/lib/node_modules/ignore/README.md +138 -8
- package/lib/node_modules/ignore/index.d.ts +56 -20
- package/lib/node_modules/ignore/index.js +1033 -221
- package/lib/node_modules/ignore/legacy.js +871 -178
- package/lib/node_modules/ignore/package.json +10 -4
- package/lib/package.json +14 -8
- package/node.exe +2 -2
- package/package.json +1 -1
|
@@ -9,8 +9,14 @@ const UNDEFINED = undefined
|
|
|
9
9
|
const EMPTY = ''
|
|
10
10
|
const SPACE = ' '
|
|
11
11
|
const ESCAPE = '\\'
|
|
12
|
-
|
|
12
|
+
|
|
13
|
+
// The characters that carry a meaning of their own inside a regular
|
|
14
|
+
// expression, so a literal one has to be escaped before it is emitted.
|
|
15
|
+
const REGEX_LITERAL_SPECIAL = /[.*+?()[\]{}^$|\\/]/
|
|
16
|
+
const BOM = '\uFEFF'
|
|
13
17
|
const REGEX_INVALID_TRAILING_BACKSLASH = /(?:[^\\]|^)\\$/
|
|
18
|
+
// A run of two or more asterisks is a globstar (#175)
|
|
19
|
+
const REGEX_ANCHORED_GLOBSTAR = /^\/\*{2,}$/
|
|
14
20
|
const REGEX_REPLACE_LEADING_EXCAPED_EXCLAMATION = /^\\!/
|
|
15
21
|
const REGEX_REPLACE_LEADING_EXCAPED_HASH = /^\\#/
|
|
16
22
|
const REGEX_SPLITALL_CRLF = /\r?\n/g
|
|
@@ -23,9 +29,10 @@ const REGEX_SPLITALL_CRLF = /\r?\n/g
|
|
|
23
29
|
// - ..
|
|
24
30
|
// Valid:
|
|
25
31
|
// - .foo
|
|
26
|
-
const
|
|
32
|
+
const DOUBLE_SLASH = '//'
|
|
33
|
+
const SLASH_CODE = 47
|
|
34
|
+
const DOT_CODE = 46
|
|
27
35
|
|
|
28
|
-
const REGEX_TEST_TRAILING_SLASH = /\/$/
|
|
29
36
|
|
|
30
37
|
const SLASH = '/'
|
|
31
38
|
|
|
@@ -42,27 +49,336 @@ const define = (object, key, value) => {
|
|
|
42
49
|
return value
|
|
43
50
|
}
|
|
44
51
|
|
|
45
|
-
const REGEX_REGEXP_RANGE = /([0-z])-([0-z])/g
|
|
46
|
-
|
|
47
52
|
const RETURN_FALSE = () => false
|
|
48
53
|
|
|
49
|
-
//
|
|
50
|
-
//
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
54
|
+
// > The range notation, e.g. [a-zA-Z],
|
|
55
|
+
// > can be used to match one of the characters in a range.
|
|
56
|
+
//
|
|
57
|
+
// gitignore(5) defers to fnmatch(3) for this, and git implements it in
|
|
58
|
+
// `wildmatch.c`. A bracket expression has a sub-grammar of its own, which
|
|
59
|
+
// is neither the surrounding pattern grammar nor the JavaScript one:
|
|
60
|
+
//
|
|
61
|
+
// - a `]` right after `[` or `[!` is a literal member, not the terminator
|
|
62
|
+
// - `[:alpha:]` names one of twelve POSIX classes
|
|
63
|
+
// - `\` escapes the next member, `]` included
|
|
64
|
+
// - `*`, `?` and `.` are plain literal members
|
|
65
|
+
// - an unterminated expression makes the whole pattern match nothing
|
|
66
|
+
//
|
|
67
|
+
// which means the expression can not be located -- let alone translated -- by
|
|
68
|
+
// a regular expression. It is scanned out of the pattern before the
|
|
69
|
+
// replacers below run, and put back once they are done, so that neither the
|
|
70
|
+
// metacharacter escaper nor the `?` / `*` replacers ever see its body.
|
|
71
|
+
|
|
72
|
+
// git classifies with its own ASCII-only ctype macros (`wildmatch.c`), never
|
|
73
|
+
// with the C library ones, so these must not be mapped onto `\d` / `\w` /
|
|
74
|
+
// `\s`, which are wider. `/` is left out of every expansion, because a
|
|
75
|
+
// bracket expression never matches a path separator.
|
|
76
|
+
const POSIX_CLASSES = {
|
|
77
|
+
alnum: '0-9A-Za-z',
|
|
78
|
+
alpha: 'A-Za-z',
|
|
79
|
+
blank: ' \\t',
|
|
80
|
+
cntrl: '\\x00-\\x1f\\x7f',
|
|
81
|
+
digit: '0-9',
|
|
82
|
+
graph: '!-.0-~',
|
|
83
|
+
lower: 'a-z',
|
|
84
|
+
print: ' -.0-~',
|
|
85
|
+
punct: '!-.:-@\\[-`{-~',
|
|
86
|
+
// git's `sane-ctype.h` classifies \v and \f as control, not space,
|
|
87
|
+
// unlike C's `isspace`
|
|
88
|
+
space: ' \\t\\n\\r',
|
|
89
|
+
upper: 'A-Z',
|
|
90
|
+
xdigit: '0-9A-Fa-f'
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
const CLASS_MEMBERS_TO_ESCAPE = '\\]^-['
|
|
94
|
+
|
|
95
|
+
const escapeMember = char => CLASS_MEMBERS_TO_ESCAPE.indexOf(char) < 0
|
|
96
|
+
? char
|
|
97
|
+
: ESCAPE + char
|
|
98
|
+
|
|
99
|
+
// > if (matched == negated || ((flags & WM_PATHNAME) && text_ch == '/'))
|
|
100
|
+
// > return WM_ABORT_TO_STARSTAR; (git, `wildmatch.c`)
|
|
101
|
+
// A bracket expression never matches a path separator, whatever its members
|
|
102
|
+
// say, so a negated class gets `/` as one more excluded character, while a
|
|
103
|
+
// plain one -- where a literal member or a range could still let `/` in --
|
|
104
|
+
// is guarded with a lookahead, `/` being impossible to subtract from a
|
|
105
|
+
// JavaScript character class.
|
|
106
|
+
const NON_SLASH = '(?!\\/)'
|
|
107
|
+
|
|
108
|
+
const classSource = (negated, body) => {
|
|
109
|
+
if (negated) {
|
|
110
|
+
return `[^\\/${body}]`
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
const source = `[${body}]`
|
|
114
|
+
|
|
115
|
+
return new RegExp(source).test('/')
|
|
116
|
+
? NON_SLASH + source
|
|
117
|
+
: source
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
// Scan the bracket expression that starts at `pattern[start] === '['`,
|
|
121
|
+
// mirroring the member loop of git's `wildmatch.c`.
|
|
122
|
+
// @returns {{end: number, source: string} | null} `null` if the expression is
|
|
123
|
+
// never terminated, which makes the whole pattern match nothing.
|
|
124
|
+
const scanBracket = (pattern, start) => {
|
|
125
|
+
const {length} = pattern
|
|
126
|
+
let index = start + 1
|
|
127
|
+
let negated = EMPTY
|
|
128
|
+
|
|
129
|
+
const lead = pattern[index]
|
|
130
|
+
if (lead === '!' || lead === '^') {
|
|
131
|
+
negated = '^'
|
|
132
|
+
index ++
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
let body = EMPTY
|
|
136
|
+
|
|
137
|
+
// The member a `-` could start a range from, or EMPTY when the previous
|
|
138
|
+
// member can not open one (start of the body, or a range / POSIX class
|
|
139
|
+
// that has just closed)
|
|
140
|
+
let prev = EMPTY
|
|
141
|
+
|
|
142
|
+
// git scans the members with a do-while, so the first one is consumed
|
|
143
|
+
// unconditionally. That is the whole reason a leading `]` is a member
|
|
144
|
+
// and not the terminator.
|
|
145
|
+
for (;;) {
|
|
146
|
+
const char = pattern[index]
|
|
147
|
+
|
|
148
|
+
if (char === UNDEFINED) {
|
|
149
|
+
return null
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
if (char === ESCAPE) {
|
|
153
|
+
const escaped = pattern[index + 1]
|
|
154
|
+
if (escaped === UNDEFINED) {
|
|
155
|
+
return null
|
|
156
|
+
}
|
|
157
|
+
body += escapeMember(escaped)
|
|
158
|
+
prev = escaped
|
|
159
|
+
index ++
|
|
160
|
+
} else if (
|
|
161
|
+
char === '-'
|
|
162
|
+
&& prev
|
|
163
|
+
&& index + 1 < length
|
|
164
|
+
&& pattern[index + 1] !== ']'
|
|
165
|
+
) {
|
|
166
|
+
index ++
|
|
167
|
+
let to = pattern[index]
|
|
168
|
+
if (to === ESCAPE) {
|
|
169
|
+
// A pattern can not end on a lone backslash -- `checkPattern` has
|
|
170
|
+
// already thrown it away -- so there is an upper bound to read.
|
|
171
|
+
to = pattern[index += 1]
|
|
172
|
+
}
|
|
173
|
+
// An out-of-order range matches nothing in git but is a syntax error in
|
|
174
|
+
// JavaScript, so it is dropped. Its lower bound stays: git tests it
|
|
175
|
+
// as a plain member before it ever looks at the `-`, so `[c-a]` does
|
|
176
|
+
// match `c`.
|
|
177
|
+
if (prev <= to) {
|
|
178
|
+
body += `-${escapeMember(to)}`
|
|
179
|
+
}
|
|
180
|
+
prev = EMPTY
|
|
181
|
+
} else if (char === '[' && pattern[index + 1] === ':') {
|
|
182
|
+
const nameStart = index + 2
|
|
183
|
+
let end = nameStart
|
|
184
|
+
while (end < length && pattern[end] !== ']') {
|
|
185
|
+
end ++
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
if (end === length) {
|
|
189
|
+
return null
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
if (end > nameStart && pattern[end - 1] === ':') {
|
|
193
|
+
const name = pattern.slice(nameStart, end - 1)
|
|
194
|
+
|
|
195
|
+
// An unknown class name makes the whole pattern match nothing
|
|
196
|
+
if (!Object.prototype.hasOwnProperty.call(POSIX_CLASSES, name)) {
|
|
197
|
+
return null
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
body += POSIX_CLASSES[name]
|
|
201
|
+
prev = EMPTY
|
|
202
|
+
index = end
|
|
203
|
+
} else {
|
|
204
|
+
// No `:]` to close it, so the `[` is a plain member and scanning
|
|
205
|
+
// resumes right after it.
|
|
206
|
+
body += escapeMember('[')
|
|
207
|
+
prev = '['
|
|
208
|
+
index = nameStart - 2
|
|
209
|
+
}
|
|
210
|
+
} else {
|
|
211
|
+
body += escapeMember(char)
|
|
212
|
+
prev = char
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
index ++
|
|
216
|
+
|
|
217
|
+
if (pattern[index] === ']') {
|
|
218
|
+
return {
|
|
219
|
+
end: index,
|
|
220
|
+
source: classSource(negated, body)
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
// An empty JavaScript class can never match, which is how a pattern that git
|
|
227
|
+
// gives up on (`WM_ABORT_ALL`) is expressed here.
|
|
228
|
+
const NEVER_MATCH = '[]'
|
|
229
|
+
|
|
230
|
+
// A NUL can appear in neither a `.gitignore` line nor a path, which makes it
|
|
231
|
+
// the one safe placeholder character. A literal one in the pattern is
|
|
232
|
+
// held aside all the same, so a collision is impossible by construction.
|
|
233
|
+
const PLACEHOLDER = '\u0000'
|
|
234
|
+
const REGEX_RESTORE_PLACEHOLDER = new RegExp(
|
|
235
|
+
`${PLACEHOLDER}(\\d+)${PLACEHOLDER}`, 'g'
|
|
58
236
|
)
|
|
59
237
|
|
|
60
|
-
//
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
238
|
+
// The one wildcard the chain does not expand for itself is a trailing `*`. How
|
|
239
|
+
// it expands depends on the mode (`regex` vs `checkRegex`), so `_make` is
|
|
240
|
+
// left to do it, and until then the pending wildcard travels as this marker.
|
|
241
|
+
// That is what keeps it apart from a user-escaped literal `\*`: the unescape
|
|
242
|
+
// steps collapse the escaped one to the exact `\*` a wildcard would leave
|
|
243
|
+
// behind, so by the time `_make` runs the two are otherwise the same string
|
|
244
|
+
// and a literal star gets wrongly rewritten into a wildcard. The marker is a
|
|
245
|
+
// private-use character, and `extractBrackets` keeps one that came out of the
|
|
246
|
+
// pattern apart from it, so the only marker `_make` ever turns back into a
|
|
247
|
+
// real wildcard is the one this chain put there itself.
|
|
248
|
+
const TRAILING_WILDCARD = '\uE000'
|
|
249
|
+
|
|
250
|
+
// A trailing "/**" is deferred the same way, because `checkRegex` has to tell
|
|
251
|
+
// it apart from a trailing "/*" (see `checkSourceOf`). For `.ignores()` it
|
|
252
|
+
// still never matches the folder itself (#21).
|
|
253
|
+
const TRAILING_DOUBLESTAR = '\uE001'
|
|
254
|
+
|
|
255
|
+
// The three characters above mean something to the chain that builds the
|
|
256
|
+
// source rather than to the path, so one that came out of the pattern is
|
|
257
|
+
// held aside like a bracket expression instead of going straight out. Being
|
|
258
|
+
// held is what makes it safe: the restore runs after the step that anchors
|
|
259
|
+
// the source, so the character comes back in the middle of the source and
|
|
260
|
+
// not at its end, which is the one place `_make` and `checkSourceOf` look
|
|
261
|
+
// for a marker. Without it a pattern's own character lands where a pending
|
|
262
|
+
// marker sits, and `_make` turns it into a real trailing wildcard.
|
|
263
|
+
//
|
|
264
|
+
// It is held as a one-member class rather than bare, in both of the branches
|
|
265
|
+
// a reserved character can reach, so that the property can be
|
|
266
|
+
// read off this function alone -- a reserved character never goes out on
|
|
267
|
+
// its own -- rather than depending on where in the chain the restore
|
|
268
|
+
// happens to run. In the expression built here `[x]` matches exactly what
|
|
269
|
+
// `x` matches, none of the three being special to a regular expression or
|
|
270
|
+
// inside a class, so no test can tell the two apart: the class is insurance,
|
|
271
|
+
// and the paragraph above is the reason it is not needed.
|
|
272
|
+
const isReserved = char =>
|
|
273
|
+
char === PLACEHOLDER
|
|
274
|
+
|| char === TRAILING_WILDCARD
|
|
275
|
+
|| char === TRAILING_DOUBLESTAR
|
|
276
|
+
|
|
277
|
+
// Replace every bracket expression with a placeholder the replacers below
|
|
278
|
+
// leave alone, and translate it separately.
|
|
279
|
+
const extractBrackets = pattern => {
|
|
280
|
+
const sources = []
|
|
281
|
+
const hold = source =>
|
|
282
|
+
`${PLACEHOLDER}${sources.push(source) - 1}${PLACEHOLDER}`
|
|
283
|
+
|
|
284
|
+
const {length} = pattern
|
|
285
|
+
let out = EMPTY
|
|
286
|
+
let index = 0
|
|
287
|
+
|
|
288
|
+
while (index < length) {
|
|
289
|
+
const char = pattern[index]
|
|
290
|
+
|
|
291
|
+
if (char === ESCAPE) {
|
|
292
|
+
// > Put a backslash ("\") in front of ... a character to make it literal.
|
|
293
|
+
// (gitignore(5) -> fnmatch(3))
|
|
294
|
+
// A backslash quotes the next character, whatever it is, so `\d` is a
|
|
295
|
+
// literal `d`, not the regex digit class, and `\?` is a literal `?`,
|
|
296
|
+
// not a wildcard. Held aside as its literal here, the escape never
|
|
297
|
+
// reaches the replacers below, which would otherwise let `\d`, `\b`,
|
|
298
|
+
// `\1`, `\/` keep their regular-expression meaning, and would turn a
|
|
299
|
+
// `\?` into `[^\/]`.
|
|
300
|
+
//
|
|
301
|
+
// Three escapes are still left for the chain: `\*` (a literal star,
|
|
302
|
+
// told apart from a wildcard by `TRAILING_WILDCARD` and the wildcard
|
|
303
|
+
// replacers), `\[` (a literal bracket, the one `[` the bracket
|
|
304
|
+
// replacer still expects), and `\ ` (a quoted space, which one pass
|
|
305
|
+
// below rewrites in bulk -- holding each one aside instead costs more
|
|
306
|
+
// on a pattern built out of them). A lone trailing backslash can reach
|
|
307
|
+
// here after line-ending cleanup.
|
|
308
|
+
//
|
|
309
|
+
// A quoted backslash is not among them. The chain doubles every
|
|
310
|
+
// backslash, then takes the doubling back out again, and a quoted one
|
|
311
|
+
// standing next to a character the chain also escapes left the two
|
|
312
|
+
// counts sharing a run, so one of the escapes was lost. Held here as
|
|
313
|
+
// the literal it means, it never joins that run.
|
|
314
|
+
const escaped = pattern[index + 1]
|
|
315
|
+
|
|
316
|
+
if (
|
|
317
|
+
escaped === UNDEFINED
|
|
318
|
+
|| escaped === SLASH && index + 2 === length
|
|
319
|
+
) {
|
|
320
|
+
// Git removes a final directory slash before matching. An escape
|
|
321
|
+
// without a character after that removal makes the pattern invalid.
|
|
322
|
+
out += hold(NEVER_MATCH)
|
|
323
|
+
} else if (
|
|
324
|
+
escaped === '*'
|
|
325
|
+
|| escaped === '['
|
|
326
|
+
|| escaped === SPACE
|
|
327
|
+
) {
|
|
328
|
+
out += pattern.slice(index, index + 2)
|
|
329
|
+
} else {
|
|
330
|
+
out += hold(
|
|
331
|
+
REGEX_LITERAL_SPECIAL.test(escaped)
|
|
332
|
+
? ESCAPE + escaped
|
|
333
|
+
: isReserved(escaped)
|
|
334
|
+
? `[${escaped}]`
|
|
335
|
+
: escaped
|
|
336
|
+
)
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
index += 2
|
|
340
|
+
} else if (isReserved(char)) {
|
|
341
|
+
out += hold(`[${char}]`)
|
|
342
|
+
index ++
|
|
343
|
+
} else if (char === '[') {
|
|
344
|
+
const scanned = scanBracket(pattern, index)
|
|
345
|
+
|
|
346
|
+
if (scanned === null) {
|
|
347
|
+
// git gives up on the whole pattern (`WM_ABORT_ALL`), so whatever
|
|
348
|
+
// follows can not make it match either.
|
|
349
|
+
out += hold(NEVER_MATCH)
|
|
350
|
+
index = length
|
|
351
|
+
} else {
|
|
352
|
+
out += hold(scanned.source)
|
|
353
|
+
index = scanned.end + 1
|
|
354
|
+
}
|
|
355
|
+
} else {
|
|
356
|
+
out += char
|
|
357
|
+
index ++
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
return {
|
|
362
|
+
source: out,
|
|
363
|
+
sources
|
|
364
|
+
}
|
|
64
365
|
}
|
|
65
366
|
|
|
367
|
+
// A step of the chain below is normally a `[matcher, replacer]` pair handed
|
|
368
|
+
// to `String.replace`. `DIRECT` marks the ones that are plain string work
|
|
369
|
+
// instead, and take `(source, pattern)`.
|
|
370
|
+
//
|
|
371
|
+
// Anchoring the two ends is exactly that -- a test of one character and a
|
|
372
|
+
// concatenation -- and putting it through the regular expression engine
|
|
373
|
+
// cost a third of this chain for nothing: 167ns where 10ns does the same
|
|
374
|
+
// job. The two are still steps in the same list, in the same places,
|
|
375
|
+
// because their position in the order is part of what they mean.
|
|
376
|
+
const DIRECT = null
|
|
377
|
+
|
|
378
|
+
// A separator at the beginning or in the middle of a pattern, as opposed to
|
|
379
|
+
// one at the very end.
|
|
380
|
+
const REGEX_INNER_SLASH = /\/(?!$)/
|
|
381
|
+
|
|
66
382
|
// > If the pattern ends with a slash,
|
|
67
383
|
// > it is removed for the purpose of the following description,
|
|
68
384
|
// > but it would only find a match with a directory.
|
|
@@ -74,40 +390,54 @@ const cleanRangeBackSlash = slashes => {
|
|
|
74
390
|
// you could use option `mark: true` with `glob`
|
|
75
391
|
|
|
76
392
|
// '`foo/`' should not continue with the '`..`'
|
|
393
|
+
// The chain that turns one gitignore pattern into a regular expression
|
|
394
|
+
// source, in order. A step is either
|
|
395
|
+
//
|
|
396
|
+
// [matcher, replacer] handed to `String.replace`
|
|
397
|
+
// [matcher, replacer, required] the same, but skipped outright unless
|
|
398
|
+
// `required` appears in the string, which
|
|
399
|
+
// the matcher cannot match without
|
|
400
|
+
// [DIRECT, transform] plain string work, taking (source, pattern)
|
|
401
|
+
//
|
|
402
|
+
// The `required` character is only ever a shortcut: finding it does not mean
|
|
403
|
+
// the matcher will match, and not finding it means it cannot. It is there
|
|
404
|
+
// because scanning for one character costs a fraction of running a matcher
|
|
405
|
+
// that then finds nothing -- for the wildcard step, whose `[^\\]+`
|
|
406
|
+
// backtracks its way through the whole string before giving up, 11ns
|
|
407
|
+
// against 400ns.
|
|
77
408
|
const REPLACERS = [
|
|
78
409
|
|
|
79
|
-
[
|
|
80
|
-
// Remove BOM
|
|
81
|
-
// TODO:
|
|
82
|
-
// Other similar zero-width characters?
|
|
83
|
-
/^\uFEFF/,
|
|
84
|
-
() => EMPTY
|
|
85
|
-
],
|
|
86
|
-
|
|
87
|
-
// > Trailing spaces are ignored unless they are quoted with backslash ("\")
|
|
88
|
-
[
|
|
89
|
-
// (a\ ) -> (a )
|
|
90
|
-
// (a ) -> (a)
|
|
91
|
-
// (a ) -> (a)
|
|
92
|
-
// (a \ ) -> (a )
|
|
93
|
-
/((?:\\\\)*?)(\\?\s+)$/,
|
|
94
|
-
(_, m1, m2) => m1 + (
|
|
95
|
-
m2.indexOf('\\') === 0
|
|
96
|
-
? SPACE
|
|
97
|
-
: EMPTY
|
|
98
|
-
)
|
|
99
|
-
],
|
|
100
|
-
|
|
101
410
|
// Replace (\ ) with ' '
|
|
411
|
+
// Only a space: an escaped tab or other whitespace is already a literal by
|
|
412
|
+
// the time it reaches here, and a bare tab must be left as one, not turned
|
|
413
|
+
// into a space.
|
|
102
414
|
// (\ ) -> ' '
|
|
103
415
|
// (\\ ) -> '\\ '
|
|
104
416
|
// (\\\ ) -> '\\ '
|
|
105
417
|
[
|
|
106
|
-
|
|
107
|
-
(
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
418
|
+
// A run of backslashes is taken whole, from its first one, so no match
|
|
419
|
+
// ever starts again inside it -- `(\\+?) ` did, which made a long run
|
|
420
|
+
// quadratic.
|
|
421
|
+
/(\\+)( ?)/g,
|
|
422
|
+
(_, run, space) => space
|
|
423
|
+
? run.slice(0, run.length - run.length % 2) + SPACE
|
|
424
|
+
: run,
|
|
425
|
+
ESCAPE + SPACE
|
|
426
|
+
],
|
|
427
|
+
|
|
428
|
+
// git's wildmatch() reads a run of two or more asterisks as one globstar
|
|
429
|
+
// whenever the run fills a path segment: it starts the pattern or follows
|
|
430
|
+
// a `/`, and it ends the pattern or comes before a `/`. A run of two is
|
|
431
|
+
// already `**`; a longer one is folded into `**` here, so the steps
|
|
432
|
+
// below only ever have to know `**`.
|
|
433
|
+
// `***/foo` -> `**/foo`, `a/***/b` -> `a/**/b`, `a/***` -> `a/**`
|
|
434
|
+
// git also takes a run beside a literal prefix (`a***/b`) or beside an
|
|
435
|
+
// escaped slash (`***\/b`) as a globstar, and this does not; the README
|
|
436
|
+
// lists both, under "A run of asterisks".
|
|
437
|
+
[
|
|
438
|
+
/(^|\/)\*{3,}(?=\/|$)/g,
|
|
439
|
+
(_, start) => `${start}**`,
|
|
440
|
+
'*'
|
|
111
441
|
],
|
|
112
442
|
|
|
113
443
|
// Escape metacharacters
|
|
@@ -135,7 +465,8 @@ const REPLACERS = [
|
|
|
135
465
|
[
|
|
136
466
|
// > a question mark (?) matches a single character
|
|
137
467
|
/(?!\\)\?/g,
|
|
138
|
-
() => '[^/]'
|
|
468
|
+
() => '[^/]',
|
|
469
|
+
'?'
|
|
139
470
|
],
|
|
140
471
|
|
|
141
472
|
// leading slash
|
|
@@ -145,13 +476,15 @@ const REPLACERS = [
|
|
|
145
476
|
// > For example, "/*.c" matches "cat-file.c" but not "mozilla-sha1/sha1.c".
|
|
146
477
|
// A leading slash matches the beginning of the pathname
|
|
147
478
|
/^\//,
|
|
148
|
-
() => '^'
|
|
479
|
+
() => '^',
|
|
480
|
+
SLASH
|
|
149
481
|
],
|
|
150
482
|
|
|
151
483
|
// replace special metacharacter slash after the leading slash
|
|
152
484
|
[
|
|
153
485
|
/\//g,
|
|
154
|
-
() => '\\/'
|
|
486
|
+
() => '\\/',
|
|
487
|
+
SLASH
|
|
155
488
|
],
|
|
156
489
|
|
|
157
490
|
[
|
|
@@ -161,10 +494,11 @@ const REPLACERS = [
|
|
|
161
494
|
// > "**/foo/bar" matches file or directory "bar" anywhere that is directly
|
|
162
495
|
// > under directory "foo".
|
|
163
496
|
// Notice that the '*'s have been replaced as '\\*'
|
|
164
|
-
|
|
497
|
+
/^\^*(?:\\\*\\\*\\\/)+/,
|
|
165
498
|
|
|
166
499
|
// '**/foo' <-> 'foo'
|
|
167
|
-
() => '^(?:.*\\/)?'
|
|
500
|
+
() => '^(?:.*\\/)?',
|
|
501
|
+
'*'
|
|
168
502
|
],
|
|
169
503
|
|
|
170
504
|
// starting
|
|
@@ -172,10 +506,15 @@ const REPLACERS = [
|
|
|
172
506
|
// there will be no leading '/'
|
|
173
507
|
// (which has been replaced by section "leading slash")
|
|
174
508
|
// If starts with '**', adding a '^' to the regular expression also works
|
|
175
|
-
|
|
176
|
-
|
|
509
|
+
DIRECT,
|
|
510
|
+
(source, pattern) => {
|
|
511
|
+
// Nothing to anchor to, or already anchored
|
|
512
|
+
if (!source || source[0] === '^') {
|
|
513
|
+
return source
|
|
514
|
+
}
|
|
515
|
+
|
|
177
516
|
// If has a slash `/` at the beginning or middle
|
|
178
|
-
|
|
517
|
+
const anchor = !REGEX_INNER_SLASH.test(pattern)
|
|
179
518
|
// > Prior to 2.22.1
|
|
180
519
|
// > If the pattern does not contain a slash /,
|
|
181
520
|
// > Git treats it as a shell glob pattern
|
|
@@ -193,6 +532,8 @@ const REPLACERS = [
|
|
|
193
532
|
// > Otherwise, Git treats the pattern as a shell glob suitable for
|
|
194
533
|
// > consumption by fnmatch(3)
|
|
195
534
|
: '^'
|
|
535
|
+
|
|
536
|
+
return anchor + source
|
|
196
537
|
}
|
|
197
538
|
],
|
|
198
539
|
|
|
@@ -207,18 +548,28 @@ const REPLACERS = [
|
|
|
207
548
|
// Check if it is not the last `'/**'`
|
|
208
549
|
(_, index, str) => index + 6 < str.length
|
|
209
550
|
|
|
210
|
-
// case: /**/
|
|
211
|
-
// > A
|
|
212
|
-
// >
|
|
213
|
-
// >
|
|
214
|
-
// '/**/'
|
|
215
|
-
?
|
|
551
|
+
// case: /**/ at the end of the pattern, i.e. a trailing `'/**/'`
|
|
552
|
+
// > A trailing `"/**/"` (a trailing `"/**"` restricted to directories)
|
|
553
|
+
// > matches everything inside, but it should not match the current
|
|
554
|
+
// > folder itself, so it requires at least one directory segment.
|
|
555
|
+
// 'a/**/' matches 'a/b/', 'a/x/y/' but not 'a/'
|
|
556
|
+
? str.slice(index + 6) === '\\/'
|
|
557
|
+
? '(?:\\/[^\\/]+)+'
|
|
558
|
+
|
|
559
|
+
// case: /**/
|
|
560
|
+
// > A slash followed by two consecutive asterisks then a slash matches
|
|
561
|
+
// > zero or more directories.
|
|
562
|
+
// > For example, "a/**/b" matches "a/b", "a/x/b", "a/x/y/b" and so on.
|
|
563
|
+
// '/**/'
|
|
564
|
+
: '(?:\\/[^\\/]+)*'
|
|
216
565
|
|
|
217
566
|
// case: /**
|
|
218
567
|
// > A trailing `"/**"` matches everything inside.
|
|
219
568
|
|
|
220
|
-
// #21: everything inside but it should not include the current folder
|
|
221
|
-
|
|
569
|
+
// #21: everything inside but it should not include the current folder,
|
|
570
|
+
// resolved by `_make`
|
|
571
|
+
: `\\/${TRAILING_DOUBLESTAR}`,
|
|
572
|
+
'*'
|
|
222
573
|
],
|
|
223
574
|
|
|
224
575
|
// normal intermediate wildcards
|
|
@@ -241,7 +592,33 @@ const REPLACERS = [
|
|
|
241
592
|
// > and will match according to the previous rules.
|
|
242
593
|
const unescaped = p2.replace(/\\\*/g, '[^\\/]*')
|
|
243
594
|
return p1 + unescaped
|
|
244
|
-
}
|
|
595
|
+
},
|
|
596
|
+
'*'
|
|
597
|
+
],
|
|
598
|
+
|
|
599
|
+
// trailing wildcard, held apart from a literal star
|
|
600
|
+
[
|
|
601
|
+
// The step above leaves a trailing `*` alone, so a single `\*` is all that
|
|
602
|
+
// can be left at the end here, and what stands in front of it says which
|
|
603
|
+
// kind it is. A wildcard arrives as the escaper wrote it, `\*` with
|
|
604
|
+
// nothing before it; a literal arrives as the user's own escape, which
|
|
605
|
+
// the escaper doubled, and then the star's own -- `\\` and then `\*`.
|
|
606
|
+
// There is no third case: every backslash still reaching the chain is
|
|
607
|
+
// one `\*`, `\[` or `\ ` carries itself, and each is followed by its
|
|
608
|
+
// own character, so a longer run can never form. This runs while the
|
|
609
|
+
// two are still distinct, before the unescape steps below collapse the
|
|
610
|
+
// literal onto the very `\*` a wildcard leaves behind.
|
|
611
|
+
/(^|[^\\])((?:\\\\)*)\\\*$/,
|
|
612
|
+
|
|
613
|
+
(match, p1, p2) =>
|
|
614
|
+
p2 === EMPTY
|
|
615
|
+
// A real wildcard: carry it to `_make` as the marker, so the unescape
|
|
616
|
+
// steps and the trailing-wildcard rewrite can never mistake it for a
|
|
617
|
+
// literal `\*` (nor the reverse).
|
|
618
|
+
? p1 + TRAILING_WILDCARD
|
|
619
|
+
// A literal star: leave it exactly as it stands for the unescape steps.
|
|
620
|
+
: match,
|
|
621
|
+
'*'
|
|
245
622
|
],
|
|
246
623
|
|
|
247
624
|
[
|
|
@@ -249,41 +626,36 @@ const REPLACERS = [
|
|
|
249
626
|
// For example, if a user escape a '\\*',
|
|
250
627
|
// after step 3, the result will be '\\\\\\*'
|
|
251
628
|
/\\\\\\(?=[$.|*+(){^])/g,
|
|
252
|
-
() => ESCAPE
|
|
629
|
+
() => ESCAPE,
|
|
630
|
+
ESCAPE + ESCAPE
|
|
253
631
|
],
|
|
254
632
|
|
|
255
633
|
[
|
|
256
634
|
// '\\\\' -> '\\'
|
|
257
635
|
/\\\\/g,
|
|
258
|
-
() => ESCAPE
|
|
636
|
+
() => ESCAPE,
|
|
637
|
+
ESCAPE + ESCAPE
|
|
259
638
|
],
|
|
260
639
|
|
|
261
640
|
[
|
|
262
|
-
//
|
|
263
|
-
//
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
// '[bar]'
|
|
274
|
-
// '[bar\\\\]'
|
|
275
|
-
? `[${sanitizeRange(range)}${endEscape}]`
|
|
276
|
-
// Invalid range notaton
|
|
277
|
-
// '[bar\\]' -> '[bar\\\\]'
|
|
278
|
-
: '[]'
|
|
279
|
-
: '[]'
|
|
641
|
+
// Every real bracket expression -- POSIX classes included -- has already
|
|
642
|
+
// been held aside by `extractBrackets`, so the only `[` left in the
|
|
643
|
+
// pattern is an escaped, literal one.
|
|
644
|
+
|
|
645
|
+
// A backslash could only stand at the end of the range if it quoted the
|
|
646
|
+
// `]`, and `\]` is held aside long before this.
|
|
647
|
+
/\\\[([^\]/]*?)($|\])/g,
|
|
648
|
+
|
|
649
|
+
// '\\[bar]' -> '\\\\[bar]'
|
|
650
|
+
(match, range, close) => `\\[${range}${close}`,
|
|
651
|
+
'['
|
|
280
652
|
],
|
|
281
653
|
|
|
282
654
|
// ending
|
|
283
655
|
[
|
|
284
656
|
// 'js' will not match 'js.'
|
|
285
657
|
// 'ab' will not match 'abc'
|
|
286
|
-
|
|
658
|
+
DIRECT,
|
|
287
659
|
|
|
288
660
|
// WTF!
|
|
289
661
|
// https://git-scm.com/docs/gitignore
|
|
@@ -297,70 +669,359 @@ const REPLACERS = [
|
|
|
297
669
|
// 'js*' will not match 'a.js'
|
|
298
670
|
// 'js/' will not match 'a.js'
|
|
299
671
|
// 'js' will match 'a.js' and 'a.js/'
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
//
|
|
304
|
-
|
|
672
|
+
source => {
|
|
673
|
+
const last = source[source.length - 1]
|
|
674
|
+
|
|
675
|
+
// The pattern is empty, or ends in a pending marker `_make` owns --
|
|
676
|
+
// the trailing wildcard, or a trailing "/**". A trailing `*` that is
|
|
677
|
+
// not the marker is a literal star, which anchors like any other
|
|
678
|
+
// final character.
|
|
679
|
+
if (!last || last === TRAILING_WILDCARD || last === TRAILING_DOUBLESTAR) {
|
|
680
|
+
return source
|
|
681
|
+
}
|
|
682
|
+
|
|
683
|
+
return last === SLASH
|
|
684
|
+
// foo/ will not match 'foo'
|
|
685
|
+
? `${source}$`
|
|
686
|
+
// foo matches 'foo' and 'foo/'
|
|
687
|
+
: `${source}(?=$|\\/$)`
|
|
688
|
+
}
|
|
305
689
|
]
|
|
306
690
|
]
|
|
307
691
|
|
|
308
|
-
const REGEX_REPLACE_TRAILING_WILDCARD = /(^|\\\/)
|
|
692
|
+
const REGEX_REPLACE_TRAILING_WILDCARD = /(^|\\\/)?\uE000$/
|
|
309
693
|
const MODE_IGNORE = 'regex'
|
|
310
694
|
const MODE_CHECK_IGNORE = 'checkRegex'
|
|
311
695
|
const UNDERSCORE = '_'
|
|
312
696
|
|
|
313
|
-
const
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
// '/*' does not match everything
|
|
697
|
+
const replaceTrailingWildcard = (_, p1) => {
|
|
698
|
+
const prefix = p1
|
|
699
|
+
// '\^':
|
|
700
|
+
// '/*' does not match EMPTY
|
|
701
|
+
// '/*' does not match everything
|
|
319
702
|
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
703
|
+
// '\\\/':
|
|
704
|
+
// 'abc/*' does not match 'abc/'
|
|
705
|
+
? `${p1}[^/]+`
|
|
706
|
+
|
|
707
|
+
// 'a*' matches 'a'
|
|
708
|
+
// 'a*' matches 'aa'
|
|
709
|
+
: '[^/]*'
|
|
710
|
+
|
|
711
|
+
return `${prefix}(?=$|\\/$)`
|
|
712
|
+
}
|
|
323
713
|
|
|
324
|
-
|
|
325
|
-
// 'a*' matches 'aa'
|
|
326
|
-
: '[^/]*'
|
|
714
|
+
const REGEX_REPLACE_TRAILING_DOUBLESTAR = /\uE001$/
|
|
327
715
|
|
|
328
|
-
|
|
329
|
-
|
|
716
|
+
// 'abc/**' matches everything under 'abc', but not 'abc/' itself (#21)
|
|
717
|
+
const replaceTrailingDoublestar = () => '.+(?=$|\\/$)'
|
|
330
718
|
|
|
331
|
-
|
|
332
|
-
// When doing `git check-ignore`
|
|
333
|
-
const prefix = p1
|
|
334
|
-
// '\\\/':
|
|
335
|
-
// 'abc/*' DOES match 'abc/' !
|
|
336
|
-
? `${p1}[^/]*`
|
|
719
|
+
const WILDCARD = '[^\\/]*'
|
|
337
720
|
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
721
|
+
// The fixed piece between the wildcard at `at` and the next wildcard of the
|
|
722
|
+
// run: the tokens that separate them, joined as they appear in the source.
|
|
723
|
+
// A run never holds two wildcards in a row, so there is always at least one
|
|
724
|
+
// token.
|
|
725
|
+
const separatorAfter = (run, at) => {
|
|
726
|
+
let separator = EMPTY
|
|
341
727
|
|
|
342
|
-
|
|
728
|
+
for (let index = at + 1; index < run.length && !run[index].wildcard; index ++) {
|
|
729
|
+
separator += run[index].single
|
|
343
730
|
}
|
|
731
|
+
|
|
732
|
+
return separator
|
|
733
|
+
}
|
|
734
|
+
|
|
735
|
+
// Where a run of non-slash wildcards is split by fixed pieces --
|
|
736
|
+
// `[^/]*ab[^/]*cd...` -- the engine has many equivalent ways to lay the
|
|
737
|
+
// input across the wildcards, and on input that does not match it works
|
|
738
|
+
// through all of them, so the time grows with the number of wildcards
|
|
739
|
+
// rather than the length of the path. Every wildcard but the last in such a
|
|
740
|
+
// run can be pinned to stop where the piece after it begins, which leaves
|
|
741
|
+
// one way to lay out the input and no rewinding, without changing which
|
|
742
|
+
// paths match: the fixed pieces still bound the count, and the last
|
|
743
|
+
// wildcard still absorbs the rest.
|
|
744
|
+
//
|
|
745
|
+
// A wildcard is pinned to the whole piece, never to the piece's first
|
|
746
|
+
// character. The pin leaves no way back, so a wildcard that stopped at that
|
|
747
|
+
// first character would hand over wherever the character happens to turn
|
|
748
|
+
// up, including the places the rest of the piece cannot follow -- which is
|
|
749
|
+
// how `f*o/*/*` came to miss `foo/b/c`, the first `o` of `foo` not being
|
|
750
|
+
// the one the `o/` after it needs. Every token of a piece matches exactly
|
|
751
|
+
// one character, so the first place the whole piece fits is the leftmost
|
|
752
|
+
// place it can sit, and whatever is left over goes to the wildcards that
|
|
753
|
+
// follow.
|
|
754
|
+
//
|
|
755
|
+
// The source is read one token at a time -- a wildcard, a single-character
|
|
756
|
+
// piece (a literal, an escape, a class), or a parenthesised group or anchor
|
|
757
|
+
// that ends the run -- so only a genuine wildcard is touched.
|
|
758
|
+
const pinWildcards = source => {
|
|
759
|
+
if (source.indexOf(WILDCARD) < 0) {
|
|
760
|
+
return source
|
|
761
|
+
}
|
|
762
|
+
|
|
763
|
+
const tokens = []
|
|
764
|
+
const {length} = source
|
|
765
|
+
let index = 0
|
|
766
|
+
|
|
767
|
+
while (index < length) {
|
|
768
|
+
const char = source[index]
|
|
769
|
+
|
|
770
|
+
if (source.startsWith(WILDCARD, index)) {
|
|
771
|
+
tokens.push({wildcard: true})
|
|
772
|
+
index += WILDCARD.length
|
|
773
|
+
} else if (char === '[') {
|
|
774
|
+
let end = index + 1
|
|
775
|
+
|
|
776
|
+
if (source[end] === '^') {
|
|
777
|
+
end ++
|
|
778
|
+
}
|
|
779
|
+
|
|
780
|
+
if (source[end] === ']') {
|
|
781
|
+
end ++
|
|
782
|
+
}
|
|
783
|
+
|
|
784
|
+
while (end < length && source[end] !== ']') {
|
|
785
|
+
end += source[end] === ESCAPE
|
|
786
|
+
? 2
|
|
787
|
+
: 1
|
|
788
|
+
}
|
|
789
|
+
|
|
790
|
+
end ++
|
|
791
|
+
tokens.push({single: source.slice(index, end)})
|
|
792
|
+
index = end
|
|
793
|
+
} else if (char === ESCAPE) {
|
|
794
|
+
tokens.push({single: source.slice(index, index + 2)})
|
|
795
|
+
index += 2
|
|
796
|
+
} else if (char === '(') {
|
|
797
|
+
let depth = 0
|
|
798
|
+
let end = index
|
|
799
|
+
|
|
800
|
+
do {
|
|
801
|
+
if (source[end] === ESCAPE) {
|
|
802
|
+
end ++
|
|
803
|
+
} else if (source[end] === '(') {
|
|
804
|
+
depth ++
|
|
805
|
+
} else if (source[end] === ')') {
|
|
806
|
+
depth --
|
|
807
|
+
}
|
|
808
|
+
|
|
809
|
+
end ++
|
|
810
|
+
} while (end < length && depth > 0)
|
|
811
|
+
|
|
812
|
+
if ('*+?'.indexOf(source[end]) >= 0) {
|
|
813
|
+
end ++
|
|
814
|
+
}
|
|
815
|
+
|
|
816
|
+
tokens.push({boundary: source.slice(index, end)})
|
|
817
|
+
index = end
|
|
818
|
+
} else if (char === '^' || char === '$') {
|
|
819
|
+
tokens.push({boundary: char})
|
|
820
|
+
index ++
|
|
821
|
+
} else {
|
|
822
|
+
tokens.push({single: char})
|
|
823
|
+
index ++
|
|
824
|
+
}
|
|
825
|
+
}
|
|
826
|
+
|
|
827
|
+
let out = EMPTY
|
|
828
|
+
let run = []
|
|
829
|
+
|
|
830
|
+
const flush = () => {
|
|
831
|
+
let lastWildcard
|
|
832
|
+
|
|
833
|
+
run.forEach((token, at) => {
|
|
834
|
+
if (token.wildcard) {
|
|
835
|
+
lastWildcard = at
|
|
836
|
+
}
|
|
837
|
+
})
|
|
838
|
+
|
|
839
|
+
run.forEach((token, at) => {
|
|
840
|
+
if (!token.wildcard) {
|
|
841
|
+
out += token.single
|
|
842
|
+
return
|
|
843
|
+
}
|
|
844
|
+
|
|
845
|
+
// Every wildcard but the last is pinned to the whole piece that
|
|
846
|
+
// follows it, for the reason set out above this function. The last
|
|
847
|
+
// one stays as it is and takes up the rest.
|
|
848
|
+
out += at === lastWildcard
|
|
849
|
+
? WILDCARD
|
|
850
|
+
: `(?:(?!${separatorAfter(run, at)})[^\\/])*`
|
|
851
|
+
})
|
|
852
|
+
|
|
853
|
+
run = []
|
|
854
|
+
}
|
|
855
|
+
|
|
856
|
+
tokens.forEach(token => {
|
|
857
|
+
if (token.boundary === undefined) {
|
|
858
|
+
run.push(token)
|
|
859
|
+
return
|
|
860
|
+
}
|
|
861
|
+
|
|
862
|
+
flush()
|
|
863
|
+
out += token.boundary
|
|
864
|
+
})
|
|
865
|
+
|
|
866
|
+
flush()
|
|
867
|
+
|
|
868
|
+
return out
|
|
344
869
|
}
|
|
345
870
|
|
|
346
871
|
// @param {pattern}
|
|
347
|
-
const makeRegexPrefix = pattern =>
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
872
|
+
const makeRegexPrefix = pattern => {
|
|
873
|
+
// `/**` matches every path, as `**` does. The translation below only finds
|
|
874
|
+
// a globstar beside a slash it keeps, and the leading one is turned into
|
|
875
|
+
// an anchor, so `/**` would come out as `/*` and match one level only.
|
|
876
|
+
// Here rather than in `createRule`, so that `checkSourceOf`, which
|
|
877
|
+
// compiles `/**/` again without its trailing slash, gets it too.
|
|
878
|
+
if (REGEX_ANCHORED_GLOBSTAR.test(pattern)) {
|
|
879
|
+
pattern = '**'
|
|
880
|
+
}
|
|
881
|
+
|
|
882
|
+
const {source, sources} = extractBrackets(pattern)
|
|
883
|
+
|
|
884
|
+
const replaced = REPLACERS.reduce(
|
|
885
|
+
// A pass whose matcher finds nothing hands back the very string it was
|
|
886
|
+
// given, so asking first costs a search and saves a rewrite. Ten of the
|
|
887
|
+
// fifteen passes never fire for a typical .gitignore line, and between
|
|
888
|
+
// them they were 45% of this chain.
|
|
889
|
+
(prev, [matcher, replacer, required]) => {
|
|
890
|
+
if (matcher === DIRECT) {
|
|
891
|
+
return replacer(prev, pattern)
|
|
892
|
+
}
|
|
893
|
+
|
|
894
|
+
if (required !== UNDEFINED && prev.indexOf(required) < 0) {
|
|
895
|
+
return prev
|
|
896
|
+
}
|
|
897
|
+
|
|
898
|
+
// A pass whose matcher finds nothing hands back the very string it was
|
|
899
|
+
// given, so asking first costs a search and saves a rewrite.
|
|
900
|
+
return matcher.test(prev)
|
|
901
|
+
? prev.replace(matcher, replacer.bind(pattern))
|
|
902
|
+
: prev
|
|
903
|
+
},
|
|
904
|
+
source
|
|
905
|
+
)
|
|
906
|
+
|
|
907
|
+
// Most patterns hold no bracket expression at all, and then there is
|
|
908
|
+
// nothing to put back.
|
|
909
|
+
return sources.length
|
|
910
|
+
? replaced.replace(
|
|
911
|
+
REGEX_RESTORE_PLACEHOLDER,
|
|
912
|
+
(match, index) => sources[index]
|
|
913
|
+
)
|
|
914
|
+
: replaced
|
|
915
|
+
}
|
|
916
|
+
|
|
917
|
+
// `checkRegex` tests a path with a trailing slash, 'abc/', the way
|
|
918
|
+
// `git check-ignore` matches that literal string once the directory itself
|
|
919
|
+
// is known not to be excluded (see `checkIgnore`): a trailing '/' of the
|
|
920
|
+
// pattern is dropped, a basename pattern sees an empty basename, and only a
|
|
921
|
+
// pattern whose last segment is a pending wildcard can match what is left
|
|
922
|
+
// after the final slash -- 'abc/*' and 'abc/**' match 'abc/', and 'abc/**'
|
|
923
|
+
// also matches 'abc/d/' (#77, #169).
|
|
924
|
+
const checkSourceOf = (body, prefix) => {
|
|
925
|
+
if (body[body.length - 1] === SLASH) {
|
|
926
|
+
prefix = makeRegexPrefix(body.slice(0, - 1))
|
|
927
|
+
}
|
|
928
|
+
|
|
929
|
+
const head = prefix.slice(0, - 1)
|
|
930
|
+
const last = prefix[prefix.length - 1]
|
|
931
|
+
|
|
932
|
+
return last === TRAILING_WILDCARD
|
|
933
|
+
? `${head}$`
|
|
934
|
+
: last === TRAILING_DOUBLESTAR
|
|
935
|
+
? `${head}.*$`
|
|
936
|
+
: NEVER_MATCH
|
|
937
|
+
}
|
|
938
|
+
|
|
939
|
+
// A trailing slash does not stop a pattern being basename-only: it restricts
|
|
940
|
+
// the match to a directory, it does not let the pattern reach across one.
|
|
941
|
+
// Everything else a pattern can hold -- a wildcard, a character class, an
|
|
942
|
+
// escape -- stays inside a single path segment too, so a pattern with no
|
|
943
|
+
// separator in it can only ever describe the last one.
|
|
944
|
+
const matchesBasename = body => {
|
|
945
|
+
const index = body.indexOf(SLASH)
|
|
946
|
+
|
|
947
|
+
return index < 0 || index === body.length - 1
|
|
948
|
+
}
|
|
949
|
+
|
|
950
|
+
// The last segment of a path, keeping a trailing slash, because a pattern that
|
|
951
|
+
// ends in one matches only a directory.
|
|
952
|
+
// 'a/b/c.js' -> 'c.js'; 'a/b/' -> 'b/'; 'c.js' -> 'c.js' (no copy made)
|
|
953
|
+
const basenameOf = path => {
|
|
954
|
+
const end = path.length - 1
|
|
955
|
+
|
|
956
|
+
const index = path.lastIndexOf(
|
|
957
|
+
SLASH,
|
|
958
|
+
path[end] === SLASH
|
|
959
|
+
? end - 1
|
|
960
|
+
: end
|
|
961
|
+
)
|
|
962
|
+
|
|
963
|
+
return index < 0
|
|
964
|
+
? path
|
|
965
|
+
: path.slice(index + 1)
|
|
966
|
+
}
|
|
967
|
+
|
|
968
|
+
// The parent directory of a path, with its trailing separator, or EMPTY when
|
|
969
|
+
// the path has none.
|
|
970
|
+
// 'a/b/c' -> 'a/b/'; 'a/b/' -> 'a/'; 'a' -> EMPTY; 'a/' -> EMPTY
|
|
971
|
+
//
|
|
972
|
+
// A path holding an empty segment has to be taken apart, because its
|
|
973
|
+
// ancestors are not prefixes of it: the parent of 'a//b' is 'a/', not
|
|
974
|
+
// 'a//', and the parent of '/a/' is nothing at all. Both shapes reach here
|
|
975
|
+
// -- 'a//b' is accepted outright, and `checkIgnore` does not put the path
|
|
976
|
+
// it is given through the relative-path check.
|
|
977
|
+
//
|
|
978
|
+
// Every other path is a prefix of itself, and cutting one costs a fraction of
|
|
979
|
+
// splitting it into an array and joining that back at every level: 73ns
|
|
980
|
+
// against 207ns.
|
|
981
|
+
const parentOf = path => {
|
|
982
|
+
if (
|
|
983
|
+
path.charCodeAt(0) === SLASH_CODE
|
|
984
|
+
|| path.indexOf(DOUBLE_SLASH) >= 0
|
|
985
|
+
) {
|
|
986
|
+
const slices = path.split(SLASH).filter(Boolean)
|
|
987
|
+
|
|
988
|
+
slices.pop()
|
|
989
|
+
|
|
990
|
+
return slices.length
|
|
991
|
+
? slices.join(SLASH) + SLASH
|
|
992
|
+
: EMPTY
|
|
993
|
+
}
|
|
994
|
+
|
|
995
|
+
const end = path.length - 1
|
|
996
|
+
|
|
997
|
+
// Look back from before a trailing separator, since that one belongs to the
|
|
998
|
+
// path itself.
|
|
999
|
+
//
|
|
1000
|
+
// A negative place to start would be a trap here: `lastIndexOf` clamps one
|
|
1001
|
+
// to 0 and searches there rather than reporting no match, so '/' would
|
|
1002
|
+
// come back as its own parent and the walk would never end. It cannot
|
|
1003
|
+
// happen -- that is the only path short enough to produce one, and the
|
|
1004
|
+
// test above has already sent it the other way.
|
|
1005
|
+
const cut = path.lastIndexOf(
|
|
1006
|
+
SLASH,
|
|
1007
|
+
path.charCodeAt(end) === SLASH_CODE
|
|
1008
|
+
? end - 1
|
|
1009
|
+
: end
|
|
1010
|
+
)
|
|
1011
|
+
|
|
1012
|
+
return cut < 0
|
|
1013
|
+
? EMPTY
|
|
1014
|
+
: path.slice(0, cut + 1)
|
|
1015
|
+
}
|
|
352
1016
|
|
|
353
1017
|
const isString = subject => typeof subject === 'string'
|
|
354
1018
|
|
|
355
|
-
//
|
|
1019
|
+
// Blank lines and comments are told by `createRule`, once the pattern is
|
|
1020
|
+
// normalized.
|
|
356
1021
|
const checkPattern = pattern => pattern
|
|
357
1022
|
&& isString(pattern)
|
|
358
|
-
&& !REGEX_TEST_BLANK_LINE.test(pattern)
|
|
359
1023
|
&& !REGEX_INVALID_TRAILING_BACKSLASH.test(pattern)
|
|
360
1024
|
|
|
361
|
-
// > A line starting with # serves as a comment.
|
|
362
|
-
&& pattern.indexOf('#') !== 0
|
|
363
|
-
|
|
364
1025
|
const splitPattern = pattern => pattern
|
|
365
1026
|
.split(REGEX_SPLITALL_CRLF)
|
|
366
1027
|
.filter(Boolean)
|
|
@@ -383,6 +1044,15 @@ class IgnoreRule {
|
|
|
383
1044
|
define(this, 'regexPrefix', prefix)
|
|
384
1045
|
}
|
|
385
1046
|
|
|
1047
|
+
// Worked out on first use and kept behind an own property, the way `regex`
|
|
1048
|
+
// caches itself in `_regex`. Deciding it in the constructor instead would
|
|
1049
|
+
// add a fourth `defineProperty` to every rule ever built, which cost 4% of
|
|
1050
|
+
// every compile -- including the compiles of rules that are never matched
|
|
1051
|
+
// against anything.
|
|
1052
|
+
get _basenameOnly () {
|
|
1053
|
+
return define(this, '_basenameOnly', matchesBasename(this.body))
|
|
1054
|
+
}
|
|
1055
|
+
|
|
386
1056
|
get regex () {
|
|
387
1057
|
const key = UNDERSCORE + MODE_IGNORE
|
|
388
1058
|
|
|
@@ -404,11 +1074,12 @@ class IgnoreRule {
|
|
|
404
1074
|
}
|
|
405
1075
|
|
|
406
1076
|
_make (mode, key) {
|
|
407
|
-
const str =
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
1077
|
+
const str = pinWildcards(
|
|
1078
|
+
mode === MODE_IGNORE
|
|
1079
|
+
? this.regexPrefix
|
|
1080
|
+
.replace(REGEX_REPLACE_TRAILING_WILDCARD, replaceTrailingWildcard)
|
|
1081
|
+
.replace(REGEX_REPLACE_TRAILING_DOUBLESTAR, replaceTrailingDoublestar)
|
|
1082
|
+
: checkSourceOf(this.body, this.regexPrefix)
|
|
412
1083
|
)
|
|
413
1084
|
|
|
414
1085
|
const regex = this.ignoreCase
|
|
@@ -419,17 +1090,79 @@ class IgnoreRule {
|
|
|
419
1090
|
}
|
|
420
1091
|
}
|
|
421
1092
|
|
|
1093
|
+
const isLineEnd = char => char === '\r' || char === '\n'
|
|
1094
|
+
|
|
1095
|
+
// Drop a line terminator, which can remain when patterns are passed as an
|
|
1096
|
+
// array, and then the trailing spaces. Git trims spaces only, and a space
|
|
1097
|
+
// escaped by an odd run of backslashes stays, unescaped, as the last one.
|
|
1098
|
+
// Scanned from the end: a regular expression can only try each start in
|
|
1099
|
+
// turn, which is quadratic over a long run of spaces or backslashes.
|
|
1100
|
+
// 'a ' -> 'a'; 'a\ ' -> 'a '; 'a\\ ' -> 'a\\'; 'a\t' -> 'a\t'
|
|
1101
|
+
const trimEnd = body => {
|
|
1102
|
+
let end = body.length
|
|
1103
|
+
|
|
1104
|
+
while (end && isLineEnd(body[end - 1])) {
|
|
1105
|
+
end --
|
|
1106
|
+
}
|
|
1107
|
+
|
|
1108
|
+
const lineEnd = end
|
|
1109
|
+
|
|
1110
|
+
while (end && body[end - 1] === SPACE) {
|
|
1111
|
+
end --
|
|
1112
|
+
}
|
|
1113
|
+
|
|
1114
|
+
if (end === lineEnd) {
|
|
1115
|
+
return body.slice(0, end)
|
|
1116
|
+
}
|
|
1117
|
+
|
|
1118
|
+
let backslashes = 0
|
|
1119
|
+
|
|
1120
|
+
while (backslashes < end && body[end - backslashes - 1] === ESCAPE) {
|
|
1121
|
+
backslashes ++
|
|
1122
|
+
}
|
|
1123
|
+
|
|
1124
|
+
return backslashes % 2
|
|
1125
|
+
? body.slice(0, end - 1) + SPACE
|
|
1126
|
+
: body.slice(0, end)
|
|
1127
|
+
}
|
|
1128
|
+
|
|
422
1129
|
const createRule = ({
|
|
423
1130
|
pattern,
|
|
424
1131
|
mark
|
|
425
1132
|
}, ignoreCase) => {
|
|
1133
|
+
// Git drops a BOM before it reads the first line, so before anything else.
|
|
1134
|
+
let body = pattern[0] === BOM
|
|
1135
|
+
? pattern.slice(1)
|
|
1136
|
+
: pattern
|
|
1137
|
+
|
|
1138
|
+
// > A line starting with # serves as a comment.
|
|
1139
|
+
if (body[0] === '#') {
|
|
1140
|
+
return
|
|
1141
|
+
}
|
|
1142
|
+
|
|
426
1143
|
let negative = false
|
|
427
|
-
let body = pattern
|
|
428
1144
|
|
|
429
1145
|
// > An optional prefix "!" which negates the pattern;
|
|
430
|
-
if (body
|
|
1146
|
+
if (body[0] === '!') {
|
|
431
1147
|
negative = true
|
|
432
|
-
body = body.
|
|
1148
|
+
body = body.slice(1)
|
|
1149
|
+
}
|
|
1150
|
+
|
|
1151
|
+
// Normalize the body before checking which slashes anchor the pattern.
|
|
1152
|
+
// Otherwise `bar/ ` is mistaken for a pattern containing an inner slash.
|
|
1153
|
+
// Only a body ending in a space or a line terminator has anything to trim.
|
|
1154
|
+
const last = body[body.length - 1]
|
|
1155
|
+
|
|
1156
|
+
if (last === SPACE || last === '\r' || last === '\n') {
|
|
1157
|
+
body = trimEnd(body)
|
|
1158
|
+
}
|
|
1159
|
+
|
|
1160
|
+
// > A blank line matches no files, so it can serve as a separator for
|
|
1161
|
+
// > readability.
|
|
1162
|
+
// Nor does a lone "!", or anything else left empty here: an empty pattern
|
|
1163
|
+
// would compile to a regex matching every path.
|
|
1164
|
+
if (!body) {
|
|
1165
|
+
return
|
|
433
1166
|
}
|
|
434
1167
|
|
|
435
1168
|
body = body
|
|
@@ -456,12 +1189,28 @@ class RuleManager {
|
|
|
456
1189
|
constructor (ignoreCase) {
|
|
457
1190
|
this._ignoreCase = ignoreCase
|
|
458
1191
|
this._rules = []
|
|
1192
|
+
|
|
1193
|
+
// How many of the rules git would tag `EXC_FLAG_NODIR`.
|
|
1194
|
+
//
|
|
1195
|
+
// The scan uses it to decide, once for the whole set, whether handing
|
|
1196
|
+
// those rules the basename is worth what it costs the others. The
|
|
1197
|
+
// shortcut saves a full-path scan on every rule it applies to and costs
|
|
1198
|
+
// a check on every rule it does not, so a set where almost nothing is
|
|
1199
|
+
// basename-only comes out behind -- a 955 pattern set with 44 of them
|
|
1200
|
+
// measured 19% slower with the shortcut always on.
|
|
1201
|
+
//
|
|
1202
|
+
// Deciding this by measurement rather than by meaning is safe: a
|
|
1203
|
+
// basename-only pattern gives the very same answer against the whole
|
|
1204
|
+
// path, it just takes longer to say so. The choice can only change how
|
|
1205
|
+
// fast the scan runs, never what it returns.
|
|
1206
|
+
this._basenameCount = 0
|
|
459
1207
|
}
|
|
460
1208
|
|
|
461
1209
|
_add (pattern) {
|
|
462
1210
|
// #32
|
|
463
1211
|
if (pattern && pattern[KEY_IGNORE]) {
|
|
464
1212
|
this._rules = this._rules.concat(pattern._rules._rules)
|
|
1213
|
+
this._basenameCount += pattern._rules._basenameCount
|
|
465
1214
|
this._added = true
|
|
466
1215
|
return
|
|
467
1216
|
}
|
|
@@ -472,10 +1221,19 @@ class RuleManager {
|
|
|
472
1221
|
}
|
|
473
1222
|
}
|
|
474
1223
|
|
|
475
|
-
|
|
476
|
-
|
|
1224
|
+
const rule = checkPattern(pattern.pattern)
|
|
1225
|
+
&& createRule(pattern, this._ignoreCase)
|
|
1226
|
+
|
|
1227
|
+
if (rule) {
|
|
477
1228
|
this._added = true
|
|
478
1229
|
this._rules.push(rule)
|
|
1230
|
+
|
|
1231
|
+
// Deliberately not `rule._basenameOnly`: reading that would materialise
|
|
1232
|
+
// the rule's own copy, and the whole point of leaving it lazy is that
|
|
1233
|
+
// a rule which is compiled and never matched never pays for it.
|
|
1234
|
+
if (matchesBasename(rule.body)) {
|
|
1235
|
+
this._basenameCount ++
|
|
1236
|
+
}
|
|
479
1237
|
}
|
|
480
1238
|
}
|
|
481
1239
|
|
|
@@ -489,56 +1247,41 @@ class RuleManager {
|
|
|
489
1247
|
: pattern
|
|
490
1248
|
).forEach(this._add, this)
|
|
491
1249
|
|
|
1250
|
+
if (this._added) {
|
|
1251
|
+
this._literalRules = UNDEFINED
|
|
1252
|
+
}
|
|
1253
|
+
|
|
492
1254
|
return this._added
|
|
493
1255
|
}
|
|
494
1256
|
|
|
495
|
-
//
|
|
496
|
-
//
|
|
497
|
-
//
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
1257
|
+
// Match the literal 'abc/' for `checkIgnore`, last rule wins. Only a rule
|
|
1258
|
+
// ending in a wildcard can match it (see `checkSourceOf`), so the rest
|
|
1259
|
+
// are left out once, rather than tested or compiled for every path.
|
|
1260
|
+
testLiteral (path) {
|
|
1261
|
+
const rules = this._literalRules || (
|
|
1262
|
+
this._literalRules = this._rules.filter(
|
|
1263
|
+
({body}) => body[body.length - (
|
|
1264
|
+
body[body.length - 1] === SLASH ? 2 : 1
|
|
1265
|
+
)] === '*'
|
|
1266
|
+
)
|
|
1267
|
+
)
|
|
501
1268
|
|
|
502
|
-
// @returns {TestResult} true if a file is ignored
|
|
503
|
-
test (path, checkUnignored, mode) {
|
|
504
1269
|
let ignored = false
|
|
505
1270
|
let unignored = false
|
|
506
1271
|
let matchedRule
|
|
507
1272
|
|
|
508
|
-
|
|
509
|
-
const
|
|
1273
|
+
for (let index = rules.length - 1; index >= 0; index --) {
|
|
1274
|
+
const rule = rules[index]
|
|
510
1275
|
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
// - SKIP: always skip
|
|
519
|
-
// - TEST: always test
|
|
520
|
-
// - TESTIF: only test if checkUnignored
|
|
521
|
-
// - X: that never happen
|
|
522
|
-
if (
|
|
523
|
-
unignored === negative && ignored !== unignored
|
|
524
|
-
|| negative && !ignored && !unignored && !checkUnignored
|
|
525
|
-
) {
|
|
526
|
-
return
|
|
1276
|
+
if (rule.checkRegex.test(path)) {
|
|
1277
|
+
ignored = !rule.negative
|
|
1278
|
+
unignored = rule.negative
|
|
1279
|
+
matchedRule = rule.negative
|
|
1280
|
+
? UNDEFINED
|
|
1281
|
+
: rule
|
|
1282
|
+
break
|
|
527
1283
|
}
|
|
528
|
-
|
|
529
|
-
const matched = rule[mode].test(path)
|
|
530
|
-
|
|
531
|
-
if (!matched) {
|
|
532
|
-
return
|
|
533
|
-
}
|
|
534
|
-
|
|
535
|
-
ignored = !negative
|
|
536
|
-
unignored = negative
|
|
537
|
-
|
|
538
|
-
matchedRule = negative
|
|
539
|
-
? UNDEFINED
|
|
540
|
-
: rule
|
|
541
|
-
})
|
|
1284
|
+
}
|
|
542
1285
|
|
|
543
1286
|
const ret = {
|
|
544
1287
|
ignored,
|
|
@@ -551,6 +1294,62 @@ class RuleManager {
|
|
|
551
1294
|
|
|
552
1295
|
return ret
|
|
553
1296
|
}
|
|
1297
|
+
|
|
1298
|
+
// Test one single path without recursively checking parent directories
|
|
1299
|
+
//
|
|
1300
|
+
// - mode `string` either `MODE_IGNORE` or `MODE_CHECK_IGNORE`
|
|
1301
|
+
|
|
1302
|
+
// @returns {TestResult}
|
|
1303
|
+
test (path, mode) {
|
|
1304
|
+
// Most of a .gitignore is patterns with no slash in them, and running
|
|
1305
|
+
// those against the whole path makes the regular expression engine walk
|
|
1306
|
+
// every directory name on the way to the only segment that could match.
|
|
1307
|
+
// Handing them the basename instead is what git does, and it is where
|
|
1308
|
+
// the time in a directory walk goes: the rule scan was two thirds of it.
|
|
1309
|
+
const rules = this._rules
|
|
1310
|
+
const {length} = rules
|
|
1311
|
+
|
|
1312
|
+
const shortcut = this._basenameCount * 2 >= length
|
|
1313
|
+
|
|
1314
|
+
const basename = shortcut
|
|
1315
|
+
? basenameOf(path)
|
|
1316
|
+
: path
|
|
1317
|
+
|
|
1318
|
+
// The last rule to match decides, as in git, and it is the rule
|
|
1319
|
+
// `git check-ignore -v` reports, so the scan runs from the end and stops
|
|
1320
|
+
// at the first match.
|
|
1321
|
+
// A plain loop rather than `forEach`, so that `path`, `basename` and
|
|
1322
|
+
// `shortcut` are locals. As a callback they became closure variables,
|
|
1323
|
+
// and reaching for one of those once per rule cost 10% of a scan over a
|
|
1324
|
+
// large rule set -- more than the shortcut they were there to serve.
|
|
1325
|
+
for (let index = length - 1; index >= 0; index --) {
|
|
1326
|
+
const rule = rules[index]
|
|
1327
|
+
|
|
1328
|
+
if (rule[mode].test(
|
|
1329
|
+
shortcut && rule._basenameOnly
|
|
1330
|
+
? basename
|
|
1331
|
+
: path
|
|
1332
|
+
)) {
|
|
1333
|
+
const {negative} = rule
|
|
1334
|
+
|
|
1335
|
+
const ret = {
|
|
1336
|
+
ignored: !negative,
|
|
1337
|
+
unignored: negative
|
|
1338
|
+
}
|
|
1339
|
+
|
|
1340
|
+
if (!negative) {
|
|
1341
|
+
ret.rule = rule
|
|
1342
|
+
}
|
|
1343
|
+
|
|
1344
|
+
return ret
|
|
1345
|
+
}
|
|
1346
|
+
}
|
|
1347
|
+
|
|
1348
|
+
return {
|
|
1349
|
+
ignored: false,
|
|
1350
|
+
unignored: false
|
|
1351
|
+
}
|
|
1352
|
+
}
|
|
554
1353
|
}
|
|
555
1354
|
|
|
556
1355
|
const throwError = (message, Ctor) => {
|
|
@@ -582,7 +1381,43 @@ const checkPath = (path, originalPath, doThrow) => {
|
|
|
582
1381
|
return true
|
|
583
1382
|
}
|
|
584
1383
|
|
|
585
|
-
|
|
1384
|
+
// > pathname should be a `path.relative()`d one
|
|
1385
|
+
//
|
|
1386
|
+
// The same thing `REGEX_TEST_INVALID_PATH` says, spelled out: a path is not
|
|
1387
|
+
// relative if it begins with a separator, or with `./` or `../`, or is
|
|
1388
|
+
// nothing but `.` or `..`. Every match is decided by the first three
|
|
1389
|
+
// characters, and this runs on every path handed to the library -- where it
|
|
1390
|
+
// was 55% of a cached lookup, more than the cache lookup itself.
|
|
1391
|
+
const isNotRelative = path => {
|
|
1392
|
+
const first = path.charCodeAt(0)
|
|
1393
|
+
|
|
1394
|
+
if (first === SLASH_CODE) {
|
|
1395
|
+
return true
|
|
1396
|
+
}
|
|
1397
|
+
|
|
1398
|
+
if (first !== DOT_CODE) {
|
|
1399
|
+
return false
|
|
1400
|
+
}
|
|
1401
|
+
|
|
1402
|
+
// '.'
|
|
1403
|
+
if (path.length === 1) {
|
|
1404
|
+
return true
|
|
1405
|
+
}
|
|
1406
|
+
|
|
1407
|
+
const second = path.charCodeAt(1)
|
|
1408
|
+
|
|
1409
|
+
// './'
|
|
1410
|
+
if (second === SLASH_CODE) {
|
|
1411
|
+
return true
|
|
1412
|
+
}
|
|
1413
|
+
|
|
1414
|
+
if (second !== DOT_CODE) {
|
|
1415
|
+
return false
|
|
1416
|
+
}
|
|
1417
|
+
|
|
1418
|
+
// '..' or '../'
|
|
1419
|
+
return path.length === 2 || path.charCodeAt(2) === SLASH_CODE
|
|
1420
|
+
}
|
|
586
1421
|
|
|
587
1422
|
checkPath.isNotRelative = isNotRelative
|
|
588
1423
|
|
|
@@ -629,7 +1464,7 @@ class Ignore {
|
|
|
629
1464
|
}
|
|
630
1465
|
|
|
631
1466
|
// @returns {TestResult}
|
|
632
|
-
_test (originalPath, cache
|
|
1467
|
+
_test (originalPath, cache) {
|
|
633
1468
|
const path = originalPath
|
|
634
1469
|
// Supports nullable path
|
|
635
1470
|
&& checkPath.convert(originalPath)
|
|
@@ -642,33 +1477,30 @@ class Ignore {
|
|
|
642
1477
|
: RETURN_FALSE
|
|
643
1478
|
)
|
|
644
1479
|
|
|
645
|
-
return this._t(path, cache
|
|
1480
|
+
return this._t(path, cache)
|
|
646
1481
|
}
|
|
647
1482
|
|
|
648
1483
|
checkIgnore (path) {
|
|
649
1484
|
// If the path doest not end with a slash, `.ignores()` is much equivalent
|
|
650
1485
|
// to `git check-ignore`
|
|
651
|
-
if (
|
|
1486
|
+
if (path.charCodeAt(path.length - 1) !== SLASH_CODE) {
|
|
652
1487
|
return this.test(path)
|
|
653
1488
|
}
|
|
654
1489
|
|
|
655
|
-
|
|
656
|
-
|
|
1490
|
+
// Like `git check-ignore`: a directory excluded by itself or by an
|
|
1491
|
+
// ancestor settles it, and only then is the literal 'abc/' matched
|
|
1492
|
+
// against the rules (see `checkSourceOf`).
|
|
1493
|
+
const dir = this._t(path, this._testCache)
|
|
657
1494
|
|
|
658
|
-
if (
|
|
659
|
-
|
|
660
|
-
slices.join(SLASH) + SLASH,
|
|
661
|
-
this._testCache,
|
|
662
|
-
true,
|
|
663
|
-
slices
|
|
664
|
-
)
|
|
665
|
-
|
|
666
|
-
if (parent.ignored) {
|
|
667
|
-
return parent
|
|
668
|
-
}
|
|
1495
|
+
if (dir.ignored) {
|
|
1496
|
+
return dir
|
|
669
1497
|
}
|
|
670
1498
|
|
|
671
|
-
|
|
1499
|
+
const literal = this._rules.testLiteral(path)
|
|
1500
|
+
|
|
1501
|
+
return literal.ignored || literal.unignored
|
|
1502
|
+
? literal
|
|
1503
|
+
: dir
|
|
672
1504
|
}
|
|
673
1505
|
|
|
674
1506
|
_t (
|
|
@@ -676,48 +1508,28 @@ class Ignore {
|
|
|
676
1508
|
path,
|
|
677
1509
|
|
|
678
1510
|
// The cache for the result of a certain checking
|
|
679
|
-
cache
|
|
680
|
-
|
|
681
|
-
// Whether should check if the path is unignored
|
|
682
|
-
checkUnignored,
|
|
683
|
-
|
|
684
|
-
// The path slices
|
|
685
|
-
slices
|
|
1511
|
+
cache
|
|
686
1512
|
) {
|
|
687
1513
|
if (path in cache) {
|
|
688
1514
|
return cache[path]
|
|
689
1515
|
}
|
|
690
1516
|
|
|
691
|
-
|
|
692
|
-
// path/to/a.js
|
|
693
|
-
// ['path', 'to', 'a.js']
|
|
694
|
-
slices = path.split(SLASH).filter(Boolean)
|
|
695
|
-
}
|
|
696
|
-
|
|
697
|
-
slices.pop()
|
|
698
|
-
|
|
699
|
-
// If the path has no parent directory, just test it
|
|
700
|
-
if (!slices.length) {
|
|
701
|
-
return cache[path] = this._rules.test(path, checkUnignored, MODE_IGNORE)
|
|
702
|
-
}
|
|
703
|
-
|
|
704
|
-
const parent = this._t(
|
|
705
|
-
slices.join(SLASH) + SLASH,
|
|
706
|
-
cache,
|
|
707
|
-
checkUnignored,
|
|
708
|
-
slices
|
|
709
|
-
)
|
|
1517
|
+
const parentPath = parentOf(path)
|
|
710
1518
|
|
|
711
1519
|
// If the path contains a parent directory, check the parent first
|
|
712
|
-
|
|
1520
|
+
const parent = parentPath
|
|
1521
|
+
? this._t(parentPath, cache)
|
|
1522
|
+
: UNDEFINED
|
|
1523
|
+
|
|
1524
|
+
return cache[path] = parent && parent.ignored
|
|
713
1525
|
// > It is not possible to re-include a file if a parent directory of
|
|
714
1526
|
// > that file is excluded.
|
|
715
1527
|
? parent
|
|
716
|
-
: this._rules.test(path,
|
|
1528
|
+
: this._rules.test(path, MODE_IGNORE)
|
|
717
1529
|
}
|
|
718
1530
|
|
|
719
1531
|
ignores (path) {
|
|
720
|
-
return this._test(path, this._ignoreCache
|
|
1532
|
+
return this._test(path, this._ignoreCache).ignored
|
|
721
1533
|
}
|
|
722
1534
|
|
|
723
1535
|
createFilter () {
|
|
@@ -730,7 +1542,7 @@ class Ignore {
|
|
|
730
1542
|
|
|
731
1543
|
// @returns {TestResult}
|
|
732
1544
|
test (path) {
|
|
733
|
-
return this._test(path, this._testCache
|
|
1545
|
+
return this._test(path, this._testCache)
|
|
734
1546
|
}
|
|
735
1547
|
}
|
|
736
1548
|
|