nexus-agents 14.0.0 → 14.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ast-rule-runner-3PYXOOLH.js → ast-rule-runner-2PEUHSHO.js} +5 -5
- package/dist/{child-mcp-config-AKQYBMMC.js → child-mcp-config-AYVMLJDV.js} +4 -4
- package/dist/{chunk-YKCJJP5X.js → chunk-236T3AOZ.js} +4 -4
- package/dist/{chunk-GCD3OFFM.js → chunk-5QNWRC7B.js} +2 -2
- package/dist/{chunk-LD6QCSHT.js → chunk-B5RDZLU3.js} +4 -4
- package/dist/{chunk-UZZHLCYW.js → chunk-CZSEUZFE.js} +2 -2
- package/dist/{chunk-6FBREJER.js → chunk-DCPN7F5J.js} +2 -2
- package/dist/{chunk-XRMP4PP4.js → chunk-DXDKAVWV.js} +5 -5
- package/dist/{chunk-K5MAYIHL.js → chunk-FEAWCZ7E.js} +2 -2
- package/dist/{chunk-FLIBWADL.js → chunk-GDCIDLUF.js} +36 -25
- package/dist/chunk-GDCIDLUF.js.map +1 -0
- package/dist/{chunk-CUPOUBBN.js → chunk-GPZQVYKV.js} +2 -2
- package/dist/{chunk-IBGLJEW7.js → chunk-GR4BMQAS.js} +9 -7
- package/dist/chunk-GR4BMQAS.js.map +1 -0
- package/dist/{chunk-MB2UUFF7.js → chunk-H6SGSQJM.js} +2 -2
- package/dist/{chunk-KVFNI2UZ.js → chunk-HJJRUYNR.js} +7 -6
- package/dist/chunk-HJJRUYNR.js.map +1 -0
- package/dist/{chunk-AJBRMUGK.js → chunk-IZSJWIHK.js} +40 -9
- package/dist/chunk-IZSJWIHK.js.map +1 -0
- package/dist/{chunk-K6CUB3IV.js → chunk-JV3UBRRA.js} +2 -2
- package/dist/{chunk-6EUYMTVU.js → chunk-KXWLZDQR.js} +5 -5
- package/dist/{chunk-CQ6FAAOO.js → chunk-LBVPKHHU.js} +3 -3
- package/dist/{chunk-EFE6ORME.js → chunk-LC34UPDQ.js} +2 -2
- package/dist/{chunk-NA55VLER.js → chunk-LE6TQVXF.js} +2 -2
- package/dist/{chunk-KZ5R5HL7.js → chunk-MFUJU7RO.js} +3 -3
- package/dist/{chunk-7S6ANELD.js → chunk-MQSSTTZU.js} +4 -4
- package/dist/{chunk-CP73UYNV.js → chunk-OQR2C64M.js} +5 -5
- package/dist/{chunk-UBCGX47E.js → chunk-P3CFDAW5.js} +2 -2
- package/dist/{chunk-G2MC6WXA.js → chunk-PG6NTUTS.js} +8 -8
- package/dist/{chunk-HQMIDROO.js → chunk-PQ3V2SYP.js} +2 -2
- package/dist/{chunk-36B7J7CZ.js → chunk-Q6R3JTXH.js} +3 -3
- package/dist/{chunk-PI54VS4I.js → chunk-SNSV6GGV.js} +10 -10
- package/dist/{chunk-BSGMAUA4.js → chunk-SQPFJLCI.js} +3 -3
- package/dist/{chunk-7VMEUGNV.js → chunk-TV6RX3ZL.js} +4 -4
- package/dist/{chunk-7BKOWPKX.js → chunk-TYIIAIXA.js} +7 -7
- package/dist/{chunk-2A4P2DX3.js → chunk-VH4T4O5L.js} +2 -2
- package/dist/{chunk-ABTRD52Y.js → chunk-WWBYNWYB.js} +4 -4
- package/dist/{chunk-BELY4VU4.js → chunk-YE3T4X2U.js} +4 -4
- package/dist/{chunk-XU6N5OKA.js → chunk-YSEMHACQ.js} +36 -37
- package/dist/{chunk-XU6N5OKA.js.map → chunk-YSEMHACQ.js.map} +1 -1
- package/dist/{cli-circuit-breaker-37UQWOAA.js → cli-circuit-breaker-HWMTEEYI.js} +5 -5
- package/dist/{cli-readiness-RSBS6FN3.js → cli-readiness-6C6E2T2O.js} +9 -9
- package/dist/{cli-server-gateway-C5QPDUWS.js → cli-server-gateway-HHRF22EB.js} +14 -14
- package/dist/cli.js +505 -409
- package/dist/cli.js.map +1 -1
- package/dist/{composite-router-WERJYE7X.js → composite-router-CX2W7RVA.js} +4 -4
- package/dist/{consensus-vote-G2MKNTMW.js → consensus-vote-CQGIWMYY.js} +17 -17
- package/dist/{context-retriever-H34LHPWB.js → context-retriever-G4LMWEN5.js} +10 -10
- package/dist/{doctor-deep-XBUWYYXO.js → doctor-deep-VOX7KVGK.js} +5 -5
- package/dist/{doctor-gateway-report-JRENPRNM.js → doctor-gateway-report-GMYX62JU.js} +7 -7
- package/dist/{doctor-live-CFUUN5K4.js → doctor-live-AES3PON5.js} +14 -14
- package/dist/{expert-bridge-FPFMGB3W.js → expert-bridge-WEZXYIGA.js} +6 -6
- package/dist/{factory-RQ5Q2TMY.js → factory-L2DIM3PM.js} +7 -7
- package/dist/{factory-HYRMAIGW.js → factory-L6CLXVPW.js} +13 -13
- package/dist/{gemini-adapter-EHQUG5QP.js → gemini-adapter-CL7YW7UZ.js} +8 -8
- package/dist/{improvement-review-SMUO5UVF.js → improvement-review-EBC3I55P.js} +6 -6
- package/dist/index.d.ts +1 -1
- package/dist/index.js +27 -27
- package/dist/{init-opencode-56GNUSHL.js → init-opencode-F6FV63VR.js} +6 -6
- package/dist/{issue-triage-LPX3EU4I.js → issue-triage-3EJ5DSGG.js} +7 -7
- package/dist/{model-config-helpers-XBHRUWIC.js → model-config-helpers-27GO3OEU.js} +3 -3
- package/dist/{openai-compat-adapter-WEHE5LKH.js → openai-compat-adapter-JJD7VWZC.js} +6 -6
- package/dist/{pr-reviewer-helpers-XPT57QHF.js → pr-reviewer-helpers-KGGKESLT.js} +5 -5
- package/dist/{registry-command-D5TA6433.js → registry-command-SQQNXDGS.js} +2 -2
- package/dist/{repo-security-plan-OH7IPPQU.js → repo-security-plan-CIGD7QBY.js} +4 -4
- package/dist/{research-helpers-synthesize-UYICMMMM.js → research-helpers-synthesize-HAQSK2RL.js} +6 -6
- package/dist/{routing-memory-PKD2T674.js → routing-memory-AFHV5NDT.js} +4 -4
- package/dist/{session-memory-IRR7GLZT.js → session-memory-RBY5SHFK.js} +5 -5
- package/dist/{setup-config-N4OYZSCY.js → setup-config-47NNRD4E.js} +5 -5
- package/dist/{setup-custom-api-4VLHKKBF.js → setup-custom-api-H74QY7EM.js} +5 -5
- package/dist/{tool-memory-MSOEUVUX.js → tool-memory-QESESDGS.js} +7 -7
- package/dist/{unified-registry-W2DCYXUT.js → unified-registry-HWZRXFQ6.js} +13 -13
- package/dist/{weather-report-FANVIPXZ.js → weather-report-QZLXDT5L.js} +4 -4
- package/node_modules/@protobufjs/aspromise/LICENSE +26 -0
- package/node_modules/@protobufjs/aspromise/README.md +13 -0
- package/node_modules/{protobufjs/src/util/aspromise.d.ts → @protobufjs/aspromise/index.d.ts} +13 -13
- package/node_modules/{protobufjs/src/util/aspromise.js → @protobufjs/aspromise/index.js} +52 -52
- package/node_modules/@protobufjs/aspromise/package.json +21 -0
- package/node_modules/@protobufjs/aspromise/tests/index.js +130 -0
- package/node_modules/@protobufjs/base64/LICENSE +26 -0
- package/node_modules/@protobufjs/base64/README.md +19 -0
- package/node_modules/{protobufjs/src/util/base64.d.ts → @protobufjs/base64/index.d.ts} +32 -32
- package/node_modules/{protobufjs/src/util/base64.js → @protobufjs/base64/index.js} +139 -146
- package/node_modules/@protobufjs/base64/package.json +21 -0
- package/node_modules/@protobufjs/base64/tests/index.js +46 -0
- package/node_modules/@protobufjs/codegen/LICENSE +26 -0
- package/node_modules/@protobufjs/codegen/README.md +49 -0
- package/node_modules/{protobufjs/src/util/codegen.d.ts → @protobufjs/codegen/index.d.ts} +31 -31
- package/node_modules/{protobufjs/src/util/codegen.js → @protobufjs/codegen/index.js} +112 -120
- package/node_modules/@protobufjs/codegen/package.json +13 -0
- package/node_modules/@protobufjs/codegen/tests/index.js +13 -0
- package/node_modules/@protobufjs/eventemitter/CHANGELOG.md +8 -0
- package/node_modules/@protobufjs/eventemitter/LICENSE +26 -0
- package/node_modules/@protobufjs/eventemitter/README.md +22 -0
- package/node_modules/{protobufjs/src/util/eventemitter.d.ts → @protobufjs/eventemitter/index.d.ts} +45 -45
- package/node_modules/{protobufjs/src/util/eventemitter.js → @protobufjs/eventemitter/index.js} +86 -86
- package/node_modules/@protobufjs/eventemitter/package.json +21 -0
- package/node_modules/@protobufjs/eventemitter/tests/index.js +83 -0
- package/node_modules/@protobufjs/fetch/CHANGELOG.md +8 -0
- package/node_modules/@protobufjs/fetch/LICENSE +26 -0
- package/node_modules/@protobufjs/fetch/README.md +13 -0
- package/node_modules/{protobufjs/src/util/fetch.d.ts → @protobufjs/fetch/index.d.ts} +56 -56
- package/node_modules/{protobufjs/src/util/fetch.js → @protobufjs/fetch/index.js} +112 -112
- package/node_modules/@protobufjs/fetch/package.json +27 -0
- package/node_modules/@protobufjs/fetch/tests/data/file.txt +1 -0
- package/node_modules/@protobufjs/fetch/tests/index.js +158 -0
- package/node_modules/@protobufjs/fetch/util/fs.js +11 -0
- package/node_modules/@protobufjs/float/LICENSE +26 -0
- package/node_modules/@protobufjs/float/README.md +102 -0
- package/node_modules/@protobufjs/float/bench/index.js +87 -0
- package/node_modules/@protobufjs/float/bench/suite.js +46 -0
- package/node_modules/{protobufjs/src/util/float.js → @protobufjs/float/index.js} +335 -335
- package/node_modules/@protobufjs/float/package.json +26 -0
- package/node_modules/@protobufjs/float/tests/index.js +100 -0
- package/node_modules/@protobufjs/path/LICENSE +26 -0
- package/node_modules/@protobufjs/path/README.md +19 -0
- package/node_modules/{protobufjs/src/util/path.d.ts → @protobufjs/path/index.d.ts} +22 -22
- package/node_modules/{protobufjs/src/util/path.js → @protobufjs/path/index.js} +65 -100
- package/node_modules/@protobufjs/path/package.json +21 -0
- package/node_modules/@protobufjs/path/tests/index.js +60 -0
- package/node_modules/@protobufjs/pool/.npmignore +3 -0
- package/node_modules/@protobufjs/pool/LICENSE +26 -0
- package/node_modules/@protobufjs/pool/README.md +13 -0
- package/node_modules/{protobufjs/src/util/pool.d.ts → @protobufjs/pool/index.d.ts} +32 -32
- package/node_modules/{protobufjs/src/util/pool.js → @protobufjs/pool/index.js} +48 -48
- package/node_modules/@protobufjs/pool/package.json +21 -0
- package/node_modules/@protobufjs/pool/tests/index.js +33 -0
- package/node_modules/@protobufjs/utf8/CHANGELOG.md +8 -0
- package/node_modules/@protobufjs/utf8/LICENSE +26 -0
- package/node_modules/@protobufjs/utf8/README.md +20 -0
- package/node_modules/{protobufjs/src/util/utf8.d.ts → @protobufjs/utf8/index.d.ts} +24 -24
- package/node_modules/@protobufjs/utf8/index.js +115 -0
- package/node_modules/@protobufjs/utf8/package.json +21 -0
- package/node_modules/@protobufjs/utf8/tests/data/surrogate_pair_bug.txt +207 -0
- package/node_modules/@protobufjs/utf8/tests/data/utf8.txt +216 -0
- package/node_modules/@protobufjs/utf8/tests/index.js +79 -0
- package/node_modules/@types/node/LICENSE +21 -0
- package/node_modules/@types/node/README.md +15 -0
- package/node_modules/@types/node/assert/strict.d.ts +68 -0
- package/node_modules/@types/node/assert.d.ts +1077 -0
- package/node_modules/@types/node/async_hooks.d.ts +711 -0
- package/node_modules/@types/node/buffer.buffer.d.ts +471 -0
- package/node_modules/@types/node/buffer.d.ts +1800 -0
- package/node_modules/@types/node/child_process.d.ts +1361 -0
- package/node_modules/@types/node/cluster.d.ts +432 -0
- package/node_modules/@types/node/console.d.ts +93 -0
- package/node_modules/@types/node/constants.d.ts +14 -0
- package/node_modules/@types/node/crypto.d.ts +3964 -0
- package/node_modules/@types/node/dgram.d.ts +652 -0
- package/node_modules/@types/node/diagnostics_channel.d.ts +794 -0
- package/node_modules/@types/node/dns/promises.d.ts +497 -0
- package/node_modules/@types/node/dns.d.ts +876 -0
- package/node_modules/@types/node/domain.d.ts +150 -0
- package/node_modules/@types/node/events.d.ts +1008 -0
- package/node_modules/@types/node/ffi.d.ts +500 -0
- package/node_modules/@types/node/fs/promises.d.ts +1477 -0
- package/node_modules/@types/node/fs.d.ts +4803 -0
- package/node_modules/@types/node/globals.d.ts +150 -0
- package/node_modules/@types/node/globals.typedarray.d.ts +101 -0
- package/node_modules/@types/node/http.d.ts +2218 -0
- package/node_modules/@types/node/http2.d.ts +2498 -0
- package/node_modules/@types/node/https.d.ts +400 -0
- package/node_modules/@types/node/index.d.ts +116 -0
- package/node_modules/@types/node/inspector/promises.d.ts +35 -0
- package/node_modules/@types/node/inspector.d.ts +265 -0
- package/node_modules/@types/node/inspector.generated.d.ts +4406 -0
- package/node_modules/@types/node/module.d.ts +726 -0
- package/node_modules/@types/node/net.d.ts +1074 -0
- package/node_modules/@types/node/os.d.ts +498 -0
- package/node_modules/@types/node/package.json +140 -0
- package/node_modules/@types/node/path/posix.d.ts +8 -0
- package/node_modules/@types/node/path/win32.d.ts +8 -0
- package/node_modules/@types/node/path.d.ts +178 -0
- package/node_modules/@types/node/perf_hooks.d.ts +617 -0
- package/node_modules/@types/node/process.d.ts +2269 -0
- package/node_modules/@types/node/punycode.d.ts +89 -0
- package/node_modules/@types/node/querystring.d.ts +139 -0
- package/node_modules/@types/node/quic.d.ts +2191 -0
- package/node_modules/@types/node/readline/promises.d.ts +158 -0
- package/node_modules/@types/node/readline.d.ts +508 -0
- package/node_modules/@types/node/repl.d.ts +420 -0
- package/node_modules/@types/node/sea.d.ts +47 -0
- package/node_modules/@types/node/sqlite.d.ts +1140 -0
- package/node_modules/@types/node/stream/consumers.d.ts +114 -0
- package/node_modules/@types/node/stream/iter.d.ts +449 -0
- package/node_modules/@types/node/stream/promises.d.ts +211 -0
- package/node_modules/@types/node/stream/web.d.ts +320 -0
- package/node_modules/@types/node/stream.d.ts +1806 -0
- package/node_modules/@types/node/string_decoder.d.ts +27 -0
- package/node_modules/@types/node/test/reporters.d.ts +60 -0
- package/node_modules/@types/node/test.d.ts +2558 -0
- package/node_modules/@types/node/timers/promises.d.ts +93 -0
- package/node_modules/@types/node/timers.d.ts +149 -0
- package/node_modules/@types/node/tls.d.ts +1232 -0
- package/node_modules/@types/node/trace_events.d.ts +103 -0
- package/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +467 -0
- package/node_modules/@types/node/ts5.6/compatibility/float16array.d.ts +71 -0
- package/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +36 -0
- package/node_modules/@types/node/ts5.6/index.d.ts +118 -0
- package/node_modules/@types/node/ts5.7/compatibility/float16array.d.ts +72 -0
- package/node_modules/@types/node/ts5.7/index.d.ts +118 -0
- package/node_modules/@types/node/tty.d.ts +226 -0
- package/node_modules/@types/node/url.d.ts +556 -0
- package/node_modules/@types/node/util/types.d.ts +558 -0
- package/node_modules/@types/node/util.d.ts +1680 -0
- package/node_modules/@types/node/v8.d.ts +1059 -0
- package/node_modules/@types/node/vfs.d.ts +211 -0
- package/node_modules/@types/node/vm.d.ts +1137 -0
- package/node_modules/@types/node/wasi.d.ts +131 -0
- package/node_modules/@types/node/web-globals/abortcontroller.d.ts +59 -0
- package/node_modules/@types/node/web-globals/blob.d.ts +23 -0
- package/node_modules/@types/node/web-globals/console.d.ts +9 -0
- package/node_modules/@types/node/web-globals/crypto.d.ts +39 -0
- package/node_modules/@types/node/web-globals/domexception.d.ts +83 -0
- package/node_modules/@types/node/web-globals/encoding.d.ts +11 -0
- package/node_modules/@types/node/web-globals/events.d.ts +106 -0
- package/node_modules/@types/node/web-globals/fetch.d.ts +69 -0
- package/node_modules/@types/node/web-globals/importmeta.d.ts +13 -0
- package/node_modules/@types/node/web-globals/messaging.d.ts +23 -0
- package/node_modules/@types/node/web-globals/navigator.d.ts +25 -0
- package/node_modules/@types/node/web-globals/performance.d.ts +45 -0
- package/node_modules/@types/node/web-globals/storage.d.ts +24 -0
- package/node_modules/@types/node/web-globals/streams.d.ts +119 -0
- package/node_modules/@types/node/web-globals/timers.d.ts +44 -0
- package/node_modules/@types/node/web-globals/url.d.ts +24 -0
- package/node_modules/@types/node/worker_threads.d.ts +672 -0
- package/node_modules/@types/node/zlib/iter.d.ts +131 -0
- package/node_modules/@types/node/zlib.d.ts +612 -0
- package/node_modules/fast-uri/.github/dependabot.yml +2 -42
- package/node_modules/fast-uri/.github/workflows/ci.yml +6 -54
- package/node_modules/fast-uri/.github/workflows/lock-threads.yml +1 -1
- package/node_modules/fast-uri/.github/workflows/package-manager-ci.yml +24 -0
- package/node_modules/fast-uri/.github/workflows/release.yml +2 -1
- package/node_modules/fast-uri/README.md +10 -12
- package/node_modules/fast-uri/benchmark/benchmark.mjs +0 -71
- package/node_modules/fast-uri/index.js +20 -94
- package/node_modules/fast-uri/lib/schemes.js +4 -439
- package/node_modules/fast-uri/lib/utils.js +113 -230
- package/node_modules/fast-uri/package.json +5 -5
- package/node_modules/fast-uri/test/equal.test.js +0 -63
- package/node_modules/fast-uri/test/fixtures/uri-js-parse.json +1 -23
- package/node_modules/fast-uri/test/fixtures/uri-js-serialize.json +1 -23
- package/node_modules/fast-uri/test/ipv6-validation.test.js +0 -160
- package/node_modules/fast-uri/test/parse.test.js +5 -150
- package/node_modules/fast-uri/test/relative-normalization-security.test.js +4 -0
- package/node_modules/fast-uri/test/scheme-validation.test.js +5 -3
- package/node_modules/fast-uri/test/security.test.js +2 -2
- package/node_modules/fast-uri/test/serialize.test.js +0 -144
- package/node_modules/fast-uri/test/uri-js-compatibility.test.js +3 -0
- package/node_modules/fast-uri/test/uri-js.test.js +9 -11
- package/node_modules/fast-uri/test/urn-full-input.test.js +0 -18
- package/node_modules/fast-uri/test/util.test.js +0 -9
- package/node_modules/fast-uri/tsconfig.json +7 -8
- package/node_modules/fast-uri/types/index.d.ts +9 -20
- package/node_modules/fast-uri/types/index.test-d.ts +17 -0
- package/node_modules/hono/README.md +2 -3
- package/node_modules/hono/dist/cjs/helper/css/common.js +8 -3
- package/node_modules/hono/dist/cjs/helper/css/index.js +1 -1
- package/node_modules/hono/dist/cjs/helper/route/index.js +3 -1
- package/node_modules/hono/dist/cjs/jsx/base.js +1 -1
- package/node_modules/hono/dist/cjs/middleware/bearer-auth/index.js +8 -0
- package/node_modules/hono/dist/cjs/middleware/serve-static/index.js +3 -1
- package/node_modules/hono/dist/cjs/router/trie-router/node.js +2 -2
- package/node_modules/hono/dist/cjs/utils/url.js +11 -6
- package/node_modules/hono/dist/helper/css/common.js +8 -3
- package/node_modules/hono/dist/helper/css/index.js +1 -1
- package/node_modules/hono/dist/helper/route/index.js +3 -1
- package/node_modules/hono/dist/jsx/base.js +1 -1
- package/node_modules/hono/dist/middleware/bearer-auth/index.js +8 -0
- package/node_modules/hono/dist/middleware/serve-static/index.js +3 -1
- package/node_modules/hono/dist/router/trie-router/node.js +2 -2
- package/node_modules/hono/dist/types/adapter/aws-lambda/conninfo.d.ts +1 -1
- package/node_modules/hono/dist/types/adapter/bun/conninfo.d.ts +1 -1
- package/node_modules/hono/dist/types/adapter/bun/ssg.d.ts +1 -1
- package/node_modules/hono/dist/types/adapter/cloudflare-pages/conninfo.d.ts +1 -1
- package/node_modules/hono/dist/types/adapter/cloudflare-workers/conninfo.d.ts +1 -1
- package/node_modules/hono/dist/types/adapter/deno/conninfo.d.ts +1 -1
- package/node_modules/hono/dist/types/adapter/deno/ssg.d.ts +1 -1
- package/node_modules/hono/dist/types/adapter/lambda-edge/conninfo.d.ts +1 -1
- package/node_modules/hono/dist/types/adapter/netlify/conninfo.d.ts +1 -1
- package/node_modules/hono/dist/types/adapter/vercel/conninfo.d.ts +1 -1
- package/node_modules/hono/dist/types/helper/testing/index.d.ts +2 -1
- package/node_modules/hono/dist/types/hono-base.d.ts +21 -9
- package/node_modules/hono/dist/types/index.d.ts +1 -1
- package/node_modules/hono/dist/types/jsx/components.d.ts +2 -2
- package/node_modules/hono/dist/types/jsx/context.d.ts +2 -2
- package/node_modules/hono/dist/types/jsx/dom/components.d.ts +2 -2
- package/node_modules/hono/dist/types/jsx/dom/css.d.ts +2 -2
- package/node_modules/hono/dist/types/jsx/streaming.d.ts +4 -3
- package/node_modules/hono/dist/types/middleware/bearer-auth/index.d.ts +2 -1
- package/node_modules/hono/dist/types/middleware/ip-restriction/index.d.ts +3 -3
- package/node_modules/hono/dist/types/middleware/jsx-renderer/index.d.ts +3 -3
- package/node_modules/hono/dist/types/utils/ipaddr.d.ts +1 -1
- package/node_modules/hono/dist/utils/url.js +11 -6
- package/node_modules/hono/package.json +1 -1
- package/node_modules/ip-address/dist/common.js +2 -2
- package/node_modules/ip-address/dist/common.js.map +1 -1
- package/node_modules/ip-address/package.json +2 -2
- package/node_modules/path-to-regexp/Readme.md +7 -1
- package/node_modules/path-to-regexp/dist/index.d.ts +12 -7
- package/node_modules/path-to-regexp/dist/index.js +99 -99
- package/node_modules/path-to-regexp/dist/index.js.map +1 -1
- package/node_modules/path-to-regexp/package.json +8 -9
- package/node_modules/protobufjs/README.md +562 -259
- package/node_modules/protobufjs/dist/light/protobuf.js +1915 -3267
- package/node_modules/protobufjs/dist/light/protobuf.js.map +1 -1
- package/node_modules/protobufjs/dist/light/protobuf.min.js +3 -3
- package/node_modules/protobufjs/dist/light/protobuf.min.js.map +1 -1
- package/node_modules/protobufjs/dist/minimal/protobuf.js +1173 -2018
- package/node_modules/protobufjs/dist/minimal/protobuf.js.map +1 -1
- package/node_modules/protobufjs/dist/minimal/protobuf.min.js +3 -3
- package/node_modules/protobufjs/dist/minimal/protobuf.min.js.map +1 -1
- package/node_modules/protobufjs/dist/protobuf.js +1982 -3483
- package/node_modules/protobufjs/dist/protobuf.js.map +1 -1
- package/node_modules/protobufjs/dist/protobuf.min.js +3 -3
- package/node_modules/protobufjs/dist/protobuf.min.js.map +1 -1
- package/node_modules/protobufjs/ext/descriptor/README.md +70 -3
- package/node_modules/protobufjs/ext/descriptor/index.d.ts +193 -0
- package/node_modules/protobufjs/ext/descriptor/index.js +1185 -1
- package/node_modules/protobufjs/ext/descriptor/test.js +54 -0
- package/node_modules/protobufjs/google/api/annotations.json +1 -3
- package/node_modules/protobufjs/google/api/http.json +1 -2
- package/node_modules/protobufjs/google/protobuf/api.json +6 -12
- package/node_modules/protobufjs/google/protobuf/descriptor.json +88 -194
- package/node_modules/protobufjs/google/protobuf/descriptor.proto +9 -15
- package/node_modules/protobufjs/google/protobuf/source_context.json +1 -2
- package/node_modules/protobufjs/google/protobuf/type.json +7 -14
- package/node_modules/protobufjs/index.d.ts +685 -1077
- package/node_modules/protobufjs/package.json +51 -25
- package/node_modules/protobufjs/scripts/postinstall.js +32 -0
- package/node_modules/protobufjs/src/common.js +8 -14
- package/node_modules/protobufjs/src/converter.js +52 -90
- package/node_modules/protobufjs/src/decoder.js +67 -211
- package/node_modules/protobufjs/src/encoder.js +7 -27
- package/node_modules/protobufjs/src/enum.js +7 -33
- package/node_modules/protobufjs/src/field.js +20 -77
- package/node_modules/protobufjs/src/index-light.js +29 -29
- package/node_modules/protobufjs/src/index-minimal.js +13 -12
- package/node_modules/protobufjs/src/index.js +6 -6
- package/node_modules/protobufjs/src/mapfield.js +8 -26
- package/node_modules/protobufjs/src/message.js +11 -5
- package/node_modules/protobufjs/src/method.js +7 -30
- package/node_modules/protobufjs/src/namespace.js +10 -26
- package/node_modules/protobufjs/src/object.js +31 -44
- package/node_modules/protobufjs/src/oneof.js +1 -12
- package/node_modules/protobufjs/src/parse.js +67 -194
- package/node_modules/protobufjs/src/reader.js +58 -520
- package/node_modules/protobufjs/src/reader_buffer.js +5 -31
- package/node_modules/protobufjs/src/root.js +4 -16
- package/node_modules/protobufjs/src/rpc/service.js +5 -18
- package/node_modules/protobufjs/src/service.js +2 -15
- package/node_modules/protobufjs/src/tokenize.js +4 -20
- package/node_modules/protobufjs/src/type.js +37 -91
- package/node_modules/protobufjs/src/typescript.jsdoc +15 -0
- package/node_modules/protobufjs/src/util/longbits.js +6 -10
- package/node_modules/protobufjs/src/util/minimal.js +51 -71
- package/node_modules/protobufjs/src/util.js +17 -51
- package/node_modules/protobufjs/src/verifier.js +14 -19
- package/node_modules/protobufjs/src/wrappers.js +3 -2
- package/node_modules/protobufjs/src/writer.js +189 -428
- package/node_modules/protobufjs/src/writer_buffer.js +26 -41
- package/node_modules/protobufjs/tsconfig.json +5 -3
- package/node_modules/undici-types/LICENSE +21 -0
- package/node_modules/undici-types/README.md +6 -0
- package/node_modules/undici-types/agent.d.ts +30 -0
- package/node_modules/undici-types/api.d.ts +43 -0
- package/node_modules/undici-types/balanced-pool.d.ts +30 -0
- package/node_modules/undici-types/cache-interceptor.d.ts +179 -0
- package/node_modules/undici-types/cache.d.ts +36 -0
- package/node_modules/undici-types/client-stats.d.ts +15 -0
- package/node_modules/undici-types/client.d.ts +134 -0
- package/node_modules/undici-types/connector.d.ts +37 -0
- package/node_modules/undici-types/content-type.d.ts +21 -0
- package/node_modules/undici-types/cookies.d.ts +30 -0
- package/node_modules/undici-types/diagnostics-channel.d.ts +74 -0
- package/node_modules/undici-types/dispatcher.d.ts +253 -0
- package/node_modules/undici-types/dispatcher1-wrapper.d.ts +7 -0
- package/node_modules/undici-types/env-http-proxy-agent.d.ts +22 -0
- package/node_modules/undici-types/errors.d.ts +187 -0
- package/node_modules/undici-types/eventsource.d.ts +66 -0
- package/node_modules/undici-types/fetch.d.ts +235 -0
- package/node_modules/undici-types/formdata.d.ts +108 -0
- package/node_modules/undici-types/global-dispatcher.d.ts +9 -0
- package/node_modules/undici-types/global-origin.d.ts +7 -0
- package/node_modules/undici-types/h2c-client.d.ts +73 -0
- package/node_modules/undici-types/handlers.d.ts +16 -0
- package/node_modules/undici-types/header.d.ts +165 -0
- package/node_modules/undici-types/index.d.ts +93 -0
- package/node_modules/undici-types/interceptors.d.ts +80 -0
- package/node_modules/undici-types/mock-agent.d.ts +68 -0
- package/node_modules/undici-types/mock-call-history.d.ts +111 -0
- package/node_modules/undici-types/mock-client.d.ts +27 -0
- package/node_modules/undici-types/mock-errors.d.ts +12 -0
- package/node_modules/undici-types/mock-interceptor.d.ts +98 -0
- package/node_modules/undici-types/mock-pool.d.ts +27 -0
- package/node_modules/undici-types/package.json +55 -0
- package/node_modules/undici-types/patch.d.ts +29 -0
- package/node_modules/undici-types/pool-stats.d.ts +19 -0
- package/node_modules/undici-types/pool.d.ts +39 -0
- package/node_modules/undici-types/proxy-agent.d.ts +36 -0
- package/node_modules/undici-types/readable.d.ts +68 -0
- package/node_modules/undici-types/retry-agent.d.ts +8 -0
- package/node_modules/undici-types/retry-handler.d.ts +125 -0
- package/node_modules/undici-types/round-robin-pool.d.ts +39 -0
- package/node_modules/undici-types/snapshot-agent.d.ts +113 -0
- package/node_modules/undici-types/socks5-proxy-agent.d.ts +25 -0
- package/node_modules/undici-types/util.d.ts +18 -0
- package/node_modules/undici-types/utility.d.ts +7 -0
- package/node_modules/undici-types/webidl.d.ts +346 -0
- package/node_modules/undici-types/websocket.d.ts +188 -0
- package/package.json +19 -7
- package/dist/chunk-AJBRMUGK.js.map +0 -1
- package/dist/chunk-FLIBWADL.js.map +0 -1
- package/dist/chunk-IBGLJEW7.js.map +0 -1
- package/dist/chunk-KVFNI2UZ.js.map +0 -1
- package/node_modules/fast-uri/.github/workflows/ossf-scorecard.yml +0 -45
- package/node_modules/fast-uri/SECURITY.md +0 -222
- package/node_modules/fast-uri/benchmark/encoder.mjs +0 -54
- package/node_modules/fast-uri/test/c0-reference-security.test.js +0 -137
- package/node_modules/fast-uri/test/host-encoding.test.js +0 -60
- package/node_modules/fast-uri/test/mailto-authority-security.test.js +0 -125
- package/node_modules/fast-uri/test/mailto-field-name-security.test.js +0 -151
- package/node_modules/fast-uri/test/scheme-normalization.test.js +0 -16
- package/node_modules/fast-uri/test/security-utf8-encoding.test.js +0 -0
- package/node_modules/fast-uri/types/index.tst.ts +0 -31
- package/node_modules/protobufjs/ext/README.md +0 -70
- package/node_modules/protobufjs/ext/descriptor.d.ts +0 -87
- package/node_modules/protobufjs/ext/descriptor.generated.d.ts +0 -424
- package/node_modules/protobufjs/ext/descriptor.js +0 -1405
- package/node_modules/protobufjs/ext/protojson.LICENSE +0 -201
- package/node_modules/protobufjs/ext/protojson.d.ts +0 -20
- package/node_modules/protobufjs/ext/protojson.generated.d.ts +0 -49
- package/node_modules/protobufjs/ext/protojson.js +0 -972
- package/node_modules/protobufjs/ext/textformat.d.ts +0 -19
- package/node_modules/protobufjs/ext/textformat.generated.d.ts +0 -33
- package/node_modules/protobufjs/ext/textformat.js +0 -1280
- package/node_modules/protobufjs/google/protobuf/compiler/plugin.json +0 -126
- package/node_modules/protobufjs/google/protobuf/compiler/plugin.proto +0 -47
- package/node_modules/protobufjs/google/protobuf/json_enumvalue_options.json +0 -56
- package/node_modules/protobufjs/google/protobuf/json_enumvalue_options.proto +0 -31
- package/node_modules/protobufjs/src/typescript.js +0 -25
- package/node_modules/protobufjs/src/util/utf8.js +0 -164
- /package/dist/{ast-rule-runner-3PYXOOLH.js.map → ast-rule-runner-2PEUHSHO.js.map} +0 -0
- /package/dist/{child-mcp-config-AKQYBMMC.js.map → child-mcp-config-AYVMLJDV.js.map} +0 -0
- /package/dist/{chunk-YKCJJP5X.js.map → chunk-236T3AOZ.js.map} +0 -0
- /package/dist/{chunk-GCD3OFFM.js.map → chunk-5QNWRC7B.js.map} +0 -0
- /package/dist/{chunk-LD6QCSHT.js.map → chunk-B5RDZLU3.js.map} +0 -0
- /package/dist/{chunk-UZZHLCYW.js.map → chunk-CZSEUZFE.js.map} +0 -0
- /package/dist/{chunk-6FBREJER.js.map → chunk-DCPN7F5J.js.map} +0 -0
- /package/dist/{chunk-XRMP4PP4.js.map → chunk-DXDKAVWV.js.map} +0 -0
- /package/dist/{chunk-K5MAYIHL.js.map → chunk-FEAWCZ7E.js.map} +0 -0
- /package/dist/{chunk-CUPOUBBN.js.map → chunk-GPZQVYKV.js.map} +0 -0
- /package/dist/{chunk-MB2UUFF7.js.map → chunk-H6SGSQJM.js.map} +0 -0
- /package/dist/{chunk-K6CUB3IV.js.map → chunk-JV3UBRRA.js.map} +0 -0
- /package/dist/{chunk-6EUYMTVU.js.map → chunk-KXWLZDQR.js.map} +0 -0
- /package/dist/{chunk-CQ6FAAOO.js.map → chunk-LBVPKHHU.js.map} +0 -0
- /package/dist/{chunk-EFE6ORME.js.map → chunk-LC34UPDQ.js.map} +0 -0
- /package/dist/{chunk-NA55VLER.js.map → chunk-LE6TQVXF.js.map} +0 -0
- /package/dist/{chunk-KZ5R5HL7.js.map → chunk-MFUJU7RO.js.map} +0 -0
- /package/dist/{chunk-7S6ANELD.js.map → chunk-MQSSTTZU.js.map} +0 -0
- /package/dist/{chunk-CP73UYNV.js.map → chunk-OQR2C64M.js.map} +0 -0
- /package/dist/{chunk-UBCGX47E.js.map → chunk-P3CFDAW5.js.map} +0 -0
- /package/dist/{chunk-G2MC6WXA.js.map → chunk-PG6NTUTS.js.map} +0 -0
- /package/dist/{chunk-HQMIDROO.js.map → chunk-PQ3V2SYP.js.map} +0 -0
- /package/dist/{chunk-36B7J7CZ.js.map → chunk-Q6R3JTXH.js.map} +0 -0
- /package/dist/{chunk-PI54VS4I.js.map → chunk-SNSV6GGV.js.map} +0 -0
- /package/dist/{chunk-BSGMAUA4.js.map → chunk-SQPFJLCI.js.map} +0 -0
- /package/dist/{chunk-7VMEUGNV.js.map → chunk-TV6RX3ZL.js.map} +0 -0
- /package/dist/{chunk-7BKOWPKX.js.map → chunk-TYIIAIXA.js.map} +0 -0
- /package/dist/{chunk-2A4P2DX3.js.map → chunk-VH4T4O5L.js.map} +0 -0
- /package/dist/{chunk-ABTRD52Y.js.map → chunk-WWBYNWYB.js.map} +0 -0
- /package/dist/{chunk-BELY4VU4.js.map → chunk-YE3T4X2U.js.map} +0 -0
- /package/dist/{cli-circuit-breaker-37UQWOAA.js.map → cli-circuit-breaker-HWMTEEYI.js.map} +0 -0
- /package/dist/{cli-readiness-RSBS6FN3.js.map → cli-readiness-6C6E2T2O.js.map} +0 -0
- /package/dist/{cli-server-gateway-C5QPDUWS.js.map → cli-server-gateway-HHRF22EB.js.map} +0 -0
- /package/dist/{composite-router-WERJYE7X.js.map → composite-router-CX2W7RVA.js.map} +0 -0
- /package/dist/{consensus-vote-G2MKNTMW.js.map → consensus-vote-CQGIWMYY.js.map} +0 -0
- /package/dist/{context-retriever-H34LHPWB.js.map → context-retriever-G4LMWEN5.js.map} +0 -0
- /package/dist/{doctor-deep-XBUWYYXO.js.map → doctor-deep-VOX7KVGK.js.map} +0 -0
- /package/dist/{doctor-gateway-report-JRENPRNM.js.map → doctor-gateway-report-GMYX62JU.js.map} +0 -0
- /package/dist/{doctor-live-CFUUN5K4.js.map → doctor-live-AES3PON5.js.map} +0 -0
- /package/dist/{expert-bridge-FPFMGB3W.js.map → expert-bridge-WEZXYIGA.js.map} +0 -0
- /package/dist/{factory-HYRMAIGW.js.map → factory-L2DIM3PM.js.map} +0 -0
- /package/dist/{factory-RQ5Q2TMY.js.map → factory-L6CLXVPW.js.map} +0 -0
- /package/dist/{gemini-adapter-EHQUG5QP.js.map → gemini-adapter-CL7YW7UZ.js.map} +0 -0
- /package/dist/{improvement-review-SMUO5UVF.js.map → improvement-review-EBC3I55P.js.map} +0 -0
- /package/dist/{init-opencode-56GNUSHL.js.map → init-opencode-F6FV63VR.js.map} +0 -0
- /package/dist/{issue-triage-LPX3EU4I.js.map → issue-triage-3EJ5DSGG.js.map} +0 -0
- /package/dist/{model-config-helpers-XBHRUWIC.js.map → model-config-helpers-27GO3OEU.js.map} +0 -0
- /package/dist/{openai-compat-adapter-WEHE5LKH.js.map → openai-compat-adapter-JJD7VWZC.js.map} +0 -0
- /package/dist/{pr-reviewer-helpers-XPT57QHF.js.map → pr-reviewer-helpers-KGGKESLT.js.map} +0 -0
- /package/dist/{registry-command-D5TA6433.js.map → registry-command-SQQNXDGS.js.map} +0 -0
- /package/dist/{repo-security-plan-OH7IPPQU.js.map → repo-security-plan-CIGD7QBY.js.map} +0 -0
- /package/dist/{research-helpers-synthesize-UYICMMMM.js.map → research-helpers-synthesize-HAQSK2RL.js.map} +0 -0
- /package/dist/{routing-memory-PKD2T674.js.map → routing-memory-AFHV5NDT.js.map} +0 -0
- /package/dist/{session-memory-IRR7GLZT.js.map → session-memory-RBY5SHFK.js.map} +0 -0
- /package/dist/{setup-config-N4OYZSCY.js.map → setup-config-47NNRD4E.js.map} +0 -0
- /package/dist/{setup-custom-api-4VLHKKBF.js.map → setup-custom-api-H74QY7EM.js.map} +0 -0
- /package/dist/{tool-memory-MSOEUVUX.js.map → tool-memory-QESESDGS.js.map} +0 -0
- /package/dist/{unified-registry-W2DCYXUT.js.map → unified-registry-HWZRXFQ6.js.map} +0 -0
- /package/dist/{weather-report-FANVIPXZ.js.map → weather-report-QZLXDT5L.js.map} +0 -0
- /package/node_modules/{protobufjs/src/util/float.d.ts → @protobufjs/float/index.d.ts} +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Env, Input, MiddlewareHandler } from "../../types.js";
|
|
2
2
|
import { Context, PropsForRenderer } from "../../context.js";
|
|
3
|
-
import { PropsWithChildren } from "../../jsx/
|
|
4
|
-
import { Context as Context$1 } from "../../jsx/
|
|
5
|
-
import { FC } from "../../jsx/
|
|
3
|
+
import { PropsWithChildren } from "../../jsx/index.js";
|
|
4
|
+
import { Context as Context$1 } from "../../jsx/index.js";
|
|
5
|
+
import { FC } from "../../jsx/index.js";
|
|
6
6
|
//#region src/middleware/jsx-renderer/index.d.ts
|
|
7
7
|
export declare const RequestContext: Context$1<Context<any, any, {}> | null>;
|
|
8
8
|
type RendererOptions = {
|
|
@@ -153,16 +153,21 @@ const _getQueryParam = (url, key, multiple) => {
|
|
|
153
153
|
if (hashIndex !== -1) url = url.slice(0, hashIndex);
|
|
154
154
|
let encoded;
|
|
155
155
|
if (!multiple && key && key.indexOf("%") === -1 && key.indexOf("+") === -1) {
|
|
156
|
-
|
|
156
|
+
const queryIndex = url.indexOf("?", 8);
|
|
157
|
+
let keyIndex = queryIndex;
|
|
157
158
|
if (keyIndex === -1) return;
|
|
158
159
|
if (!url.startsWith(key, keyIndex + 1)) keyIndex = url.indexOf(`&${key}`, keyIndex + 1);
|
|
159
160
|
while (keyIndex !== -1) {
|
|
160
161
|
const trailingKeyCode = url.charCodeAt(keyIndex + key.length + 1);
|
|
161
|
-
if (trailingKeyCode === 61) {
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
162
|
+
if (trailingKeyCode === 61 || trailingKeyCode === 38 || isNaN(trailingKeyCode)) {
|
|
163
|
+
if (keyIndex > queryIndex && /(?:^|&)[^=&]*[%+]/.test(url.slice(queryIndex + 1, keyIndex))) break;
|
|
164
|
+
if (trailingKeyCode === 61) {
|
|
165
|
+
const valueIndex = keyIndex + key.length + 2;
|
|
166
|
+
const endIndex = url.indexOf("&", valueIndex);
|
|
167
|
+
return _decodeURI(url.slice(valueIndex, endIndex === -1 ? void 0 : endIndex));
|
|
168
|
+
}
|
|
169
|
+
return "";
|
|
170
|
+
}
|
|
166
171
|
keyIndex = url.indexOf(`&${key}`, keyIndex + 1);
|
|
167
172
|
}
|
|
168
173
|
encoded = /[%+]/.test(url);
|
|
@@ -145,10 +145,10 @@ function stringToPaddedHex(numberString) {
|
|
|
145
145
|
*/
|
|
146
146
|
function testBit(binaryValue, position) {
|
|
147
147
|
const { length } = binaryValue;
|
|
148
|
-
if (position
|
|
148
|
+
if (position >= length) {
|
|
149
149
|
return false;
|
|
150
150
|
}
|
|
151
|
-
const positionInString = length - position;
|
|
151
|
+
const positionInString = length - position - 1;
|
|
152
152
|
return binaryValue.substring(positionInString, positionInString + 1) === '1';
|
|
153
153
|
}
|
|
154
154
|
//# sourceMappingURL=common.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.js","sourceRoot":"","sources":["../src/common.ts"],"names":[],"mappings":";;AAkBA,gCAMC;AAmBD,wCAUC;AAiBD,kDAmBC;AAMD,oCAqBC;AAED,8BAYC;AAOD,oDAkBC;AAOD,0CAeC;AAED,8CAEC;AAED,8CAEC;AAMD,0BASC;AAtMD,mDAA+C;AAM/C;;;;;;;;;GASG;AACH,SAAgB,UAAU,CAA4B,OAA4B;IAChF,IAAI,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;QACzC,OAAO,KAAK,CAAC;IACf,CAAC;IAED,OAAO,cAAc,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AAC5C,CAAC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,SAAgB,cAAc,CAA4B,OAA4B;IACpF,0EAA0E;IAC1E,qEAAqE;IACrE,yEAAyE;IACz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,OAAO,KAAK,CAAC;IACf,CAAC;IAED,MAAM,gBAAgB,GAAG,MAAM,GAAG,QAAQ,CAAC;IAC3C,OAAO,WAAW,CAAC,SAAS,CAAC,gBAAgB,EAAE,gBAAgB,GAAG,CAAC,CAAC,KAAK,GAAG,CAAC;AAC/E,CAAC","sourcesContent":["import { Address4 } from './ipv4';\nimport { Address6 } from './ipv6';\nimport { AddressError } from './address-error';\n\nexport interface ReverseFormOptions {\n omitSuffix?: boolean;\n}\n\n/**\n * Returns whether this address's *network* is contained within `address`,\n * i.e. whether every address this one can represent also falls inside\n * `address`. A network wider than `address` is not contained in it, so\n * `10.0.0.0/8` is not in `10.0.0.0/16`.\n *\n * To ask whether the address itself falls inside a range, ignoring any CIDR\n * suffix it was written with, use {@link isHostInSubnet} instead. That is the\n * question the special-use classifiers ask.\n */\nexport function isInSubnet(this: Address4 | Address6, address: Address4 | Address6) {\n if (this.subnetMask < address.subnetMask) {\n return false;\n }\n\n return isHostInSubnet.call(this, address);\n}\n\n/**\n * Returns whether this address's host bits fall inside `address`, ignoring\n * this address's own subnet mask.\n *\n * This is the primitive the special-use classifiers (`isLoopback`,\n * `isPrivate`, `isLinkLocal`, `getType`, …) are built on: they answer a\n * question about the address, so the answer must not change with the CIDR\n * suffix the caller happened to write. Use this rather than\n * {@link isInSubnet} when classifying a single address — notably when the\n * address came from untrusted input and the result backs a trust-boundary\n * decision such as an SSRF allow/deny filter.\n *\n * An address of one family is never inside a network of the other, so an\n * `Address4` against an `Address6` (or the reverse) is `false`. To compare\n * across families, convert first: `Address6.fromAddress4()`, `to4()`, or\n * `toAddress4Nat64()`.\n */\nexport function isHostInSubnet(this: Address4 | Address6, address: Address4 | Address6) {\n // mask() is a bit string of the family's width, and the leading bits of a\n // 32-bit string can coincide with those of a 128-bit one (a00::1 and\n // 10.0.0.0/8 both mask to 00001010), so the widths must agree before the\n // strings are compared.\n if (this.binaryZeroPad().length !== address.binaryZeroPad().length) {\n return false;\n }\n\n return this.mask(address.subnetMask) === address.mask();\n}\n\n/**\n * One parsed row of an IANA special-purpose address registry: the block, and\n * whether the registry marks it globally reachable (`null` when the column is\n * blank, in which case the containing block answers).\n */\nexport interface SpecialPurposeEntry<A extends Address4 | Address6> {\n subnet: A;\n reachable: boolean | null;\n}\n\n/**\n * Returns whether the registry marks this address globally reachable: the\n * answer of the most specific entry containing it that has one, or `true`\n * when no entry contains it.\n */\nexport function isGloballyReachable<A extends Address4 | Address6>(\n this: A,\n entries: ReadonlyArray<SpecialPurposeEntry<A>>,\n): boolean {\n let best: SpecialPurposeEntry<A> | null = null;\n\n for (let i = 0; i < entries.length; i++) {\n const entry = entries[i];\n\n if (\n entry.reachable !== null &&\n isHostInSubnet.call(this, entry.subnet) &&\n (best === null || entry.subnet.subnetMask > best.subnet.subnetMask)\n ) {\n best = entry;\n }\n }\n\n return best === null ? true : (best.reachable as boolean);\n}\n\n/**\n * Adds `n` to `value` and returns the result, throwing `AddressError` unless\n * `n` is an integer and the result stays within `[0, 2**bits - 1]`.\n */\nexport function offsetBigInt(\n value: bigint,\n n: number | bigint,\n bits: number,\n family: string,\n): bigint {\n if (typeof n === 'number' && !Number.isSafeInteger(n)) {\n throw new AddressError(`${family} offset must be an integer`);\n }\n\n if (typeof n !== 'number' && typeof n !== 'bigint') {\n throw new AddressError(`${family} offset must be an integer`);\n }\n\n const result = value + BigInt(n);\n\n if (result < BigInt(0) || result > (BigInt(1) << BigInt(bits)) - BigInt(1)) {\n throw new AddressError(`${family} offset leaves the address space`);\n }\n\n return result;\n}\n\nexport function isCorrect(defaultBits: number) {\n return function isCorrectForm(this: Address4 | Address6) {\n if (this.addressMinusSuffix !== this.correctForm()) {\n return false;\n }\n\n if (this.subnetMask === defaultBits && !this.parsedSubnet) {\n return true;\n }\n\n return this.parsedSubnet === String(this.subnetMask);\n };\n}\n\n/**\n * Returns the prefix length (number of leading 1 bits) of a contiguous\n * subnet mask. Throws `AddressError` if the mask is non-contiguous (e.g.\n * `255.0.255.0`).\n */\nexport function prefixLengthFromMask(value: bigint, totalBits: number): number {\n const binary = value.toString(2).padStart(totalBits, '0');\n\n if (binary.length > totalBits) {\n throw new AddressError('Invalid subnet mask.');\n }\n\n const firstZero = binary.indexOf('0');\n\n if (firstZero === -1) {\n return totalBits;\n }\n\n if (binary.slice(firstZero).includes('1')) {\n throw new AddressError('Invalid subnet mask.');\n }\n\n return firstZero;\n}\n\n/**\n * Throws `AddressError` unless `bytes` holds exactly `byteCount` integers,\n * each from `minimum` to 255. Pass a `minimum` of `-128` where signed bytes\n * are accepted and folded to unsigned, and `0` where they are not.\n */\nexport function assertByteArray(\n bytes: number[],\n byteCount: number,\n family: 'IPv4' | 'IPv6',\n minimum: number,\n): void {\n if (bytes.length !== byteCount) {\n throw new AddressError(`${family} addresses require exactly ${byteCount} bytes`);\n }\n\n for (let i = 0; i < bytes.length; i++) {\n if (!Number.isInteger(bytes[i]) || bytes[i] < minimum || bytes[i] > 255) {\n throw new AddressError(`All bytes must be integers between ${minimum} and 255`);\n }\n }\n}\n\nexport function numberToPaddedHex(number: number) {\n return number.toString(16).padStart(2, '0');\n}\n\nexport function stringToPaddedHex(numberString: string) {\n return numberToPaddedHex(parseInt(numberString, 10));\n}\n\n/**\n * @param binaryValue Binary representation of a value (e.g. `10`)\n * @param position Byte position, where 0 is the least significant bit\n */\nexport function testBit(binaryValue: string, position: number): boolean {\n const { length } = binaryValue;\n\n if (position > length) {\n return false;\n }\n\n const positionInString = length - position;\n return binaryValue.substring(positionInString, positionInString + 1) === '1';\n}\n"]}
|
|
1
|
+
{"version":3,"file":"common.js","sourceRoot":"","sources":["../src/common.ts"],"names":[],"mappings":";;AAkBA,gCAMC;AAmBD,wCAUC;AAiBD,kDAmBC;AAMD,oCAqBC;AAED,8BAYC;AAOD,oDAkBC;AAOD,0CAeC;AAED,8CAEC;AAED,8CAEC;AAMD,0BASC;AAtMD,mDAA+C;AAM/C;;;;;;;;;GASG;AACH,SAAgB,UAAU,CAA4B,OAA4B;IAChF,IAAI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;AAED,SAAgB,iBAAiB,CAAC,YAAoB;IACpD,OAAO,iBAAiB,CAAC,QAAQ,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC,CAAC;AACvD,CAAC;AAED;;;GAGG;AACH,SAAgB,OAAO,CAAC,WAAmB,EAAE,QAAgB;IAC3D,MAAM,EAAE,MAAM,EAAE,GAAG,WAAW,CAAC;IAE/B,IAAI,QAAQ,IAAI,MAAM,EAAE,CAAC;QACvB,OAAO,KAAK,CAAC;IACf,CAAC;IAED,MAAM,gBAAgB,GAAG,MAAM,GAAG,QAAQ,GAAG,CAAC,CAAC;IAC/C,OAAO,WAAW,CAAC,SAAS,CAAC,gBAAgB,EAAE,gBAAgB,GAAG,CAAC,CAAC,KAAK,GAAG,CAAC;AAC/E,CAAC","sourcesContent":["import { Address4 } from './ipv4';\nimport { Address6 } from './ipv6';\nimport { AddressError } from './address-error';\n\nexport interface ReverseFormOptions {\n omitSuffix?: boolean;\n}\n\n/**\n * Returns whether this address's *network* is contained within `address`,\n * i.e. whether every address this one can represent also falls inside\n * `address`. A network wider than `address` is not contained in it, so\n * `10.0.0.0/8` is not in `10.0.0.0/16`.\n *\n * To ask whether the address itself falls inside a range, ignoring any CIDR\n * suffix it was written with, use {@link isHostInSubnet} instead. That is the\n * question the special-use classifiers ask.\n */\nexport function isInSubnet(this: Address4 | Address6, address: Address4 | Address6) {\n if (this.subnetMask < address.subnetMask) {\n return false;\n }\n\n return isHostInSubnet.call(this, address);\n}\n\n/**\n * Returns whether this address's host bits fall inside `address`, ignoring\n * this address's own subnet mask.\n *\n * This is the primitive the special-use classifiers (`isLoopback`,\n * `isPrivate`, `isLinkLocal`, `getType`, …) are built on: they answer a\n * question about the address, so the answer must not change with the CIDR\n * suffix the caller happened to write. Use this rather than\n * {@link isInSubnet} when classifying a single address — notably when the\n * address came from untrusted input and the result backs a trust-boundary\n * decision such as an SSRF allow/deny filter.\n *\n * An address of one family is never inside a network of the other, so an\n * `Address4` against an `Address6` (or the reverse) is `false`. To compare\n * across families, convert first: `Address6.fromAddress4()`, `to4()`, or\n * `toAddress4Nat64()`.\n */\nexport function isHostInSubnet(this: Address4 | Address6, address: Address4 | Address6) {\n // mask() is a bit string of the family's width, and the leading bits of a\n // 32-bit string can coincide with those of a 128-bit one (a00::1 and\n // 10.0.0.0/8 both mask to 00001010), so the widths must agree before the\n // strings are compared.\n if (this.binaryZeroPad().length !== address.binaryZeroPad().length) {\n return false;\n }\n\n return this.mask(address.subnetMask) === address.mask();\n}\n\n/**\n * One parsed row of an IANA special-purpose address registry: the block, and\n * whether the registry marks it globally reachable (`null` when the column is\n * blank, in which case the containing block answers).\n */\nexport interface SpecialPurposeEntry<A extends Address4 | Address6> {\n subnet: A;\n reachable: boolean | null;\n}\n\n/**\n * Returns whether the registry marks this address globally reachable: the\n * answer of the most specific entry containing it that has one, or `true`\n * when no entry contains it.\n */\nexport function isGloballyReachable<A extends Address4 | Address6>(\n this: A,\n entries: ReadonlyArray<SpecialPurposeEntry<A>>,\n): boolean {\n let best: SpecialPurposeEntry<A> | null = null;\n\n for (let i = 0; i < entries.length; i++) {\n const entry = entries[i];\n\n if (\n entry.reachable !== null &&\n isHostInSubnet.call(this, entry.subnet) &&\n (best === null || entry.subnet.subnetMask > best.subnet.subnetMask)\n ) {\n best = entry;\n }\n }\n\n return best === null ? true : (best.reachable as boolean);\n}\n\n/**\n * Adds `n` to `value` and returns the result, throwing `AddressError` unless\n * `n` is an integer and the result stays within `[0, 2**bits - 1]`.\n */\nexport function offsetBigInt(\n value: bigint,\n n: number | bigint,\n bits: number,\n family: string,\n): bigint {\n if (typeof n === 'number' && !Number.isSafeInteger(n)) {\n throw new AddressError(`${family} offset must be an integer`);\n }\n\n if (typeof n !== 'number' && typeof n !== 'bigint') {\n throw new AddressError(`${family} offset must be an integer`);\n }\n\n const result = value + BigInt(n);\n\n if (result < BigInt(0) || result > (BigInt(1) << BigInt(bits)) - BigInt(1)) {\n throw new AddressError(`${family} offset leaves the address space`);\n }\n\n return result;\n}\n\nexport function isCorrect(defaultBits: number) {\n return function isCorrectForm(this: Address4 | Address6) {\n if (this.addressMinusSuffix !== this.correctForm()) {\n return false;\n }\n\n if (this.subnetMask === defaultBits && !this.parsedSubnet) {\n return true;\n }\n\n return this.parsedSubnet === String(this.subnetMask);\n };\n}\n\n/**\n * Returns the prefix length (number of leading 1 bits) of a contiguous\n * subnet mask. Throws `AddressError` if the mask is non-contiguous (e.g.\n * `255.0.255.0`).\n */\nexport function prefixLengthFromMask(value: bigint, totalBits: number): number {\n const binary = value.toString(2).padStart(totalBits, '0');\n\n if (binary.length > totalBits) {\n throw new AddressError('Invalid subnet mask.');\n }\n\n const firstZero = binary.indexOf('0');\n\n if (firstZero === -1) {\n return totalBits;\n }\n\n if (binary.slice(firstZero).includes('1')) {\n throw new AddressError('Invalid subnet mask.');\n }\n\n return firstZero;\n}\n\n/**\n * Throws `AddressError` unless `bytes` holds exactly `byteCount` integers,\n * each from `minimum` to 255. Pass a `minimum` of `-128` where signed bytes\n * are accepted and folded to unsigned, and `0` where they are not.\n */\nexport function assertByteArray(\n bytes: number[],\n byteCount: number,\n family: 'IPv4' | 'IPv6',\n minimum: number,\n): void {\n if (bytes.length !== byteCount) {\n throw new AddressError(`${family} addresses require exactly ${byteCount} bytes`);\n }\n\n for (let i = 0; i < bytes.length; i++) {\n if (!Number.isInteger(bytes[i]) || bytes[i] < minimum || bytes[i] > 255) {\n throw new AddressError(`All bytes must be integers between ${minimum} and 255`);\n }\n }\n}\n\nexport function numberToPaddedHex(number: number) {\n return number.toString(16).padStart(2, '0');\n}\n\nexport function stringToPaddedHex(numberString: string) {\n return numberToPaddedHex(parseInt(numberString, 10));\n}\n\n/**\n * @param binaryValue Binary representation of a value (e.g. `10`)\n * @param position Byte position, where 0 is the least significant bit\n */\nexport function testBit(binaryValue: string, position: number): boolean {\n const { length } = binaryValue;\n\n if (position >= length) {\n return false;\n }\n\n const positionInString = length - position - 1;\n return binaryValue.substring(positionInString, positionInString + 1) === '1';\n}\n"]}
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"bigint",
|
|
17
17
|
"browser"
|
|
18
18
|
],
|
|
19
|
-
"version": "10.7.
|
|
19
|
+
"version": "10.7.5",
|
|
20
20
|
"author": "Beau Gunderson <beau@beaugunderson.com> (https://beaugunderson.com/)",
|
|
21
21
|
"license": "MIT",
|
|
22
22
|
"main": "dist/ip-address.js",
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
"eslint-plugin-import": "^2.32.0",
|
|
81
81
|
"eslint-plugin-prettier": "^5.5.5",
|
|
82
82
|
"eslint-plugin-sort-imports-es6-autofix": "^0.6.0",
|
|
83
|
-
"mocha": "^
|
|
83
|
+
"mocha": "^12.0.3",
|
|
84
84
|
"monocart-coverage-reports": "^2.12.11",
|
|
85
85
|
"prettier": "^3.8.3",
|
|
86
86
|
"source-map-support": "^0.5.21",
|
|
@@ -17,7 +17,13 @@ npm install path-to-regexp --save
|
|
|
17
17
|
## Usage
|
|
18
18
|
|
|
19
19
|
```js
|
|
20
|
-
|
|
20
|
+
const {
|
|
21
|
+
match,
|
|
22
|
+
pathToRegexp,
|
|
23
|
+
compile,
|
|
24
|
+
parse,
|
|
25
|
+
stringify,
|
|
26
|
+
} = require("path-to-regexp");
|
|
21
27
|
```
|
|
22
28
|
|
|
23
29
|
### Parameters
|
|
@@ -72,12 +72,16 @@ export interface Wildcard {
|
|
|
72
72
|
*/
|
|
73
73
|
export interface Group {
|
|
74
74
|
type: "group";
|
|
75
|
-
tokens:
|
|
75
|
+
tokens: Token[];
|
|
76
76
|
}
|
|
77
77
|
/**
|
|
78
|
-
*
|
|
78
|
+
* A token that corresponds with a regexp capture.
|
|
79
79
|
*/
|
|
80
80
|
export type Key = Parameter | Wildcard;
|
|
81
|
+
/**
|
|
82
|
+
* A sequence of `path-to-regexp` keys that match capturing groups.
|
|
83
|
+
*/
|
|
84
|
+
export type Keys = Array<Key>;
|
|
81
85
|
/**
|
|
82
86
|
* A sequence of path match characters.
|
|
83
87
|
*/
|
|
@@ -85,9 +89,10 @@ export type Token = Text | Parameter | Wildcard | Group;
|
|
|
85
89
|
/**
|
|
86
90
|
* Tokenized path instance.
|
|
87
91
|
*/
|
|
88
|
-
export
|
|
89
|
-
tokens:
|
|
90
|
-
originalPath?: string;
|
|
92
|
+
export declare class TokenData {
|
|
93
|
+
readonly tokens: Token[];
|
|
94
|
+
readonly originalPath?: string | undefined;
|
|
95
|
+
constructor(tokens: Token[], originalPath?: string | undefined);
|
|
91
96
|
}
|
|
92
97
|
/**
|
|
93
98
|
* ParseError is thrown when there is an error processing the path.
|
|
@@ -122,7 +127,7 @@ export type Match<P extends ParamData> = false | MatchResult<P>;
|
|
|
122
127
|
*/
|
|
123
128
|
export type MatchFunction<P extends ParamData> = (path: string) => Match<P>;
|
|
124
129
|
/**
|
|
125
|
-
* Supported path
|
|
130
|
+
* Supported path types.
|
|
126
131
|
*/
|
|
127
132
|
export type Path = string | TokenData;
|
|
128
133
|
/**
|
|
@@ -134,7 +139,7 @@ export declare function match<P extends ParamData>(path: Path | Path[], options?
|
|
|
134
139
|
*/
|
|
135
140
|
export declare function pathToRegexp(path: Path | Path[], options?: PathToRegexpOptions & ParseOptions): {
|
|
136
141
|
regexp: RegExp;
|
|
137
|
-
keys:
|
|
142
|
+
keys: Keys;
|
|
138
143
|
};
|
|
139
144
|
/**
|
|
140
145
|
* Stringify token data into a path string.
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PathError = exports.TokenData = void 0;
|
|
4
|
+
exports.parse = parse;
|
|
5
|
+
exports.compile = compile;
|
|
6
|
+
exports.match = match;
|
|
7
|
+
exports.pathToRegexp = pathToRegexp;
|
|
8
|
+
exports.stringify = stringify;
|
|
1
9
|
const DEFAULT_DELIMITER = "/";
|
|
2
10
|
const NOOP_VALUE = (value) => value;
|
|
3
11
|
const ID_START = /^[$_\p{ID_Start}]$/u;
|
|
@@ -15,22 +23,34 @@ function escapeText(str) {
|
|
|
15
23
|
function escape(str) {
|
|
16
24
|
return str.replace(/[.+*?^${}()[\]|/\\]/g, "\\$&");
|
|
17
25
|
}
|
|
26
|
+
/**
|
|
27
|
+
* Tokenized path instance.
|
|
28
|
+
*/
|
|
29
|
+
class TokenData {
|
|
30
|
+
constructor(tokens, originalPath) {
|
|
31
|
+
this.tokens = tokens;
|
|
32
|
+
this.originalPath = originalPath;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
exports.TokenData = TokenData;
|
|
18
36
|
/**
|
|
19
37
|
* ParseError is thrown when there is an error processing the path.
|
|
20
38
|
*/
|
|
21
|
-
|
|
22
|
-
originalPath;
|
|
39
|
+
class PathError extends TypeError {
|
|
23
40
|
constructor(message, originalPath) {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
41
|
+
let text = message;
|
|
42
|
+
if (originalPath)
|
|
43
|
+
text += `: ${originalPath}`;
|
|
44
|
+
text += `; visit https://git.new/pathToRegexpError for info`;
|
|
45
|
+
super(text);
|
|
27
46
|
this.originalPath = originalPath;
|
|
28
47
|
}
|
|
29
48
|
}
|
|
49
|
+
exports.PathError = PathError;
|
|
30
50
|
/**
|
|
31
51
|
* Parse a string for the raw tokens.
|
|
32
52
|
*/
|
|
33
|
-
|
|
53
|
+
function parse(str, options = {}) {
|
|
34
54
|
const { encodePath = NOOP_VALUE } = options;
|
|
35
55
|
const chars = [...str];
|
|
36
56
|
let index = 0;
|
|
@@ -47,20 +67,20 @@ export function parse(str, options = {}) {
|
|
|
47
67
|
path = "";
|
|
48
68
|
}
|
|
49
69
|
while (index < chars.length) {
|
|
50
|
-
const
|
|
51
|
-
if (
|
|
70
|
+
const value = chars[index++];
|
|
71
|
+
if (value === end) {
|
|
52
72
|
writePath();
|
|
53
73
|
return output;
|
|
54
74
|
}
|
|
55
|
-
if (
|
|
75
|
+
if (value === "\\") {
|
|
56
76
|
if (index === chars.length) {
|
|
57
77
|
throw new PathError(`Unexpected end after \\ at index ${index}`, str);
|
|
58
78
|
}
|
|
59
79
|
path += chars[index++];
|
|
60
80
|
continue;
|
|
61
81
|
}
|
|
62
|
-
if (
|
|
63
|
-
const type =
|
|
82
|
+
if (value === ":" || value === "*") {
|
|
83
|
+
const type = value === ":" ? "param" : "wildcard";
|
|
64
84
|
let name = "";
|
|
65
85
|
if (ID_START.test(chars[index])) {
|
|
66
86
|
do {
|
|
@@ -91,7 +111,7 @@ export function parse(str, options = {}) {
|
|
|
91
111
|
output.push({ type, name });
|
|
92
112
|
continue;
|
|
93
113
|
}
|
|
94
|
-
if (
|
|
114
|
+
if (value === "{") {
|
|
95
115
|
writePath();
|
|
96
116
|
output.push({
|
|
97
117
|
type: "group",
|
|
@@ -99,10 +119,17 @@ export function parse(str, options = {}) {
|
|
|
99
119
|
});
|
|
100
120
|
continue;
|
|
101
121
|
}
|
|
102
|
-
if ("}
|
|
103
|
-
|
|
122
|
+
if (value === "}" ||
|
|
123
|
+
value === "(" ||
|
|
124
|
+
value === ")" ||
|
|
125
|
+
value === "[" ||
|
|
126
|
+
value === "]" ||
|
|
127
|
+
value === "+" ||
|
|
128
|
+
value === "?" ||
|
|
129
|
+
value === "!") {
|
|
130
|
+
throw new PathError(`Unexpected ${value} at index ${index - 1}`, str);
|
|
104
131
|
}
|
|
105
|
-
path +=
|
|
132
|
+
path += value;
|
|
106
133
|
}
|
|
107
134
|
if (end) {
|
|
108
135
|
throw new PathError(`Unexpected end at index ${index}, expected ${end}`, str);
|
|
@@ -110,15 +137,12 @@ export function parse(str, options = {}) {
|
|
|
110
137
|
writePath();
|
|
111
138
|
return output;
|
|
112
139
|
}
|
|
113
|
-
return
|
|
114
|
-
tokens: consumeUntil(""),
|
|
115
|
-
originalPath: str,
|
|
116
|
-
};
|
|
140
|
+
return new TokenData(consumeUntil(""), str);
|
|
117
141
|
}
|
|
118
142
|
/**
|
|
119
143
|
* Compile a string to a template function for the path.
|
|
120
144
|
*/
|
|
121
|
-
|
|
145
|
+
function compile(path, options = {}) {
|
|
122
146
|
const { encode = encodeURIComponent, delimiter = DEFAULT_DELIMITER } = options;
|
|
123
147
|
const data = typeof path === "object" ? path : parse(path, options);
|
|
124
148
|
const fn = tokensToFunction(data.tokens, delimiter, encode);
|
|
@@ -178,9 +202,6 @@ function tokenToFunction(token, delimiter, encode) {
|
|
|
178
202
|
result += delimiter;
|
|
179
203
|
result += encodeValue(value[i]);
|
|
180
204
|
}
|
|
181
|
-
if (!result) {
|
|
182
|
-
throw new TypeError(`Expected "${token.name}" to be a non-empty array`);
|
|
183
|
-
}
|
|
184
205
|
return result;
|
|
185
206
|
};
|
|
186
207
|
}
|
|
@@ -190,8 +211,8 @@ function tokenToFunction(token, delimiter, encode) {
|
|
|
190
211
|
missing.push(token.name);
|
|
191
212
|
return "";
|
|
192
213
|
}
|
|
193
|
-
if (typeof value !== "string"
|
|
194
|
-
throw new TypeError(`Expected "${token.name}" to be a
|
|
214
|
+
if (typeof value !== "string") {
|
|
215
|
+
throw new TypeError(`Expected "${token.name}" to be a string`);
|
|
195
216
|
}
|
|
196
217
|
return encodeValue(value);
|
|
197
218
|
};
|
|
@@ -199,7 +220,7 @@ function tokenToFunction(token, delimiter, encode) {
|
|
|
199
220
|
/**
|
|
200
221
|
* Transform a path into a match function.
|
|
201
222
|
*/
|
|
202
|
-
|
|
223
|
+
function match(path, options = {}) {
|
|
203
224
|
const { decode = decodeURIComponent, delimiter = DEFAULT_DELIMITER } = options;
|
|
204
225
|
const { regexp, keys } = pathToRegexp(path, options);
|
|
205
226
|
const decoders = keys.map((key) => {
|
|
@@ -228,7 +249,7 @@ export function match(path, options = {}) {
|
|
|
228
249
|
/**
|
|
229
250
|
* Transform a path into a regular expression and capture keys.
|
|
230
251
|
*/
|
|
231
|
-
|
|
252
|
+
function pathToRegexp(path, options = {}) {
|
|
232
253
|
const { delimiter = DEFAULT_DELIMITER, end = true, sensitive = false, trailing = true, } = options;
|
|
233
254
|
const keys = [];
|
|
234
255
|
let source = "";
|
|
@@ -246,12 +267,14 @@ export function pathToRegexp(path, options = {}) {
|
|
|
246
267
|
}
|
|
247
268
|
if (combinations > 0)
|
|
248
269
|
source += "|";
|
|
249
|
-
source += toRegExpSource(tokens, delimiter, keys, data.originalPath
|
|
270
|
+
source += toRegExpSource(tokens, delimiter, keys, data.originalPath);
|
|
250
271
|
combinations++;
|
|
251
272
|
});
|
|
252
273
|
}
|
|
253
274
|
process(path);
|
|
254
275
|
let pattern = `^(?:${source})`;
|
|
276
|
+
if (trailing)
|
|
277
|
+
pattern += "(?:" + escape(delimiter) + "$)?";
|
|
255
278
|
pattern += end ? "$" : "(?=" + escape(delimiter) + "|$)";
|
|
256
279
|
return { regexp: new RegExp(pattern, sensitive ? "" : "i"), keys };
|
|
257
280
|
}
|
|
@@ -274,82 +297,77 @@ function flatten(tokens, index, result, callback) {
|
|
|
274
297
|
/**
|
|
275
298
|
* Transform a flat sequence of tokens into a regular expression.
|
|
276
299
|
*/
|
|
277
|
-
function toRegExpSource(tokens, delimiter, keys, originalPath
|
|
300
|
+
function toRegExpSource(tokens, delimiter, keys, originalPath) {
|
|
278
301
|
let result = "";
|
|
279
|
-
let
|
|
280
|
-
let hasWildcardAhead = false;
|
|
281
|
-
let hasSegmentWildcard = false;
|
|
302
|
+
let backtrack = "";
|
|
282
303
|
let wildcardBacktrack = "";
|
|
304
|
+
let prevCaptureType = 0;
|
|
305
|
+
let hasSegmentCapture = 0;
|
|
283
306
|
let index = 0;
|
|
284
|
-
function
|
|
307
|
+
function hasInSegment(index, type) {
|
|
285
308
|
while (index < tokens.length) {
|
|
286
309
|
const token = tokens[index++];
|
|
287
|
-
if (token.type ===
|
|
310
|
+
if (token.type === type)
|
|
288
311
|
return true;
|
|
312
|
+
if (token.type === "text") {
|
|
313
|
+
if (token.value.includes(delimiter))
|
|
314
|
+
break;
|
|
315
|
+
}
|
|
289
316
|
}
|
|
290
317
|
return false;
|
|
291
318
|
}
|
|
292
|
-
function
|
|
319
|
+
function peekText(index) {
|
|
293
320
|
let result = "";
|
|
294
321
|
while (index < tokens.length) {
|
|
295
322
|
const token = tokens[index++];
|
|
296
323
|
if (token.type !== "text")
|
|
297
|
-
return result;
|
|
298
|
-
if (token.value.includes(delimiter))
|
|
299
324
|
break;
|
|
300
325
|
result += token.value;
|
|
301
326
|
}
|
|
327
|
+
return result;
|
|
302
328
|
}
|
|
303
329
|
while (index < tokens.length) {
|
|
304
330
|
const token = tokens[index++];
|
|
305
331
|
if (token.type === "text") {
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
332
|
+
result += escape(token.value);
|
|
333
|
+
backtrack += token.value;
|
|
334
|
+
if (prevCaptureType === 2)
|
|
335
|
+
wildcardBacktrack += token.value;
|
|
310
336
|
if (token.value.includes(delimiter))
|
|
311
|
-
|
|
337
|
+
hasSegmentCapture = 0;
|
|
312
338
|
continue;
|
|
313
339
|
}
|
|
314
340
|
if (token.type === "param" || token.type === "wildcard") {
|
|
315
|
-
if (
|
|
341
|
+
if (prevCaptureType && !backtrack) {
|
|
316
342
|
throw new PathError(`Missing text before "${token.name}" ${token.type}`, originalPath);
|
|
317
343
|
}
|
|
318
|
-
keys.push(token);
|
|
319
344
|
if (token.type === "param") {
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
else {
|
|
330
|
-
result += `(${negate(delimiter, "")}+)`;
|
|
331
|
-
}
|
|
332
|
-
}
|
|
345
|
+
result +=
|
|
346
|
+
hasSegmentCapture & 2 // Seen wildcard in segment.
|
|
347
|
+
? `(${negate(delimiter, backtrack)}+)`
|
|
348
|
+
: hasInSegment(index, "wildcard") // See wildcard later in segment.
|
|
349
|
+
? `(${negate(delimiter, peekText(index))}+)`
|
|
350
|
+
: hasSegmentCapture & 1 // Seen parameter in segment.
|
|
351
|
+
? `(${negate(delimiter, backtrack)}+|${escape(backtrack)})`
|
|
352
|
+
: `(${negate(delimiter, "")}+)`;
|
|
353
|
+
hasSegmentCapture |= prevCaptureType = 1;
|
|
333
354
|
}
|
|
334
355
|
else {
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
hasSegmentWildcard = true;
|
|
356
|
+
result +=
|
|
357
|
+
hasSegmentCapture & 2 // Seen wildcard in segment.
|
|
358
|
+
? `(${negate(backtrack, "")}+)`
|
|
359
|
+
: wildcardBacktrack // No capture in segment, seen wildcard in path.
|
|
360
|
+
? `(${negate(wildcardBacktrack, "")}+|${negate(delimiter, "")}+)`
|
|
361
|
+
: `([^]+)`;
|
|
342
362
|
wildcardBacktrack = "";
|
|
363
|
+
hasSegmentCapture |= prevCaptureType = 2;
|
|
343
364
|
}
|
|
344
|
-
|
|
345
|
-
|
|
365
|
+
keys.push(token);
|
|
366
|
+
backtrack = "";
|
|
346
367
|
continue;
|
|
347
368
|
}
|
|
348
369
|
throw new TypeError(`Unknown token type: ${token.type}`);
|
|
349
370
|
}
|
|
350
|
-
if (trailing && !prefix.endsWith(delimiter)) {
|
|
351
|
-
result += "(?:" + escape(delimiter) + "$)?";
|
|
352
|
-
}
|
|
353
371
|
return result;
|
|
354
372
|
}
|
|
355
373
|
/**
|
|
@@ -367,11 +385,9 @@ function negate(a, b) {
|
|
|
367
385
|
return `[^${escape(a + b)}]`;
|
|
368
386
|
}
|
|
369
387
|
/**
|
|
370
|
-
* Stringify
|
|
388
|
+
* Stringify an array of tokens into a path string.
|
|
371
389
|
*/
|
|
372
|
-
|
|
373
|
-
const { tokens } = data;
|
|
374
|
-
let index = 0;
|
|
390
|
+
function stringifyTokens(tokens, index) {
|
|
375
391
|
let value = "";
|
|
376
392
|
while (index < tokens.length) {
|
|
377
393
|
const token = tokens[index++];
|
|
@@ -380,15 +396,15 @@ export function stringify(data) {
|
|
|
380
396
|
continue;
|
|
381
397
|
}
|
|
382
398
|
if (token.type === "group") {
|
|
383
|
-
value += "{" +
|
|
399
|
+
value += "{" + stringifyTokens(token.tokens, 0) + "}";
|
|
384
400
|
continue;
|
|
385
401
|
}
|
|
386
402
|
if (token.type === "param") {
|
|
387
|
-
value += ":" + stringifyName(token.name, tokens
|
|
403
|
+
value += ":" + stringifyName(token.name, tokens[index]);
|
|
388
404
|
continue;
|
|
389
405
|
}
|
|
390
406
|
if (token.type === "wildcard") {
|
|
391
|
-
value += "*" + stringifyName(token.name, tokens
|
|
407
|
+
value += "*" + stringifyName(token.name, tokens[index]);
|
|
392
408
|
continue;
|
|
393
409
|
}
|
|
394
410
|
throw new TypeError(`Unknown token type: ${token.type}`);
|
|
@@ -396,35 +412,19 @@ export function stringify(data) {
|
|
|
396
412
|
return value;
|
|
397
413
|
}
|
|
398
414
|
/**
|
|
399
|
-
*
|
|
400
|
-
* treats specially inside a quoted name (`"` and `\`). `JSON.stringify` can't
|
|
401
|
-
* be used here because it emits escapes like `\n` that the parser reads back as
|
|
402
|
-
* the literal character `n`, so names with control characters wouldn't survive
|
|
403
|
-
* a `parse` -> `stringify` -> `parse` round trip.
|
|
415
|
+
* Stringify token data into a path string.
|
|
404
416
|
*/
|
|
405
|
-
function
|
|
406
|
-
return
|
|
417
|
+
function stringify(data) {
|
|
418
|
+
return stringifyTokens(data.tokens, 0);
|
|
407
419
|
}
|
|
408
420
|
/**
|
|
409
421
|
* Stringify a parameter name, escaping when it cannot be emitted directly.
|
|
410
422
|
*/
|
|
411
|
-
function stringifyName(name,
|
|
423
|
+
function stringifyName(name, next) {
|
|
412
424
|
if (!ID.test(name))
|
|
413
|
-
return
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
if (token.type === "text") {
|
|
417
|
-
if (!token.value)
|
|
418
|
-
continue;
|
|
419
|
-
// Destructuring reads the first *code point*, matching `parse`, which
|
|
420
|
-
// iterates the path with `[...str]`. Indexing with `[0]` would read only the
|
|
421
|
-
// leading surrogate of an astral character, missing that the parser treats
|
|
422
|
-
// the whole character as `ID_Continue` and absorbs it into the name.
|
|
423
|
-
const [first] = token.value;
|
|
424
|
-
if (ID_CONTINUE.test(first))
|
|
425
|
-
return quoteName(name);
|
|
426
|
-
}
|
|
427
|
-
break;
|
|
425
|
+
return JSON.stringify(name);
|
|
426
|
+
if ((next === null || next === void 0 ? void 0 : next.type) === "text" && ID_CONTINUE.test(next.value[0])) {
|
|
427
|
+
return JSON.stringify(name);
|
|
428
428
|
}
|
|
429
429
|
return name;
|
|
430
430
|
}
|