@bilal-fazlani/mock-server 0.2.1 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.next/standalone/.next/BUILD_ID +1 -1
- package/.next/standalone/.next/build-manifest.json +3 -3
- package/.next/standalone/.next/node_modules/shiki-43d062b67f27bbdc/dist/bundle-full.mjs +41 -0
- package/.next/standalone/.next/node_modules/shiki-43d062b67f27bbdc/dist/engine-oniguruma.mjs +8 -0
- package/.next/standalone/.next/node_modules/shiki-43d062b67f27bbdc/dist/index.mjs +29 -0
- package/.next/standalone/.next/node_modules/shiki-43d062b67f27bbdc/dist/langs-bundle-full-4noeO3oH.mjs +1283 -0
- package/.next/standalone/.next/node_modules/shiki-43d062b67f27bbdc/dist/rolldown-runtime-BBjsoOtd.mjs +27 -0
- package/.next/standalone/.next/node_modules/shiki-43d062b67f27bbdc/dist/themes.mjs +396 -0
- package/.next/standalone/.next/node_modules/shiki-43d062b67f27bbdc/dist/wasm.mjs +3 -0
- package/.next/standalone/.next/node_modules/shiki-43d062b67f27bbdc/package.json +73 -0
- package/.next/standalone/.next/prerender-manifest.json +3 -3
- package/.next/standalone/.next/required-server-files.json +4 -1
- package/.next/standalone/.next/server/app/[...path]/route.js +2 -2
- package/.next/standalone/.next/server/app/[...path]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/_global-error.html +1 -1
- package/.next/standalone/.next/server/app/_global-error.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/_not-found.html +1 -1
- package/.next/standalone/.next/server/app/_not-found.rsc +2 -2
- package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/index.html +1 -1
- package/.next/standalone/.next/server/app/index.rsc +2 -2
- package/.next/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/index.segments/_full.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/index.segments/_index.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/index.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/ui/[...notFound]/page.js +1 -1
- package/.next/standalone/.next/server/app/ui/[...notFound]/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/ui/[...notFound]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/ui/api/catalog/route.js +2 -2
- package/.next/standalone/.next/server/app/ui/api/catalog/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/ui/api/global-mocks/[system]/[endpoint]/route.js +2 -2
- package/.next/standalone/.next/server/app/ui/api/global-mocks/[system]/[endpoint]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/ui/api/global-mocks/route.js +1 -1
- package/.next/standalone/.next/server/app/ui/api/global-mocks/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/ui/api/health/route.js +1 -1
- package/.next/standalone/.next/server/app/ui/api/health/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/ui/api/logs/[logId]/route.js +1 -1
- package/.next/standalone/.next/server/app/ui/api/logs/[logId]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/ui/api/logs/route.js +1 -1
- package/.next/standalone/.next/server/app/ui/api/logs/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/ui/api/profiles/[profileId]/reset/route.js +1 -1
- package/.next/standalone/.next/server/app/ui/api/profiles/[profileId]/reset/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/ui/api/profiles/[profileId]/route.js +2 -2
- package/.next/standalone/.next/server/app/ui/api/profiles/[profileId]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/ui/catalog/[system]/[endpoint]/page.js +8 -7
- package/.next/standalone/.next/server/app/ui/catalog/[system]/[endpoint]/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/ui/catalog/[system]/[endpoint]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/ui/catalog/page.js +5 -5
- package/.next/standalone/.next/server/app/ui/catalog/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/ui/catalog/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/ui/environment/page.js +4 -4
- package/.next/standalone/.next/server/app/ui/environment/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/ui/environment/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/ui/global-mocks/page/server-reference-manifest.json +2 -2
- package/.next/standalone/.next/server/app/ui/global-mocks/page.js +4 -4
- package/.next/standalone/.next/server/app/ui/global-mocks/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/ui/global-mocks/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/ui/logs/page/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/server/app/ui/logs/page.js +5 -5
- package/.next/standalone/.next/server/app/ui/logs/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/ui/logs/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/ui/page.js +4 -4
- package/.next/standalone/.next/server/app/ui/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/ui/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/ui/profiles/[profileId]/page/server-reference-manifest.json +4 -4
- package/.next/standalone/.next/server/app/ui/profiles/[profileId]/page.js +6 -6
- package/.next/standalone/.next/server/app/ui/profiles/[profileId]/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/ui/profiles/[profileId]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/ui/profiles/new/page/server-reference-manifest.json +4 -4
- package/.next/standalone/.next/server/app/ui/profiles/new/page.js +5 -5
- package/.next/standalone/.next/server/app/ui/profiles/new/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/ui/profiles/new/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/ui/profiles/new.html +1 -1
- package/.next/standalone/.next/server/app/ui/profiles/new.rsc +31 -31
- package/.next/standalone/.next/server/app/ui/profiles/new.segments/_full.segment.rsc +31 -31
- package/.next/standalone/.next/server/app/ui/profiles/new.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/ui/profiles/new.segments/_index.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/ui/profiles/new.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/ui/profiles/new.segments/ui/profiles/new/__PAGE__.segment.rsc +18 -17
- package/.next/standalone/.next/server/app/ui/profiles/new.segments/ui/profiles/new.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/ui/profiles/new.segments/ui/profiles.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/ui/profiles/new.segments/ui.segment.rsc +3 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0_w4w88._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0eo49or._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0om7kg8._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0s6drot._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0t8o5f7._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__14hrty_._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1d3vxpt._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1e407ve._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1islaxo._.js +3 -0
- package/.next/standalone/.next/server/chunks/{_01xbyam._.js → _0qbx9v1._.js} +6 -6
- package/.next/standalone/.next/server/chunks/{_0022gwg._.js → _16q11je._.js} +6 -6
- package/.next/standalone/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_1hi1g43.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__095ld3v._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0c_8sxb._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__131d-3a._.js → [root-of-the-server]__0ok8mg5._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0uln_1r._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0xmt17v._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__16y93ju._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__18_kqdp._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__18z_8pt._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1ac328a._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1ffkjjl._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1gmmta4._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1k-7k5k._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1po4if1._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1r99_25._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1xkfxwl._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__20xpe3a._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_0ceyznt._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{_1s8xzfs._.js → _0dcewjo._.js} +5 -5
- package/.next/standalone/.next/server/chunks/ssr/_0dp2bez._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_0hv6b4i._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_0txvxmw._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_13ez5qw._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_142--49._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_1nyvjoj._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/src_1s6weq_._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_app_ui_logs_LogRow_tsx_1mzipt8._.js +1 -1
- package/.next/standalone/.next/server/middleware-build-manifest.js +3 -3
- package/.next/standalone/.next/server/pages/404.html +1 -1
- package/.next/standalone/.next/server/pages/500.html +1 -1
- package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/server-reference-manifest.json +8 -8
- package/.next/standalone/.next/static/chunks/12ny879muwkxw.js +1 -0
- package/.next/standalone/.next/static/chunks/18hh57jv94a5e.js +1 -0
- package/.next/standalone/.next/static/chunks/1rml3lmlc_-1c.js +1 -0
- package/.next/standalone/.next/static/chunks/1zxhmuljxo270.js +1 -0
- package/.next/standalone/.next/static/chunks/2bqfpygv3x9-k.js +1 -0
- package/.next/standalone/.next/static/chunks/3fpjbzbf26aey.js +1 -0
- package/.next/standalone/.next/static/chunks/3ivfq435-2tni.css +3 -0
- package/.next/standalone/next.config.ts +32 -0
- package/.next/standalone/node_modules/@shikijs/core/dist/index.mjs +1406 -0
- package/.next/standalone/node_modules/@shikijs/core/package.json +60 -0
- package/.next/standalone/node_modules/@shikijs/engine-javascript/dist/engine-compile.mjs +47 -0
- package/.next/standalone/node_modules/@shikijs/engine-javascript/dist/engine-raw.mjs +27 -0
- package/.next/standalone/node_modules/@shikijs/engine-javascript/dist/index.mjs +4 -0
- package/.next/standalone/node_modules/@shikijs/engine-javascript/dist/scanner-DX8LRFGE.mjs +77 -0
- package/.next/standalone/node_modules/@shikijs/engine-javascript/package.json +42 -0
- package/.next/standalone/node_modules/@shikijs/engine-oniguruma/dist/index.mjs +449 -0
- package/.next/standalone/node_modules/@shikijs/engine-oniguruma/dist/wasm-inlined.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/engine-oniguruma/package.json +45 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/abap.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/actionscript-3.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/ada.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/angular-expression.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/angular-html.mjs +16 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/angular-inline-style.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/angular-inline-template.mjs +10 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/angular-let-declaration.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/angular-template-blocks.mjs +10 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/angular-template.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/angular-ts.mjs +18 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/apache.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/apex.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/apl.mjs +16 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/applescript.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/ara.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/asciidoc.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/asm.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/astro.mjs +18 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/awk.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/ballerina.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/bat.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/beancount.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/berry.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/bibtex.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/bicep.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/bird2.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/blade.mjs +20 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/bsl.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/c.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/c3.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/cadence.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/cairo.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/clarity.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/clojure.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/cmake.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/cobol.mjs +10 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/codeowners.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/codeql.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/coffee.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/common-lisp.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/coq.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/cpp-macro.mjs +12 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/cpp.mjs +14 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/crystal.mjs +18 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/csharp.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/css.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/csv.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/cue.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/cypher.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/d.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/dart.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/dax.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/desktop.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/diff.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/docker.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/dotenv.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/dream-maker.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/edge.mjs +12 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/elixir.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/elm.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/emacs-lisp.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/erb.mjs +10 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/erlang.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/es-tag-css.mjs +12 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/es-tag-glsl.mjs +12 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/es-tag-html.mjs +12 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/es-tag-sql.mjs +10 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/es-tag-xml.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/fennel.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/fish.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/fluent.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/fortran-fixed-form.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/fortran-free-form.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/fsharp.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/gdresource.mjs +10 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/gdscript.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/gdshader.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/genie.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/gherkin.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/git-commit.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/git-rebase.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/gleam.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/glimmer-js.mjs +14 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/glimmer-ts.mjs +14 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/glsl.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/gn.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/gnuplot.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/go.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/graphql.mjs +14 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/groovy.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/hack.mjs +10 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/haml.mjs +10 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/handlebars.mjs +14 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/haskell.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/haxe.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/hcl.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/hjson.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/hlsl.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/html-derivative.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/html.mjs +10 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/http.mjs +14 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/hurl.mjs +12 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/hxml.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/hy.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/imba.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/ini.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/java.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/javascript.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/jinja-html.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/jinja.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/jison.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/json.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/json5.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/jsonc.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/jsonl.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/jsonnet.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/jssm.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/jsx.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/julia.mjs +16 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/just.mjs +18 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/kdl.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/kotlin.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/kusto.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/latex.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/lean.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/less.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/liquid.mjs +14 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/llvm.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/log.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/logo.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/lua.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/luau.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/make.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/markdown-nix.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/markdown-vue.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/markdown.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/marko.mjs +14 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/matlab.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/mdc.mjs +12 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/mdx.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/mermaid.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/mipsasm.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/mojo.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/moonbit.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/move.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/narrat.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/nextflow-groovy.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/nextflow.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/nginx.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/nim.mjs +20 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/nix.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/nushell.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/objective-c.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/objective-cpp.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/ocaml.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/odin.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/openscad.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/pascal.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/perl.mjs +16 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/php.mjs +18 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/pkl.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/plsql.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/po.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/polar.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/postcss.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/powerquery.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/powershell.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/prisma.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/prolog.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/proto.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/pug.mjs +12 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/puppet.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/purescript.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/python.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/qml.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/qmldir.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/qss.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/r.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/racket.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/raku.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/razor.mjs +10 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/reg.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/regexp.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/rel.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/riscv.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/ron.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/rosmsg.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/rst.mjs +22 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/ruby.mjs +30 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/rust.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/sas.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/sass.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/scala.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/scheme.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/scss.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/sdbl.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/shaderlab.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/shellscript.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/shellsession.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/smalltalk.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/solidity.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/soy.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/sparql.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/splunk.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/sql.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/ssh-config.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/stata.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/stylus.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/surrealql.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/svelte.mjs +14 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/swift.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/system-verilog.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/systemd.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/talonscript.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/tasl.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/tcl.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/templ.mjs +12 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/terraform.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/tex.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/toml.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/ts-tags.mjs +18 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/tsv.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/tsx.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/turtle.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/twig.mjs +18 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/typescript.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/typespec.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/typst.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/v.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/vala.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/vb.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/verilog.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/vhdl.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/viml.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/vue-directives.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/vue-html.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/vue-interpolations.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/vue-sfc-style-variable-injection.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/vue-vine.mjs +18 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/vue.mjs +26 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/vyper.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/wasm.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/wenyan.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/wgsl.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/wikitext.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/wit.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/wolfram.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/xml.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/xsl.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/yaml.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/zenscript.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/zig.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/package.json +387 -0
- package/.next/standalone/node_modules/@shikijs/primitive/dist/index.mjs +834 -0
- package/.next/standalone/node_modules/@shikijs/primitive/package.json +56 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/andromeeda.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/aurora-x.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/ayu-dark.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/ayu-light.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/ayu-mirage.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/catppuccin-frappe.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/catppuccin-latte.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/catppuccin-macchiato.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/catppuccin-mocha.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/dark-plus.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/dracula-soft.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/dracula.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/everforest-dark.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/everforest-light.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/github-dark-default.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/github-dark-dimmed.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/github-dark-high-contrast.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/github-dark.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/github-light-default.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/github-light-high-contrast.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/github-light.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/gruvbox-dark-hard.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/gruvbox-dark-medium.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/gruvbox-dark-soft.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/gruvbox-light-hard.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/gruvbox-light-medium.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/gruvbox-light-soft.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/horizon-bright.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/horizon.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/houston.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/kanagawa-dragon.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/kanagawa-lotus.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/kanagawa-wave.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/laserwave.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/light-plus.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/material-theme-darker.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/material-theme-lighter.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/material-theme-ocean.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/material-theme-palenight.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/material-theme.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/min-dark.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/min-light.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/monokai.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/night-owl-light.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/night-owl.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/nord.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/one-dark-pro.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/one-light.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/plastic.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/poimandres.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/red.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/rose-pine-dawn.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/rose-pine-moon.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/rose-pine.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/slack-dark.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/slack-ochin.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/snazzy-light.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/solarized-dark.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/solarized-light.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/synthwave-84.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/tokyo-night.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/vesper.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/vitesse-black.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/vitesse-dark.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/vitesse-light.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/package.json +106 -0
- package/.next/standalone/node_modules/@shikijs/types/dist/index.mjs +9 -0
- package/.next/standalone/node_modules/@shikijs/types/package.json +39 -0
- package/.next/standalone/node_modules/@shikijs/vscode-textmate/dist/index.js +3216 -0
- package/.next/standalone/node_modules/@shikijs/vscode-textmate/package.json +46 -0
- package/.next/standalone/node_modules/ccount/index.js +27 -0
- package/.next/standalone/node_modules/ccount/package.json +71 -0
- package/.next/standalone/node_modules/character-entities-html4/index.js +259 -0
- package/.next/standalone/node_modules/character-entities-html4/package.json +79 -0
- package/.next/standalone/node_modules/character-entities-legacy/index.js +113 -0
- package/.next/standalone/node_modules/character-entities-legacy/package.json +77 -0
- package/.next/standalone/node_modules/comma-separated-tokens/index.js +74 -0
- package/.next/standalone/node_modules/comma-separated-tokens/package.json +72 -0
- package/.next/standalone/node_modules/hast-util-to-html/index.js +8 -0
- package/.next/standalone/node_modules/hast-util-to-html/lib/handle/comment.js +52 -0
- package/.next/standalone/node_modules/hast-util-to-html/lib/handle/doctype.js +27 -0
- package/.next/standalone/node_modules/hast-util-to-html/lib/handle/element.js +265 -0
- package/.next/standalone/node_modules/hast-util-to-html/lib/handle/index.js +47 -0
- package/.next/standalone/node_modules/hast-util-to-html/lib/handle/raw.js +27 -0
- package/.next/standalone/node_modules/hast-util-to-html/lib/handle/root.js +22 -0
- package/.next/standalone/node_modules/hast-util-to-html/lib/handle/text.js +38 -0
- package/.next/standalone/node_modules/hast-util-to-html/lib/index.js +257 -0
- package/.next/standalone/node_modules/hast-util-to-html/lib/omission/closing.js +358 -0
- package/.next/standalone/node_modules/hast-util-to-html/lib/omission/omission.js +44 -0
- package/.next/standalone/node_modules/hast-util-to-html/lib/omission/opening.js +148 -0
- package/.next/standalone/node_modules/hast-util-to-html/lib/omission/util/siblings.js +50 -0
- package/.next/standalone/node_modules/hast-util-to-html/package.json +106 -0
- package/.next/standalone/node_modules/hast-util-whitespace/index.js +1 -0
- package/.next/standalone/node_modules/hast-util-whitespace/lib/index.js +34 -0
- package/.next/standalone/node_modules/hast-util-whitespace/package.json +83 -0
- package/.next/standalone/node_modules/html-void-elements/index.js +27 -0
- package/.next/standalone/node_modules/html-void-elements/package.json +79 -0
- package/.next/standalone/node_modules/oniguruma-parser/dist/parser/node-utils.js +2 -0
- package/.next/standalone/node_modules/oniguruma-parser/dist/parser/parse.js +2 -0
- package/.next/standalone/node_modules/oniguruma-parser/dist/tokenizer/tokenize.js +34 -0
- package/.next/standalone/node_modules/oniguruma-parser/dist/traverser/traverse.js +2 -0
- package/.next/standalone/node_modules/oniguruma-parser/dist/utils.js +2 -0
- package/.next/standalone/node_modules/oniguruma-parser/package.json +64 -0
- package/.next/standalone/node_modules/oniguruma-to-es/dist/esm/index.js +1878 -0
- package/.next/standalone/node_modules/oniguruma-to-es/dist/esm/package.json +1 -0
- package/.next/standalone/node_modules/oniguruma-to-es/package.json +61 -0
- package/.next/standalone/node_modules/property-information/index.js +17 -0
- package/.next/standalone/node_modules/property-information/lib/aria.js +61 -0
- package/.next/standalone/node_modules/property-information/lib/find.js +97 -0
- package/.next/standalone/node_modules/property-information/lib/hast-to-react.js +30 -0
- package/.next/standalone/node_modules/property-information/lib/html.js +332 -0
- package/.next/standalone/node_modules/property-information/lib/normalize.js +12 -0
- package/.next/standalone/node_modules/property-information/lib/svg.js +569 -0
- package/.next/standalone/node_modules/property-information/lib/util/case-insensitive-transform.js +13 -0
- package/.next/standalone/node_modules/property-information/lib/util/case-sensitive-transform.js +11 -0
- package/.next/standalone/node_modules/property-information/lib/util/create.js +69 -0
- package/.next/standalone/node_modules/property-information/lib/util/defined-info.js +60 -0
- package/.next/standalone/node_modules/property-information/lib/util/info.js +32 -0
- package/.next/standalone/node_modules/property-information/lib/util/merge.js +27 -0
- package/.next/standalone/node_modules/property-information/lib/util/schema.js +29 -0
- package/.next/standalone/node_modules/property-information/lib/util/types.js +13 -0
- package/.next/standalone/node_modules/property-information/lib/xlink.js +17 -0
- package/.next/standalone/node_modules/property-information/lib/xml.js +9 -0
- package/.next/standalone/node_modules/property-information/lib/xmlns.js +9 -0
- package/.next/standalone/node_modules/property-information/package.json +84 -0
- package/.next/standalone/node_modules/regex/package.json +60 -0
- package/.next/standalone/node_modules/regex/src/atomic.js +224 -0
- package/.next/standalone/node_modules/regex/src/internals.js +2 -0
- package/.next/standalone/node_modules/regex/src/subclass.js +98 -0
- package/.next/standalone/node_modules/regex/src/utils-internals.js +33 -0
- package/.next/standalone/node_modules/regex-recursion/package.json +47 -0
- package/.next/standalone/node_modules/regex-recursion/src/index.js +365 -0
- package/.next/standalone/node_modules/regex-utilities/package.json +35 -0
- package/.next/standalone/node_modules/regex-utilities/src/index.js +170 -0
- package/.next/standalone/node_modules/shiki/dist/bundle-full.mjs +41 -0
- package/.next/standalone/node_modules/shiki/dist/engine-oniguruma.mjs +8 -0
- package/.next/standalone/node_modules/shiki/dist/index.mjs +29 -0
- package/.next/standalone/node_modules/shiki/dist/langs-bundle-full-4noeO3oH.mjs +1283 -0
- package/.next/standalone/node_modules/shiki/dist/rolldown-runtime-BBjsoOtd.mjs +27 -0
- package/.next/standalone/node_modules/shiki/dist/themes.mjs +396 -0
- package/.next/standalone/node_modules/shiki/dist/wasm.mjs +3 -0
- package/.next/standalone/node_modules/shiki/package.json +73 -0
- package/.next/standalone/node_modules/space-separated-tokens/index.js +24 -0
- package/.next/standalone/node_modules/space-separated-tokens/package.json +67 -0
- package/.next/standalone/node_modules/stringify-entities/index.js +6 -0
- package/.next/standalone/node_modules/stringify-entities/lib/constant/dangerous.js +16 -0
- package/.next/standalone/node_modules/stringify-entities/lib/core.js +117 -0
- package/.next/standalone/node_modules/stringify-entities/lib/index.js +36 -0
- package/.next/standalone/node_modules/stringify-entities/lib/util/format-basic.js +9 -0
- package/.next/standalone/node_modules/stringify-entities/lib/util/format-smart.js +69 -0
- package/.next/standalone/node_modules/stringify-entities/lib/util/to-decimal.js +16 -0
- package/.next/standalone/node_modules/stringify-entities/lib/util/to-hexadecimal.js +16 -0
- package/.next/standalone/node_modules/stringify-entities/lib/util/to-named.js +57 -0
- package/.next/standalone/node_modules/stringify-entities/package.json +86 -0
- package/.next/standalone/node_modules/zwitch/index.js +118 -0
- package/.next/standalone/node_modules/zwitch/package.json +72 -0
- package/.next/standalone/package-lock.json +719 -672
- package/.next/standalone/package.json +2 -1
- package/.next/standalone/release-please-config.json +1 -0
- package/.next/standalone/scripts/validate-catalog.ts +38 -0
- package/.next/standalone/server.js +1 -1
- package/.next/standalone/src/app/[...path]/route.ts +41 -0
- package/.next/standalone/src/app/ui/api/catalog/route.ts +32 -0
- package/.next/standalone/src/app/ui/api/global-mocks/[system]/[endpoint]/route.ts +53 -0
- package/.next/standalone/src/app/ui/api/global-mocks/route.ts +8 -0
- package/.next/standalone/src/app/ui/api/health/route.ts +47 -0
- package/.next/standalone/src/app/ui/api/logs/[logId]/route.ts +15 -0
- package/.next/standalone/src/app/ui/api/logs/route.ts +24 -0
- package/.next/standalone/src/app/ui/api/profiles/[profileId]/reset/route.ts +25 -0
- package/.next/standalone/src/app/ui/api/profiles/[profileId]/route.ts +64 -0
- package/.next/standalone/src/app/ui/catalog/highlight.ts +12 -0
- package/.next/standalone/src/app/ui/catalog/scenario-view.ts +68 -0
- package/.next/standalone/src/app/ui/global-mocks/actions.ts +50 -0
- package/.next/standalone/src/app/ui/logs/actions.ts +11 -0
- package/.next/standalone/src/app/ui/logs/list-state.ts +64 -0
- package/.next/standalone/src/app/ui/logs/types.ts +17 -0
- package/.next/standalone/src/app/ui/profiles/actions.ts +60 -0
- package/.next/standalone/src/lib/build-info.ts +13 -0
- package/.next/standalone/src/lib/catalog/find.ts +17 -0
- package/.next/standalone/src/lib/catalog/load.ts +226 -0
- package/.next/standalone/src/lib/catalog/path-template.ts +63 -0
- package/.next/standalone/src/lib/catalog/request-example.ts +96 -0
- package/.next/standalone/src/lib/catalog/schema.ts +154 -0
- package/.next/standalone/src/lib/catalog/selector.ts +153 -0
- package/.next/standalone/src/lib/catalog/types.ts +43 -0
- package/.next/standalone/src/lib/catalog/validate.ts +290 -0
- package/.next/standalone/src/lib/config.ts +93 -0
- package/.next/standalone/src/lib/dynamic/history-store.ts +68 -0
- package/.next/standalone/src/lib/environment.ts +155 -0
- package/.next/standalone/src/lib/format.ts +3 -0
- package/.next/standalone/src/lib/logs/admin-log.ts +27 -0
- package/.next/standalone/src/lib/logs/store.ts +153 -0
- package/.next/standalone/src/lib/mock-engine/fixtures.ts +38 -0
- package/.next/standalone/src/lib/mock-engine/resolver.ts +110 -0
- package/.next/standalone/src/lib/mock-engine/template.ts +71 -0
- package/.next/standalone/src/lib/mongo/embedded.ts +40 -0
- package/.next/standalone/src/lib/profiles/api-scenarios.ts +69 -0
- package/.next/standalone/src/lib/profiles/form.ts +64 -0
- package/.next/standalone/src/lib/profiles/stale.ts +56 -0
- package/.next/standalone/src/lib/profiles/store.ts +420 -0
- package/.next/standalone/src/lib/router/handler.ts +187 -0
- package/.next/standalone/src/lib/router/passthrough.ts +86 -0
- package/.next/standalone/src/lib/router/route-request.ts +645 -0
- package/.next/standalone/src/lib/runtime.ts +150 -0
- package/.next/standalone/src/lib/scenarios.ts +52 -0
- package/.next/standalone/src/lib/utils.ts +6 -0
- package/.next/standalone/tests/api/catalog-route.test.ts +72 -0
- package/.next/standalone/tests/api/global-mocks-route.test.ts +171 -0
- package/.next/standalone/tests/api/profiles-reset-route.test.ts +50 -0
- package/.next/standalone/tests/api/profiles-route.test.ts +132 -0
- package/.next/standalone/tests/bin/args.test.ts +42 -0
- package/.next/standalone/tests/catalog/find.test.ts +40 -0
- package/.next/standalone/tests/catalog/load.test.ts +258 -0
- package/.next/standalone/tests/catalog/path-template.test.ts +79 -0
- package/.next/standalone/tests/catalog/request-example.test.ts +86 -0
- package/.next/standalone/tests/catalog/schema.test.ts +249 -0
- package/.next/standalone/tests/catalog/selector.test.ts +175 -0
- package/.next/standalone/tests/catalog/validate.test.ts +462 -0
- package/.next/standalone/tests/dynamic/history-store.test.ts +82 -0
- package/.next/standalone/tests/global-mocks/actions.test.ts +192 -0
- package/.next/standalone/tests/lib/config-catalog-dir.test.ts +17 -0
- package/.next/standalone/tests/lib/config.test.ts +99 -0
- package/.next/standalone/tests/lib/environment.test.ts +115 -0
- package/.next/standalone/tests/lib/format.test.ts +8 -0
- package/.next/standalone/tests/lib/runtime.test.ts +153 -0
- package/.next/standalone/tests/lib/scenarios.test.ts +88 -0
- package/.next/standalone/tests/logs/admin-log.test.ts +51 -0
- package/.next/standalone/tests/logs/store.test.ts +233 -0
- package/.next/standalone/tests/mock-engine/fixtures.test.ts +33 -0
- package/.next/standalone/tests/mock-engine/resolver.test.ts +117 -0
- package/.next/standalone/tests/mock-engine/template.test.ts +74 -0
- package/.next/standalone/tests/mongo/embedded.test.ts +78 -0
- package/.next/standalone/tests/profiles/actions.test.ts +183 -0
- package/.next/standalone/tests/profiles/api-scenarios.test.ts +105 -0
- package/.next/standalone/tests/profiles/form.test.ts +181 -0
- package/.next/standalone/tests/profiles/request-log-ttl-index.test.ts +62 -0
- package/.next/standalone/tests/profiles/stale.test.ts +174 -0
- package/.next/standalone/tests/profiles/store.test.ts +470 -0
- package/.next/standalone/tests/router/dynamic.e2e.test.ts +147 -0
- package/.next/standalone/tests/router/handler.e2e.test.ts +97 -0
- package/.next/standalone/tests/router/handler.test.ts +344 -0
- package/.next/standalone/tests/router/passthrough.test.ts +100 -0
- package/.next/standalone/tests/router/route-request.test.ts +1147 -0
- package/.next/standalone/tests/testdata/fixtures/test-system/hello_world/by_amount.ts +3 -0
- package/.next/standalone/tests/testdata/fixtures/test-system/resolver_default/hold.json +1 -0
- package/.next/standalone/tests/testdata/fixtures/test-system/resolver_default/success.json +1 -0
- package/.next/standalone/tests/ui/list-state.test.ts +84 -0
- package/.next/standalone/tests/ui/log-summary-view.test.ts +24 -0
- package/.next/standalone/tests/ui/scenario-view.test.ts +138 -0
- package/.next/standalone/vitest.config.ts +19 -0
- package/package.json +2 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0668hgm._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__078olc9._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0f-_c79._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0geqpjb._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0uudiqz._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0wg041t._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__19qak1g._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1eiw7ks._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1qb7sih._.js +0 -3
- package/.next/standalone/.next/server/chunks/_095ilyi._.js +0 -11
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__05255v2._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0dmadib._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0jey74_._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0nj8b73._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__12oahit._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__14u5l1_._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1bbz1wr._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1eoh3gn._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1kd5kn_._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1kie6ah._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1u6i1bm._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1ypwv93._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_0a347_9._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_0btcklf._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_0exg_3l._.js +0 -11
- package/.next/standalone/.next/server/chunks/ssr/_1_7ssjl._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_1hdkp-g._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_1jfkfx-._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/node_modules_10liiot._.js +0 -3
- package/.next/standalone/.next/static/chunks/08ghjqetuoc_b.js +0 -1
- package/.next/standalone/.next/static/chunks/19w2nv_pvssix.js +0 -1
- package/.next/standalone/.next/static/chunks/1ljc320o2yhky.js +0 -1
- package/.next/standalone/.next/static/chunks/2akx4rvdzbimg.css +0 -3
- package/.next/standalone/.next/static/chunks/2kg3qe34tmgob.js +0 -1
- package/.next/standalone/.next/static/chunks/2nlgh2oq4eg96.js +0 -1
- package/.next/standalone/.next/static/chunks/30olthhuj56a1.js +0 -1
- /package/.next/standalone/.next/static/{SV1UWx8kQm3m26f1jMoBU → 8CkjRpETX_8CM0X2xtdJ7}/_buildManifest.js +0 -0
- /package/.next/standalone/.next/static/{SV1UWx8kQm3m26f1jMoBU → 8CkjRpETX_8CM0X2xtdJ7}/_clientMiddlewareManifest.js +0 -0
- /package/.next/standalone/.next/static/{SV1UWx8kQm3m26f1jMoBU → 8CkjRpETX_8CM0X2xtdJ7}/_ssgManifest.js +0 -0
- /package/.next/standalone/catalog/hello-system/account_balance/{_dynamic.ts → dynamic.ts} +0 -0
|
@@ -0,0 +1,1878 @@
|
|
|
1
|
+
// src/utils.js
|
|
2
|
+
var cp = String.fromCodePoint;
|
|
3
|
+
var r = String.raw;
|
|
4
|
+
var envFlags = {};
|
|
5
|
+
var globalRegExp = globalThis.RegExp;
|
|
6
|
+
envFlags.flagGroups = (() => {
|
|
7
|
+
try {
|
|
8
|
+
new globalRegExp("(?i:)");
|
|
9
|
+
} catch {
|
|
10
|
+
return false;
|
|
11
|
+
}
|
|
12
|
+
return true;
|
|
13
|
+
})();
|
|
14
|
+
envFlags.unicodeSets = (() => {
|
|
15
|
+
try {
|
|
16
|
+
new globalRegExp("[[]]", "v");
|
|
17
|
+
} catch {
|
|
18
|
+
return false;
|
|
19
|
+
}
|
|
20
|
+
return true;
|
|
21
|
+
})();
|
|
22
|
+
envFlags.bugFlagVLiteralHyphenIsRange = envFlags.unicodeSets ? (() => {
|
|
23
|
+
try {
|
|
24
|
+
new globalRegExp(r`[\d\-a]`, "v");
|
|
25
|
+
} catch {
|
|
26
|
+
return true;
|
|
27
|
+
}
|
|
28
|
+
return false;
|
|
29
|
+
})() : false;
|
|
30
|
+
envFlags.bugNestedClassIgnoresNegation = envFlags.unicodeSets && new globalRegExp("[[^a]]", "v").test("a");
|
|
31
|
+
function getNewCurrentFlags(current, { enable, disable }) {
|
|
32
|
+
return {
|
|
33
|
+
dotAll: !disable?.dotAll && !!(enable?.dotAll || current.dotAll),
|
|
34
|
+
ignoreCase: !disable?.ignoreCase && !!(enable?.ignoreCase || current.ignoreCase)
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
function getOrInsert(map, key, defaultValue) {
|
|
38
|
+
if (!map.has(key)) {
|
|
39
|
+
map.set(key, defaultValue);
|
|
40
|
+
}
|
|
41
|
+
return map.get(key);
|
|
42
|
+
}
|
|
43
|
+
function isMinTarget(target, min) {
|
|
44
|
+
return EsVersion[target] >= EsVersion[min];
|
|
45
|
+
}
|
|
46
|
+
function throwIfNullish(value, msg) {
|
|
47
|
+
if (value == null) {
|
|
48
|
+
throw new Error(msg ?? "Value expected");
|
|
49
|
+
}
|
|
50
|
+
return value;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// src/options.js
|
|
54
|
+
var EsVersion = {
|
|
55
|
+
ES2025: 2025,
|
|
56
|
+
ES2024: 2024,
|
|
57
|
+
ES2018: 2018
|
|
58
|
+
};
|
|
59
|
+
var Target = (
|
|
60
|
+
/** @type {const} */
|
|
61
|
+
{
|
|
62
|
+
auto: "auto",
|
|
63
|
+
ES2025: "ES2025",
|
|
64
|
+
ES2024: "ES2024",
|
|
65
|
+
ES2018: "ES2018"
|
|
66
|
+
}
|
|
67
|
+
);
|
|
68
|
+
function getOptions(options = {}) {
|
|
69
|
+
if ({}.toString.call(options) !== "[object Object]") {
|
|
70
|
+
throw new Error("Unexpected options");
|
|
71
|
+
}
|
|
72
|
+
if (options.target !== void 0 && !Target[options.target]) {
|
|
73
|
+
throw new Error(`Unexpected target "${options.target}"`);
|
|
74
|
+
}
|
|
75
|
+
const opts = {
|
|
76
|
+
// Sets the level of emulation rigor/strictness.
|
|
77
|
+
accuracy: "default",
|
|
78
|
+
// Disables advanced emulation that relies on returning a `RegExp` subclass, resulting in
|
|
79
|
+
// certain patterns not being emulatable.
|
|
80
|
+
avoidSubclass: false,
|
|
81
|
+
// Oniguruma flags; a string with `i`, `m`, `x`, `D`, `S`, `W`, `y{g}` in any order (all
|
|
82
|
+
// optional). Oniguruma's `m` is equivalent to JavaScript's `s` (`dotAll`).
|
|
83
|
+
flags: "",
|
|
84
|
+
// Include JavaScript flag `g` (`global`) in the result.
|
|
85
|
+
global: false,
|
|
86
|
+
// Include JavaScript flag `d` (`hasIndices`) in the result.
|
|
87
|
+
hasIndices: false,
|
|
88
|
+
// Delay regex construction until first use if the transpiled pattern is at least this length.
|
|
89
|
+
lazyCompileLength: Infinity,
|
|
90
|
+
// JavaScript version used for generated regexes. Using `auto` detects the best value based on
|
|
91
|
+
// your environment. Later targets allow faster processing, simpler generated source, and
|
|
92
|
+
// support for additional features.
|
|
93
|
+
target: "auto",
|
|
94
|
+
// Disables minifications that simplify the pattern without changing the meaning.
|
|
95
|
+
verbose: false,
|
|
96
|
+
...options,
|
|
97
|
+
// Advanced options that override standard behavior, error checking, and flags when enabled.
|
|
98
|
+
rules: {
|
|
99
|
+
// Useful with TextMate grammars that merge backreferences across patterns.
|
|
100
|
+
allowOrphanBackrefs: false,
|
|
101
|
+
// Use ASCII `\b` and `\B`, which increases search performance of generated regexes.
|
|
102
|
+
asciiWordBoundaries: false,
|
|
103
|
+
// Allow unnamed captures and numbered calls (backreferences and subroutines) when using
|
|
104
|
+
// named capture. This is Oniguruma option `ONIG_OPTION_CAPTURE_GROUP`; on by default in
|
|
105
|
+
// `vscode-oniguruma`.
|
|
106
|
+
captureGroup: false,
|
|
107
|
+
// Change the recursion depth limit from Oniguruma's `20` to an integer `2`–`20`.
|
|
108
|
+
recursionLimit: 20,
|
|
109
|
+
// `^` as `\A`; `$` as`\Z`. Improves search performance of generated regexes without changing
|
|
110
|
+
// the meaning if searching line by line. This is Oniguruma option `ONIG_OPTION_SINGLELINE`.
|
|
111
|
+
singleline: false,
|
|
112
|
+
...options.rules
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
if (opts.target === "auto") {
|
|
116
|
+
opts.target = envFlags.flagGroups ? "ES2025" : envFlags.unicodeSets ? "ES2024" : "ES2018";
|
|
117
|
+
}
|
|
118
|
+
return opts;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
// src/unicode.js
|
|
122
|
+
import { slug } from "oniguruma-parser/parser";
|
|
123
|
+
var asciiSpaceChar = "[ -\r ]";
|
|
124
|
+
var CharsWithoutIgnoreCaseExpansion = /* @__PURE__ */ new Set([
|
|
125
|
+
cp(304),
|
|
126
|
+
// İ
|
|
127
|
+
cp(305)
|
|
128
|
+
// ı
|
|
129
|
+
]);
|
|
130
|
+
var defaultWordChar = r`[\p{L}\p{M}\p{N}\p{Pc}]`;
|
|
131
|
+
function getIgnoreCaseMatchChars(char) {
|
|
132
|
+
if (CharsWithoutIgnoreCaseExpansion.has(char)) {
|
|
133
|
+
return [char];
|
|
134
|
+
}
|
|
135
|
+
const set = /* @__PURE__ */ new Set();
|
|
136
|
+
const lower = char.toLowerCase();
|
|
137
|
+
const upper = lower.toUpperCase();
|
|
138
|
+
const title = LowerToTitleCaseMap.get(lower);
|
|
139
|
+
const altLower = LowerToAlternativeLowerCaseMap.get(lower);
|
|
140
|
+
const altUpper = LowerToAlternativeUpperCaseMap.get(lower);
|
|
141
|
+
if ([...upper].length === 1) {
|
|
142
|
+
set.add(upper);
|
|
143
|
+
}
|
|
144
|
+
altUpper && set.add(altUpper);
|
|
145
|
+
title && set.add(title);
|
|
146
|
+
set.add(lower);
|
|
147
|
+
altLower && set.add(altLower);
|
|
148
|
+
return [...set];
|
|
149
|
+
}
|
|
150
|
+
var JsUnicodePropertyMap = /* @__PURE__ */ new Map(
|
|
151
|
+
`C Other
|
|
152
|
+
Cc Control cntrl
|
|
153
|
+
Cf Format
|
|
154
|
+
Cn Unassigned
|
|
155
|
+
Co Private_Use
|
|
156
|
+
Cs Surrogate
|
|
157
|
+
L Letter
|
|
158
|
+
LC Cased_Letter
|
|
159
|
+
Ll Lowercase_Letter
|
|
160
|
+
Lm Modifier_Letter
|
|
161
|
+
Lo Other_Letter
|
|
162
|
+
Lt Titlecase_Letter
|
|
163
|
+
Lu Uppercase_Letter
|
|
164
|
+
M Mark Combining_Mark
|
|
165
|
+
Mc Spacing_Mark
|
|
166
|
+
Me Enclosing_Mark
|
|
167
|
+
Mn Nonspacing_Mark
|
|
168
|
+
N Number
|
|
169
|
+
Nd Decimal_Number digit
|
|
170
|
+
Nl Letter_Number
|
|
171
|
+
No Other_Number
|
|
172
|
+
P Punctuation punct
|
|
173
|
+
Pc Connector_Punctuation
|
|
174
|
+
Pd Dash_Punctuation
|
|
175
|
+
Pe Close_Punctuation
|
|
176
|
+
Pf Final_Punctuation
|
|
177
|
+
Pi Initial_Punctuation
|
|
178
|
+
Po Other_Punctuation
|
|
179
|
+
Ps Open_Punctuation
|
|
180
|
+
S Symbol
|
|
181
|
+
Sc Currency_Symbol
|
|
182
|
+
Sk Modifier_Symbol
|
|
183
|
+
Sm Math_Symbol
|
|
184
|
+
So Other_Symbol
|
|
185
|
+
Z Separator
|
|
186
|
+
Zl Line_Separator
|
|
187
|
+
Zp Paragraph_Separator
|
|
188
|
+
Zs Space_Separator
|
|
189
|
+
ASCII
|
|
190
|
+
ASCII_Hex_Digit AHex
|
|
191
|
+
Alphabetic Alpha
|
|
192
|
+
Any
|
|
193
|
+
Assigned
|
|
194
|
+
Bidi_Control Bidi_C
|
|
195
|
+
Bidi_Mirrored Bidi_M
|
|
196
|
+
Case_Ignorable CI
|
|
197
|
+
Cased
|
|
198
|
+
Changes_When_Casefolded CWCF
|
|
199
|
+
Changes_When_Casemapped CWCM
|
|
200
|
+
Changes_When_Lowercased CWL
|
|
201
|
+
Changes_When_NFKC_Casefolded CWKCF
|
|
202
|
+
Changes_When_Titlecased CWT
|
|
203
|
+
Changes_When_Uppercased CWU
|
|
204
|
+
Dash
|
|
205
|
+
Default_Ignorable_Code_Point DI
|
|
206
|
+
Deprecated Dep
|
|
207
|
+
Diacritic Dia
|
|
208
|
+
Emoji
|
|
209
|
+
Emoji_Component EComp
|
|
210
|
+
Emoji_Modifier EMod
|
|
211
|
+
Emoji_Modifier_Base EBase
|
|
212
|
+
Emoji_Presentation EPres
|
|
213
|
+
Extended_Pictographic ExtPict
|
|
214
|
+
Extender Ext
|
|
215
|
+
Grapheme_Base Gr_Base
|
|
216
|
+
Grapheme_Extend Gr_Ext
|
|
217
|
+
Hex_Digit Hex
|
|
218
|
+
IDS_Binary_Operator IDSB
|
|
219
|
+
IDS_Trinary_Operator IDST
|
|
220
|
+
ID_Continue IDC
|
|
221
|
+
ID_Start IDS
|
|
222
|
+
Ideographic Ideo
|
|
223
|
+
Join_Control Join_C
|
|
224
|
+
Logical_Order_Exception LOE
|
|
225
|
+
Lowercase Lower
|
|
226
|
+
Math
|
|
227
|
+
Noncharacter_Code_Point NChar
|
|
228
|
+
Pattern_Syntax Pat_Syn
|
|
229
|
+
Pattern_White_Space Pat_WS
|
|
230
|
+
Quotation_Mark QMark
|
|
231
|
+
Radical
|
|
232
|
+
Regional_Indicator RI
|
|
233
|
+
Sentence_Terminal STerm
|
|
234
|
+
Soft_Dotted SD
|
|
235
|
+
Terminal_Punctuation Term
|
|
236
|
+
Unified_Ideograph UIdeo
|
|
237
|
+
Uppercase Upper
|
|
238
|
+
Variation_Selector VS
|
|
239
|
+
White_Space space
|
|
240
|
+
XID_Continue XIDC
|
|
241
|
+
XID_Start XIDS`.split(/\s/).map((p) => [slug(p), p])
|
|
242
|
+
);
|
|
243
|
+
var LowerToAlternativeLowerCaseMap = /* @__PURE__ */ new Map([
|
|
244
|
+
["s", cp(383)],
|
|
245
|
+
// s, ſ
|
|
246
|
+
[cp(383), "s"]
|
|
247
|
+
// ſ, s
|
|
248
|
+
]);
|
|
249
|
+
var LowerToAlternativeUpperCaseMap = /* @__PURE__ */ new Map([
|
|
250
|
+
[cp(223), cp(7838)],
|
|
251
|
+
// ß, ẞ
|
|
252
|
+
[cp(107), cp(8490)],
|
|
253
|
+
// k, K (Kelvin)
|
|
254
|
+
[cp(229), cp(8491)],
|
|
255
|
+
// å, Å (Angstrom)
|
|
256
|
+
[cp(969), cp(8486)]
|
|
257
|
+
// ω, Ω (Ohm)
|
|
258
|
+
]);
|
|
259
|
+
var LowerToTitleCaseMap = new Map([
|
|
260
|
+
titleEntry(453),
|
|
261
|
+
titleEntry(456),
|
|
262
|
+
titleEntry(459),
|
|
263
|
+
titleEntry(498),
|
|
264
|
+
...titleRange(8072, 8079),
|
|
265
|
+
...titleRange(8088, 8095),
|
|
266
|
+
...titleRange(8104, 8111),
|
|
267
|
+
titleEntry(8124),
|
|
268
|
+
titleEntry(8140),
|
|
269
|
+
titleEntry(8188)
|
|
270
|
+
]);
|
|
271
|
+
var PosixClassMap = /* @__PURE__ */ new Map([
|
|
272
|
+
["alnum", r`[\p{Alpha}\p{Nd}]`],
|
|
273
|
+
["alpha", r`\p{Alpha}`],
|
|
274
|
+
["ascii", r`\p{ASCII}`],
|
|
275
|
+
["blank", r`[\p{Zs}\t]`],
|
|
276
|
+
["cntrl", r`\p{Cc}`],
|
|
277
|
+
["digit", r`\p{Nd}`],
|
|
278
|
+
["graph", r`[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]`],
|
|
279
|
+
["lower", r`\p{Lower}`],
|
|
280
|
+
["print", r`[[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]\p{Zs}]`],
|
|
281
|
+
["punct", r`[\p{P}\p{S}]`],
|
|
282
|
+
// Updated value from Onig 6.9.9; changed from Unicode `\p{punct}`
|
|
283
|
+
["space", r`\p{space}`],
|
|
284
|
+
["upper", r`\p{Upper}`],
|
|
285
|
+
["word", r`[\p{Alpha}\p{M}\p{Nd}\p{Pc}]`],
|
|
286
|
+
["xdigit", r`\p{AHex}`]
|
|
287
|
+
]);
|
|
288
|
+
function range(start, end) {
|
|
289
|
+
const range2 = [];
|
|
290
|
+
for (let i = start; i <= end; i++) {
|
|
291
|
+
range2.push(i);
|
|
292
|
+
}
|
|
293
|
+
return range2;
|
|
294
|
+
}
|
|
295
|
+
function titleEntry(codePoint) {
|
|
296
|
+
const char = cp(codePoint);
|
|
297
|
+
return [char.toLowerCase(), char];
|
|
298
|
+
}
|
|
299
|
+
function titleRange(start, end) {
|
|
300
|
+
return range(start, end).map((codePoint) => titleEntry(codePoint));
|
|
301
|
+
}
|
|
302
|
+
var UnicodePropertiesWithSpecificCase = /* @__PURE__ */ new Set([
|
|
303
|
+
"Lower",
|
|
304
|
+
"Lowercase",
|
|
305
|
+
"Upper",
|
|
306
|
+
"Uppercase",
|
|
307
|
+
"Ll",
|
|
308
|
+
"Lowercase_Letter",
|
|
309
|
+
"Lt",
|
|
310
|
+
"Titlecase_Letter",
|
|
311
|
+
"Lu",
|
|
312
|
+
"Uppercase_Letter"
|
|
313
|
+
// The `Changes_When_*` properties (and their aliases) could be included, but they're very rare.
|
|
314
|
+
// Some other properties include a handful of chars with specific cases only, but these chars are
|
|
315
|
+
// generally extreme edge cases and using such properties case insensitively generally produces
|
|
316
|
+
// undesired behavior anyway
|
|
317
|
+
]);
|
|
318
|
+
|
|
319
|
+
// src/transform.js
|
|
320
|
+
import { createAlternative, createAssertion, createBackreference, createCapturingGroup, createCharacter, createCharacterClass, createCharacterSet, createGroup, createLookaroundAssertion, createQuantifier, createSubroutine, createUnicodeProperty, hasOnlyChild, parse, slug as slug2 } from "oniguruma-parser/parser";
|
|
321
|
+
import { traverse } from "oniguruma-parser/traverser";
|
|
322
|
+
function transform(ast, options) {
|
|
323
|
+
const opts = {
|
|
324
|
+
// A couple edge cases exist where options `accuracy` and `bestEffortTarget` are used:
|
|
325
|
+
// - `CharacterSet` kind `text_segment` (`\X`): An exact representation would require heavy
|
|
326
|
+
// Unicode data; a best-effort approximation requires knowing the target.
|
|
327
|
+
// - `CharacterSet` kind `posix` with values `graph` and `print`: Their complex Unicode
|
|
328
|
+
// representations would be hard to change to ASCII versions after the fact in the generator
|
|
329
|
+
// based on `target`/`accuracy`, so produce the appropriate structure here.
|
|
330
|
+
accuracy: "default",
|
|
331
|
+
asciiWordBoundaries: false,
|
|
332
|
+
avoidSubclass: false,
|
|
333
|
+
bestEffortTarget: "ES2025",
|
|
334
|
+
...options
|
|
335
|
+
};
|
|
336
|
+
addParentProperties(ast);
|
|
337
|
+
const firstPassState = {
|
|
338
|
+
accuracy: opts.accuracy,
|
|
339
|
+
asciiWordBoundaries: opts.asciiWordBoundaries,
|
|
340
|
+
avoidSubclass: opts.avoidSubclass,
|
|
341
|
+
flagDirectivesByAlt: /* @__PURE__ */ new Map(),
|
|
342
|
+
jsGroupNameMap: /* @__PURE__ */ new Map(),
|
|
343
|
+
minTargetEs2024: isMinTarget(opts.bestEffortTarget, "ES2024"),
|
|
344
|
+
passedLookbehind: false,
|
|
345
|
+
strategy: null,
|
|
346
|
+
// Subroutines can appear before the groups they ref, so collect reffed nodes for a second pass
|
|
347
|
+
subroutineRefMap: /* @__PURE__ */ new Map(),
|
|
348
|
+
supportedGNodes: /* @__PURE__ */ new Set(),
|
|
349
|
+
digitIsAscii: ast.flags.digitIsAscii,
|
|
350
|
+
spaceIsAscii: ast.flags.spaceIsAscii,
|
|
351
|
+
wordIsAscii: ast.flags.wordIsAscii
|
|
352
|
+
};
|
|
353
|
+
traverse(ast, FirstPassVisitor, firstPassState);
|
|
354
|
+
const globalFlags = {
|
|
355
|
+
dotAll: ast.flags.dotAll,
|
|
356
|
+
ignoreCase: ast.flags.ignoreCase
|
|
357
|
+
};
|
|
358
|
+
const secondPassState = {
|
|
359
|
+
currentFlags: globalFlags,
|
|
360
|
+
prevFlags: null,
|
|
361
|
+
globalFlags,
|
|
362
|
+
groupOriginByCopy: /* @__PURE__ */ new Map(),
|
|
363
|
+
groupsByName: /* @__PURE__ */ new Map(),
|
|
364
|
+
multiplexCapturesToLeftByRef: /* @__PURE__ */ new Map(),
|
|
365
|
+
openRefs: /* @__PURE__ */ new Map(),
|
|
366
|
+
reffedNodesByReferencer: /* @__PURE__ */ new Map(),
|
|
367
|
+
subroutineRefMap: firstPassState.subroutineRefMap
|
|
368
|
+
};
|
|
369
|
+
traverse(ast, SecondPassVisitor, secondPassState);
|
|
370
|
+
const thirdPassState = {
|
|
371
|
+
groupsByName: secondPassState.groupsByName,
|
|
372
|
+
highestOrphanBackref: 0,
|
|
373
|
+
numCapturesToLeft: 0,
|
|
374
|
+
reffedNodesByReferencer: secondPassState.reffedNodesByReferencer
|
|
375
|
+
};
|
|
376
|
+
traverse(ast, ThirdPassVisitor, thirdPassState);
|
|
377
|
+
ast._originMap = secondPassState.groupOriginByCopy;
|
|
378
|
+
ast._strategy = firstPassState.strategy;
|
|
379
|
+
return ast;
|
|
380
|
+
}
|
|
381
|
+
var FirstPassVisitor = {
|
|
382
|
+
AbsenceFunction({ node, parent, replaceWith }) {
|
|
383
|
+
const { body, kind } = node;
|
|
384
|
+
if (kind === "repeater") {
|
|
385
|
+
const innerGroup = createGroup();
|
|
386
|
+
innerGroup.body[0].body.push(
|
|
387
|
+
// Insert own alts as `body`
|
|
388
|
+
createLookaroundAssertion({ negate: true, body }),
|
|
389
|
+
createUnicodeProperty("Any")
|
|
390
|
+
);
|
|
391
|
+
const outerGroup = createGroup();
|
|
392
|
+
outerGroup.body[0].body.push(
|
|
393
|
+
createQuantifier("greedy", 0, Infinity, innerGroup)
|
|
394
|
+
);
|
|
395
|
+
replaceWith(setParentDeep(outerGroup, parent), { traverse: true });
|
|
396
|
+
} else {
|
|
397
|
+
throw new Error(`Unsupported absence function "(?~|"`);
|
|
398
|
+
}
|
|
399
|
+
},
|
|
400
|
+
Alternative: {
|
|
401
|
+
enter({ node, parent, key }, { flagDirectivesByAlt }) {
|
|
402
|
+
const flagDirectives = node.body.filter((el) => el.kind === "flags");
|
|
403
|
+
for (let i = key + 1; i < parent.body.length; i++) {
|
|
404
|
+
const forwardSiblingAlt = parent.body[i];
|
|
405
|
+
getOrInsert(flagDirectivesByAlt, forwardSiblingAlt, []).push(...flagDirectives);
|
|
406
|
+
}
|
|
407
|
+
},
|
|
408
|
+
exit({ node }, { flagDirectivesByAlt }) {
|
|
409
|
+
if (flagDirectivesByAlt.get(node)?.length) {
|
|
410
|
+
const flags = getCombinedFlagModsFromFlagNodes(flagDirectivesByAlt.get(node));
|
|
411
|
+
if (flags) {
|
|
412
|
+
const flagGroup = createGroup({ flags });
|
|
413
|
+
flagGroup.body[0].body = node.body;
|
|
414
|
+
node.body = [setParentDeep(flagGroup, node)];
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
},
|
|
419
|
+
Assertion({ node, parent, key, container, root, remove, replaceWith }, state) {
|
|
420
|
+
const { kind, negate } = node;
|
|
421
|
+
const { asciiWordBoundaries, avoidSubclass, supportedGNodes, wordIsAscii } = state;
|
|
422
|
+
if (kind === "text_segment_boundary") {
|
|
423
|
+
throw new Error(`Unsupported text segment boundary "\\${negate ? "Y" : "y"}"`);
|
|
424
|
+
} else if (kind === "line_end") {
|
|
425
|
+
replaceWith(setParentDeep(createLookaroundAssertion({ body: [
|
|
426
|
+
createAlternative({ body: [createAssertion("string_end")] }),
|
|
427
|
+
createAlternative({ body: [createCharacter(10)] })
|
|
428
|
+
// `\n`
|
|
429
|
+
] }), parent));
|
|
430
|
+
} else if (kind === "line_start") {
|
|
431
|
+
replaceWith(setParentDeep(parseFragment(r`(?<=\A|\n(?!\z))`, { skipLookbehindValidation: true }), parent));
|
|
432
|
+
} else if (kind === "search_start") {
|
|
433
|
+
if (supportedGNodes.has(node)) {
|
|
434
|
+
root.flags.sticky = true;
|
|
435
|
+
remove();
|
|
436
|
+
} else {
|
|
437
|
+
const prev = container[key - 1];
|
|
438
|
+
if (prev && isAlwaysNonZeroLength(prev)) {
|
|
439
|
+
replaceWith(setParentDeep(createLookaroundAssertion({ negate: true }), parent));
|
|
440
|
+
} else if (avoidSubclass) {
|
|
441
|
+
throw new Error(r`Uses "\G" in a way that requires a subclass`);
|
|
442
|
+
} else {
|
|
443
|
+
replaceWith(setParent(createAssertion("string_start"), parent));
|
|
444
|
+
state.strategy = "clip_search";
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
} else if (kind === "string_end" || kind === "string_start") {
|
|
448
|
+
} else if (kind === "string_end_newline") {
|
|
449
|
+
replaceWith(setParentDeep(parseFragment(r`(?=\n?\z)`), parent));
|
|
450
|
+
} else if (kind === "word_boundary") {
|
|
451
|
+
if (!wordIsAscii && !asciiWordBoundaries) {
|
|
452
|
+
const b = `(?:(?<=${defaultWordChar})(?!${defaultWordChar})|(?<!${defaultWordChar})(?=${defaultWordChar}))`;
|
|
453
|
+
const B = `(?:(?<=${defaultWordChar})(?=${defaultWordChar})|(?<!${defaultWordChar})(?!${defaultWordChar}))`;
|
|
454
|
+
replaceWith(setParentDeep(parseFragment(negate ? B : b), parent));
|
|
455
|
+
}
|
|
456
|
+
} else {
|
|
457
|
+
throw new Error(`Unexpected assertion kind "${kind}"`);
|
|
458
|
+
}
|
|
459
|
+
},
|
|
460
|
+
Backreference({ node }, { jsGroupNameMap }) {
|
|
461
|
+
let { ref } = node;
|
|
462
|
+
if (typeof ref === "string" && !isValidJsGroupName(ref)) {
|
|
463
|
+
ref = getAndStoreJsGroupName(ref, jsGroupNameMap);
|
|
464
|
+
node.ref = ref;
|
|
465
|
+
}
|
|
466
|
+
},
|
|
467
|
+
CapturingGroup({ node }, { jsGroupNameMap, subroutineRefMap }) {
|
|
468
|
+
let { name } = node;
|
|
469
|
+
if (name && !isValidJsGroupName(name)) {
|
|
470
|
+
name = getAndStoreJsGroupName(name, jsGroupNameMap);
|
|
471
|
+
node.name = name;
|
|
472
|
+
}
|
|
473
|
+
subroutineRefMap.set(node.number, node);
|
|
474
|
+
if (name) {
|
|
475
|
+
subroutineRefMap.set(name, node);
|
|
476
|
+
}
|
|
477
|
+
},
|
|
478
|
+
CharacterClassRange({ node, parent, replaceWith }) {
|
|
479
|
+
if (parent.kind === "intersection") {
|
|
480
|
+
const cc = createCharacterClass({ body: [node] });
|
|
481
|
+
replaceWith(setParentDeep(cc, parent), { traverse: true });
|
|
482
|
+
}
|
|
483
|
+
},
|
|
484
|
+
CharacterSet({ node, parent, replaceWith }, { accuracy, minTargetEs2024, digitIsAscii, spaceIsAscii, wordIsAscii }) {
|
|
485
|
+
const { kind, negate, value } = node;
|
|
486
|
+
if (digitIsAscii && (kind === "digit" || value === "digit")) {
|
|
487
|
+
replaceWith(setParent(createCharacterSet("digit", { negate }), parent));
|
|
488
|
+
return;
|
|
489
|
+
}
|
|
490
|
+
if (spaceIsAscii && (kind === "space" || value === "space")) {
|
|
491
|
+
replaceWith(setParentDeep(setNegate(parseFragment(asciiSpaceChar), negate), parent));
|
|
492
|
+
return;
|
|
493
|
+
}
|
|
494
|
+
if (wordIsAscii && (kind === "word" || value === "word")) {
|
|
495
|
+
replaceWith(setParent(createCharacterSet("word", { negate }), parent));
|
|
496
|
+
return;
|
|
497
|
+
}
|
|
498
|
+
if (kind === "any") {
|
|
499
|
+
replaceWith(setParent(createUnicodeProperty("Any"), parent));
|
|
500
|
+
} else if (kind === "digit") {
|
|
501
|
+
replaceWith(setParent(createUnicodeProperty("Nd", { negate }), parent));
|
|
502
|
+
} else if (kind === "dot") {
|
|
503
|
+
} else if (kind === "text_segment") {
|
|
504
|
+
if (accuracy === "strict") {
|
|
505
|
+
throw new Error(r`Use of "\X" requires non-strict accuracy`);
|
|
506
|
+
}
|
|
507
|
+
const eBase = "\\p{Emoji}(?:\\p{EMod}|\\uFE0F\\u20E3?|[\\x{E0020}-\\x{E007E}]+\\x{E007F})?";
|
|
508
|
+
const emoji = r`\p{RI}{2}|${eBase}(?:\u200D${eBase})*`;
|
|
509
|
+
replaceWith(setParentDeep(parseFragment(
|
|
510
|
+
// Close approximation of an extended grapheme cluster; see <unicode.org/reports/tr29/>
|
|
511
|
+
r`(?>\r\n|${minTargetEs2024 ? r`\p{RGI_Emoji}` : emoji}|\P{M}\p{M}*)`,
|
|
512
|
+
// Allow JS property `RGI_Emoji` through
|
|
513
|
+
{ skipPropertyNameValidation: true }
|
|
514
|
+
), parent));
|
|
515
|
+
} else if (kind === "hex") {
|
|
516
|
+
replaceWith(setParent(createUnicodeProperty("AHex", { negate }), parent));
|
|
517
|
+
} else if (kind === "newline") {
|
|
518
|
+
replaceWith(setParentDeep(parseFragment(negate ? "[^\n]" : "(?>\r\n?|[\n\v\f\x85\u2028\u2029])"), parent));
|
|
519
|
+
} else if (kind === "posix") {
|
|
520
|
+
if (!minTargetEs2024 && (value === "graph" || value === "print")) {
|
|
521
|
+
if (accuracy === "strict") {
|
|
522
|
+
throw new Error(`POSIX class "${value}" requires min target ES2024 or non-strict accuracy`);
|
|
523
|
+
}
|
|
524
|
+
let ascii = {
|
|
525
|
+
graph: "!-~",
|
|
526
|
+
print: " -~"
|
|
527
|
+
}[value];
|
|
528
|
+
if (negate) {
|
|
529
|
+
ascii = `\0-${cp(ascii.codePointAt(0) - 1)}${cp(ascii.codePointAt(2) + 1)}-\u{10FFFF}`;
|
|
530
|
+
}
|
|
531
|
+
replaceWith(setParentDeep(parseFragment(`[${ascii}]`), parent));
|
|
532
|
+
} else {
|
|
533
|
+
replaceWith(setParentDeep(setNegate(parseFragment(PosixClassMap.get(value)), negate), parent));
|
|
534
|
+
}
|
|
535
|
+
} else if (kind === "property") {
|
|
536
|
+
if (!JsUnicodePropertyMap.has(slug2(value))) {
|
|
537
|
+
node.key = "sc";
|
|
538
|
+
}
|
|
539
|
+
} else if (kind === "space") {
|
|
540
|
+
replaceWith(setParent(createUnicodeProperty("space", { negate }), parent));
|
|
541
|
+
} else if (kind === "word") {
|
|
542
|
+
replaceWith(setParentDeep(setNegate(parseFragment(defaultWordChar), negate), parent));
|
|
543
|
+
} else {
|
|
544
|
+
throw new Error(`Unexpected character set kind "${kind}"`);
|
|
545
|
+
}
|
|
546
|
+
},
|
|
547
|
+
Directive({ node, parent, root, remove, replaceWith, removeAllPrevSiblings, removeAllNextSiblings }) {
|
|
548
|
+
const { kind, flags } = node;
|
|
549
|
+
if (kind === "flags") {
|
|
550
|
+
if (!flags.enable && !flags.disable) {
|
|
551
|
+
remove();
|
|
552
|
+
} else {
|
|
553
|
+
const flagGroup = createGroup({ flags });
|
|
554
|
+
flagGroup.body[0].body = removeAllNextSiblings();
|
|
555
|
+
replaceWith(setParentDeep(flagGroup, parent), { traverse: true });
|
|
556
|
+
}
|
|
557
|
+
} else if (kind === "keep") {
|
|
558
|
+
const firstAlt = root.body[0];
|
|
559
|
+
const hasWrapperGroup = root.body.length === 1 && // Not emulatable if within a `CapturingGroup`
|
|
560
|
+
hasOnlyChild(firstAlt, { type: "Group" }) && firstAlt.body[0].body.length === 1;
|
|
561
|
+
const topLevel = hasWrapperGroup ? firstAlt.body[0] : root;
|
|
562
|
+
if (parent.parent !== topLevel || topLevel.body.length > 1) {
|
|
563
|
+
throw new Error(r`Uses "\K" in a way that's unsupported`);
|
|
564
|
+
}
|
|
565
|
+
const lookbehind = createLookaroundAssertion({ behind: true });
|
|
566
|
+
lookbehind.body[0].body = removeAllPrevSiblings();
|
|
567
|
+
replaceWith(setParentDeep(lookbehind, parent));
|
|
568
|
+
} else {
|
|
569
|
+
throw new Error(`Unexpected directive kind "${kind}"`);
|
|
570
|
+
}
|
|
571
|
+
},
|
|
572
|
+
Flags({ node, parent }) {
|
|
573
|
+
if (node.posixIsAscii) {
|
|
574
|
+
throw new Error('Unsupported flag "P"');
|
|
575
|
+
}
|
|
576
|
+
if (node.textSegmentMode === "word") {
|
|
577
|
+
throw new Error('Unsupported flag "y{w}"');
|
|
578
|
+
}
|
|
579
|
+
[
|
|
580
|
+
"digitIsAscii",
|
|
581
|
+
// Flag D
|
|
582
|
+
"extended",
|
|
583
|
+
// Flag x
|
|
584
|
+
"posixIsAscii",
|
|
585
|
+
// Flag P
|
|
586
|
+
"spaceIsAscii",
|
|
587
|
+
// Flag S
|
|
588
|
+
"wordIsAscii",
|
|
589
|
+
// Flag W
|
|
590
|
+
"textSegmentMode"
|
|
591
|
+
// Flag y{g} or y{w}
|
|
592
|
+
].forEach((f) => delete node[f]);
|
|
593
|
+
Object.assign(node, {
|
|
594
|
+
// JS flag g; no Onig equiv
|
|
595
|
+
global: false,
|
|
596
|
+
// JS flag d; no Onig equiv
|
|
597
|
+
hasIndices: false,
|
|
598
|
+
// JS flag m; no Onig equiv but its behavior is always on in Onig. Onig's only line break
|
|
599
|
+
// char is line feed, unlike JS, so this flag isn't used since it would produce inaccurate
|
|
600
|
+
// results (also allows `^` and `$` to be used in the generator for string start and end)
|
|
601
|
+
multiline: false,
|
|
602
|
+
// JS flag y; no Onig equiv, but used for `\G` emulation
|
|
603
|
+
sticky: node.sticky ?? false
|
|
604
|
+
// Note: Regex+ doesn't allow explicitly adding flags it handles implicitly, so leave out
|
|
605
|
+
// properties `unicode` (JS flag u) and `unicodeSets` (JS flag v). Keep the existing values
|
|
606
|
+
// for `ignoreCase` (flag i) and `dotAll` (JS flag s, but Onig flag m)
|
|
607
|
+
});
|
|
608
|
+
parent.options = {
|
|
609
|
+
disable: {
|
|
610
|
+
// Onig uses different rules for flag x than Regex+, so disable the implicit flag
|
|
611
|
+
x: true,
|
|
612
|
+
// Onig has no flag to control "named capture only" mode but contextually applies its
|
|
613
|
+
// behavior when named capturing is used, so disable Regex+'s implicit flag for it
|
|
614
|
+
n: true
|
|
615
|
+
},
|
|
616
|
+
force: {
|
|
617
|
+
// Always add flag v because we're generating an AST that relies on it (it enables JS
|
|
618
|
+
// support for Onig features nested classes, intersection, Unicode properties, etc.).
|
|
619
|
+
// However, the generator might disable flag v based on its `target` option
|
|
620
|
+
v: true
|
|
621
|
+
}
|
|
622
|
+
};
|
|
623
|
+
},
|
|
624
|
+
Group({ node }) {
|
|
625
|
+
if (!node.flags) {
|
|
626
|
+
return;
|
|
627
|
+
}
|
|
628
|
+
const { enable, disable } = node.flags;
|
|
629
|
+
enable?.extended && delete enable.extended;
|
|
630
|
+
disable?.extended && delete disable.extended;
|
|
631
|
+
enable?.dotAll && disable?.dotAll && delete enable.dotAll;
|
|
632
|
+
enable?.ignoreCase && disable?.ignoreCase && delete enable.ignoreCase;
|
|
633
|
+
enable && !Object.keys(enable).length && delete node.flags.enable;
|
|
634
|
+
disable && !Object.keys(disable).length && delete node.flags.disable;
|
|
635
|
+
!node.flags.enable && !node.flags.disable && delete node.flags;
|
|
636
|
+
},
|
|
637
|
+
LookaroundAssertion({ node }, state) {
|
|
638
|
+
const { kind } = node;
|
|
639
|
+
if (kind === "lookbehind") {
|
|
640
|
+
state.passedLookbehind = true;
|
|
641
|
+
}
|
|
642
|
+
},
|
|
643
|
+
NamedCallout({ node, parent, replaceWith }) {
|
|
644
|
+
const { kind } = node;
|
|
645
|
+
if (kind === "fail") {
|
|
646
|
+
replaceWith(setParentDeep(createLookaroundAssertion({ negate: true }), parent));
|
|
647
|
+
} else {
|
|
648
|
+
throw new Error(`Unsupported named callout "(*${kind.toUpperCase()}"`);
|
|
649
|
+
}
|
|
650
|
+
},
|
|
651
|
+
Quantifier({ node }) {
|
|
652
|
+
if (node.body.type === "Quantifier") {
|
|
653
|
+
const group = createGroup();
|
|
654
|
+
group.body[0].body.push(node.body);
|
|
655
|
+
node.body = setParentDeep(group, node);
|
|
656
|
+
}
|
|
657
|
+
},
|
|
658
|
+
Regex: {
|
|
659
|
+
enter({ node }, { supportedGNodes }) {
|
|
660
|
+
const leadingGs = [];
|
|
661
|
+
let hasAltWithLeadG = false;
|
|
662
|
+
let hasAltWithoutLeadG = false;
|
|
663
|
+
for (const alt of node.body) {
|
|
664
|
+
if (alt.body.length === 1 && alt.body[0].kind === "search_start") {
|
|
665
|
+
alt.body.pop();
|
|
666
|
+
} else {
|
|
667
|
+
const leadingG = getLeadingG(alt.body);
|
|
668
|
+
if (leadingG) {
|
|
669
|
+
hasAltWithLeadG = true;
|
|
670
|
+
Array.isArray(leadingG) ? leadingGs.push(...leadingG) : leadingGs.push(leadingG);
|
|
671
|
+
} else {
|
|
672
|
+
hasAltWithoutLeadG = true;
|
|
673
|
+
}
|
|
674
|
+
}
|
|
675
|
+
}
|
|
676
|
+
if (hasAltWithLeadG && !hasAltWithoutLeadG) {
|
|
677
|
+
leadingGs.forEach((g) => supportedGNodes.add(g));
|
|
678
|
+
}
|
|
679
|
+
},
|
|
680
|
+
exit(_, { accuracy, passedLookbehind, strategy }) {
|
|
681
|
+
if (accuracy === "strict" && passedLookbehind && strategy) {
|
|
682
|
+
throw new Error(r`Uses "\G" in a way that requires non-strict accuracy`);
|
|
683
|
+
}
|
|
684
|
+
}
|
|
685
|
+
},
|
|
686
|
+
Subroutine({ node }, { jsGroupNameMap }) {
|
|
687
|
+
let { ref } = node;
|
|
688
|
+
if (typeof ref === "string" && !isValidJsGroupName(ref)) {
|
|
689
|
+
ref = getAndStoreJsGroupName(ref, jsGroupNameMap);
|
|
690
|
+
node.ref = ref;
|
|
691
|
+
}
|
|
692
|
+
}
|
|
693
|
+
};
|
|
694
|
+
var SecondPassVisitor = {
|
|
695
|
+
Backreference({ node }, { multiplexCapturesToLeftByRef, reffedNodesByReferencer }) {
|
|
696
|
+
const { orphan, ref } = node;
|
|
697
|
+
if (!orphan) {
|
|
698
|
+
reffedNodesByReferencer.set(node, [...multiplexCapturesToLeftByRef.get(ref).map(({ node: node2 }) => node2)]);
|
|
699
|
+
}
|
|
700
|
+
},
|
|
701
|
+
CapturingGroup: {
|
|
702
|
+
enter({
|
|
703
|
+
node,
|
|
704
|
+
parent,
|
|
705
|
+
replaceWith,
|
|
706
|
+
skip
|
|
707
|
+
}, {
|
|
708
|
+
groupOriginByCopy,
|
|
709
|
+
groupsByName,
|
|
710
|
+
multiplexCapturesToLeftByRef,
|
|
711
|
+
openRefs,
|
|
712
|
+
reffedNodesByReferencer
|
|
713
|
+
}) {
|
|
714
|
+
const origin = groupOriginByCopy.get(node);
|
|
715
|
+
if (origin && openRefs.has(node.number)) {
|
|
716
|
+
const recursion2 = setParent(createRecursion(node.number), parent);
|
|
717
|
+
reffedNodesByReferencer.set(recursion2, openRefs.get(node.number));
|
|
718
|
+
replaceWith(recursion2);
|
|
719
|
+
return;
|
|
720
|
+
}
|
|
721
|
+
openRefs.set(node.number, node);
|
|
722
|
+
multiplexCapturesToLeftByRef.set(node.number, []);
|
|
723
|
+
if (node.name) {
|
|
724
|
+
getOrInsert(multiplexCapturesToLeftByRef, node.name, []);
|
|
725
|
+
}
|
|
726
|
+
const multiplexNodes = multiplexCapturesToLeftByRef.get(node.name ?? node.number);
|
|
727
|
+
for (let i = 0; i < multiplexNodes.length; i++) {
|
|
728
|
+
const multiplex = multiplexNodes[i];
|
|
729
|
+
if (
|
|
730
|
+
// This group is from subroutine expansion, and there's a multiplex value from either the
|
|
731
|
+
// origin node or a prior subroutine expansion group with the same origin
|
|
732
|
+
origin === multiplex.node || origin && origin === multiplex.origin || // This group is not from subroutine expansion, and it comes after a subroutine expansion
|
|
733
|
+
// group that refers to this group
|
|
734
|
+
node === multiplex.origin
|
|
735
|
+
) {
|
|
736
|
+
multiplexNodes.splice(i, 1);
|
|
737
|
+
break;
|
|
738
|
+
}
|
|
739
|
+
}
|
|
740
|
+
multiplexCapturesToLeftByRef.get(node.number).push({ node, origin });
|
|
741
|
+
if (node.name) {
|
|
742
|
+
multiplexCapturesToLeftByRef.get(node.name).push({ node, origin });
|
|
743
|
+
}
|
|
744
|
+
if (node.name) {
|
|
745
|
+
const groupsWithSameName = getOrInsert(groupsByName, node.name, /* @__PURE__ */ new Map());
|
|
746
|
+
let hasDuplicateNameToRemove = false;
|
|
747
|
+
if (origin) {
|
|
748
|
+
hasDuplicateNameToRemove = true;
|
|
749
|
+
} else {
|
|
750
|
+
for (const groupInfo of groupsWithSameName.values()) {
|
|
751
|
+
if (!groupInfo.hasDuplicateNameToRemove) {
|
|
752
|
+
hasDuplicateNameToRemove = true;
|
|
753
|
+
break;
|
|
754
|
+
}
|
|
755
|
+
}
|
|
756
|
+
}
|
|
757
|
+
groupsByName.get(node.name).set(node, { node, hasDuplicateNameToRemove });
|
|
758
|
+
}
|
|
759
|
+
},
|
|
760
|
+
exit({ node }, { openRefs }) {
|
|
761
|
+
if (openRefs.get(node.number) === node) {
|
|
762
|
+
openRefs.delete(node.number);
|
|
763
|
+
}
|
|
764
|
+
}
|
|
765
|
+
},
|
|
766
|
+
Group: {
|
|
767
|
+
enter({ node }, state) {
|
|
768
|
+
state.prevFlags = state.currentFlags;
|
|
769
|
+
if (node.flags) {
|
|
770
|
+
state.currentFlags = getNewCurrentFlags(state.currentFlags, node.flags);
|
|
771
|
+
}
|
|
772
|
+
},
|
|
773
|
+
exit(_, state) {
|
|
774
|
+
state.currentFlags = state.prevFlags;
|
|
775
|
+
}
|
|
776
|
+
},
|
|
777
|
+
Subroutine({ node, parent, replaceWith }, state) {
|
|
778
|
+
const { isRecursive, ref } = node;
|
|
779
|
+
if (isRecursive) {
|
|
780
|
+
let reffed = parent;
|
|
781
|
+
while (reffed = reffed.parent) {
|
|
782
|
+
if (reffed.type === "CapturingGroup" && (reffed.name === ref || reffed.number === ref)) {
|
|
783
|
+
break;
|
|
784
|
+
}
|
|
785
|
+
}
|
|
786
|
+
state.reffedNodesByReferencer.set(node, reffed);
|
|
787
|
+
return;
|
|
788
|
+
}
|
|
789
|
+
const reffedGroupNode = state.subroutineRefMap.get(ref);
|
|
790
|
+
const isGlobalRecursion = ref === 0;
|
|
791
|
+
const expandedSubroutine = isGlobalRecursion ? createRecursion(0) : (
|
|
792
|
+
// The reffed group might itself contain subroutines, which are expanded during sub-traversal
|
|
793
|
+
cloneCapturingGroup(reffedGroupNode, state.groupOriginByCopy, null)
|
|
794
|
+
);
|
|
795
|
+
let replacement = expandedSubroutine;
|
|
796
|
+
if (!isGlobalRecursion) {
|
|
797
|
+
const reffedGroupFlagMods = getCombinedFlagModsFromFlagNodes(getAllParents(
|
|
798
|
+
reffedGroupNode,
|
|
799
|
+
(p) => p.type === "Group" && !!p.flags
|
|
800
|
+
));
|
|
801
|
+
const reffedGroupFlags = reffedGroupFlagMods ? getNewCurrentFlags(state.globalFlags, reffedGroupFlagMods) : state.globalFlags;
|
|
802
|
+
if (!areFlagsEqual(reffedGroupFlags, state.currentFlags)) {
|
|
803
|
+
replacement = createGroup({
|
|
804
|
+
flags: getFlagModsFromFlags(reffedGroupFlags)
|
|
805
|
+
});
|
|
806
|
+
replacement.body[0].body.push(expandedSubroutine);
|
|
807
|
+
}
|
|
808
|
+
}
|
|
809
|
+
replaceWith(setParentDeep(replacement, parent), { traverse: !isGlobalRecursion });
|
|
810
|
+
}
|
|
811
|
+
};
|
|
812
|
+
var ThirdPassVisitor = {
|
|
813
|
+
Backreference({ node, parent, replaceWith }, state) {
|
|
814
|
+
if (node.orphan) {
|
|
815
|
+
state.highestOrphanBackref = Math.max(state.highestOrphanBackref, node.ref);
|
|
816
|
+
return;
|
|
817
|
+
}
|
|
818
|
+
const reffedNodes = state.reffedNodesByReferencer.get(node);
|
|
819
|
+
const participants = reffedNodes.filter((reffed) => canParticipateWithNode(reffed, node));
|
|
820
|
+
if (!participants.length) {
|
|
821
|
+
replaceWith(setParentDeep(createLookaroundAssertion({ negate: true }), parent));
|
|
822
|
+
} else if (participants.length > 1) {
|
|
823
|
+
const group = createGroup({
|
|
824
|
+
atomic: true,
|
|
825
|
+
body: participants.reverse().map((reffed) => createAlternative({
|
|
826
|
+
body: [createBackreference(reffed.number)]
|
|
827
|
+
}))
|
|
828
|
+
});
|
|
829
|
+
replaceWith(setParentDeep(group, parent));
|
|
830
|
+
} else {
|
|
831
|
+
node.ref = participants[0].number;
|
|
832
|
+
}
|
|
833
|
+
},
|
|
834
|
+
CapturingGroup({ node }, state) {
|
|
835
|
+
node.number = ++state.numCapturesToLeft;
|
|
836
|
+
if (node.name) {
|
|
837
|
+
if (state.groupsByName.get(node.name).get(node).hasDuplicateNameToRemove) {
|
|
838
|
+
delete node.name;
|
|
839
|
+
}
|
|
840
|
+
}
|
|
841
|
+
},
|
|
842
|
+
Regex: {
|
|
843
|
+
exit({ node }, state) {
|
|
844
|
+
const numCapsNeeded = Math.max(state.highestOrphanBackref - state.numCapturesToLeft, 0);
|
|
845
|
+
for (let i = 0; i < numCapsNeeded; i++) {
|
|
846
|
+
const emptyCapture = createCapturingGroup();
|
|
847
|
+
node.body.at(-1).body.push(emptyCapture);
|
|
848
|
+
}
|
|
849
|
+
}
|
|
850
|
+
},
|
|
851
|
+
Subroutine({ node }, state) {
|
|
852
|
+
if (!node.isRecursive || node.ref === 0) {
|
|
853
|
+
return;
|
|
854
|
+
}
|
|
855
|
+
node.ref = state.reffedNodesByReferencer.get(node).number;
|
|
856
|
+
}
|
|
857
|
+
};
|
|
858
|
+
function addParentProperties(root) {
|
|
859
|
+
traverse(root, {
|
|
860
|
+
"*"({ node, parent }) {
|
|
861
|
+
node.parent = parent;
|
|
862
|
+
}
|
|
863
|
+
});
|
|
864
|
+
}
|
|
865
|
+
function areFlagsEqual(a, b) {
|
|
866
|
+
return a.dotAll === b.dotAll && a.ignoreCase === b.ignoreCase;
|
|
867
|
+
}
|
|
868
|
+
function canParticipateWithNode(capture, node) {
|
|
869
|
+
let rightmostPoint = node;
|
|
870
|
+
do {
|
|
871
|
+
if (rightmostPoint.type === "Regex") {
|
|
872
|
+
return false;
|
|
873
|
+
}
|
|
874
|
+
if (rightmostPoint.type === "Alternative") {
|
|
875
|
+
continue;
|
|
876
|
+
}
|
|
877
|
+
if (rightmostPoint === capture) {
|
|
878
|
+
return false;
|
|
879
|
+
}
|
|
880
|
+
const kidsOfParent = getKids(rightmostPoint.parent);
|
|
881
|
+
for (const kid of kidsOfParent) {
|
|
882
|
+
if (kid === rightmostPoint) {
|
|
883
|
+
break;
|
|
884
|
+
}
|
|
885
|
+
if (kid === capture || isAncestorOf(kid, capture)) {
|
|
886
|
+
return true;
|
|
887
|
+
}
|
|
888
|
+
}
|
|
889
|
+
} while (rightmostPoint = rightmostPoint.parent);
|
|
890
|
+
throw new Error("Unexpected path");
|
|
891
|
+
}
|
|
892
|
+
function cloneCapturingGroup(obj, originMap, up, up2) {
|
|
893
|
+
const store = Array.isArray(obj) ? [] : {};
|
|
894
|
+
for (const [key, value] of Object.entries(obj)) {
|
|
895
|
+
if (key === "parent") {
|
|
896
|
+
store.parent = Array.isArray(up) ? up2 : up;
|
|
897
|
+
} else if (value && typeof value === "object") {
|
|
898
|
+
store[key] = cloneCapturingGroup(value, originMap, store, up);
|
|
899
|
+
} else {
|
|
900
|
+
if (key === "type" && value === "CapturingGroup") {
|
|
901
|
+
originMap.set(store, originMap.get(obj) ?? obj);
|
|
902
|
+
}
|
|
903
|
+
store[key] = value;
|
|
904
|
+
}
|
|
905
|
+
}
|
|
906
|
+
return store;
|
|
907
|
+
}
|
|
908
|
+
function createRecursion(ref) {
|
|
909
|
+
const node = createSubroutine(ref);
|
|
910
|
+
node.isRecursive = true;
|
|
911
|
+
return node;
|
|
912
|
+
}
|
|
913
|
+
function getAllParents(node, filterFn) {
|
|
914
|
+
const results = [];
|
|
915
|
+
while (node = node.parent) {
|
|
916
|
+
if (!filterFn || filterFn(node)) {
|
|
917
|
+
results.push(node);
|
|
918
|
+
}
|
|
919
|
+
}
|
|
920
|
+
return results;
|
|
921
|
+
}
|
|
922
|
+
function getAndStoreJsGroupName(name, map) {
|
|
923
|
+
if (map.has(name)) {
|
|
924
|
+
return map.get(name);
|
|
925
|
+
}
|
|
926
|
+
const jsName = `$${map.size}_${name.replace(/^[^$_\p{IDS}]|[^$\u200C\u200D\p{IDC}]/ug, "_")}`;
|
|
927
|
+
map.set(name, jsName);
|
|
928
|
+
return jsName;
|
|
929
|
+
}
|
|
930
|
+
function getCombinedFlagModsFromFlagNodes(flagNodes) {
|
|
931
|
+
const flagProps = ["dotAll", "ignoreCase"];
|
|
932
|
+
const combinedFlags = { enable: {}, disable: {} };
|
|
933
|
+
flagNodes.forEach(({ flags }) => {
|
|
934
|
+
flagProps.forEach((prop) => {
|
|
935
|
+
if (flags.enable?.[prop]) {
|
|
936
|
+
delete combinedFlags.disable[prop];
|
|
937
|
+
combinedFlags.enable[prop] = true;
|
|
938
|
+
}
|
|
939
|
+
if (flags.disable?.[prop]) {
|
|
940
|
+
combinedFlags.disable[prop] = true;
|
|
941
|
+
}
|
|
942
|
+
});
|
|
943
|
+
});
|
|
944
|
+
if (!Object.keys(combinedFlags.enable).length) {
|
|
945
|
+
delete combinedFlags.enable;
|
|
946
|
+
}
|
|
947
|
+
if (!Object.keys(combinedFlags.disable).length) {
|
|
948
|
+
delete combinedFlags.disable;
|
|
949
|
+
}
|
|
950
|
+
if (combinedFlags.enable || combinedFlags.disable) {
|
|
951
|
+
return combinedFlags;
|
|
952
|
+
}
|
|
953
|
+
return null;
|
|
954
|
+
}
|
|
955
|
+
function getFlagModsFromFlags({ dotAll, ignoreCase }) {
|
|
956
|
+
const mods = {};
|
|
957
|
+
if (dotAll || ignoreCase) {
|
|
958
|
+
mods.enable = {};
|
|
959
|
+
dotAll && (mods.enable.dotAll = true);
|
|
960
|
+
ignoreCase && (mods.enable.ignoreCase = true);
|
|
961
|
+
}
|
|
962
|
+
if (!dotAll || !ignoreCase) {
|
|
963
|
+
mods.disable = {};
|
|
964
|
+
!dotAll && (mods.disable.dotAll = true);
|
|
965
|
+
!ignoreCase && (mods.disable.ignoreCase = true);
|
|
966
|
+
}
|
|
967
|
+
return mods;
|
|
968
|
+
}
|
|
969
|
+
function getKids(node) {
|
|
970
|
+
if (!node) {
|
|
971
|
+
throw new Error("Node expected");
|
|
972
|
+
}
|
|
973
|
+
const { body } = node;
|
|
974
|
+
return Array.isArray(body) ? body : body ? [body] : null;
|
|
975
|
+
}
|
|
976
|
+
function getLeadingG(els) {
|
|
977
|
+
const firstToConsider = els.find((el) => el.kind === "search_start" || isLoneGLookaround(el, { negate: false }) || !isAlwaysZeroLength(el));
|
|
978
|
+
if (!firstToConsider) {
|
|
979
|
+
return null;
|
|
980
|
+
}
|
|
981
|
+
if (firstToConsider.kind === "search_start") {
|
|
982
|
+
return firstToConsider;
|
|
983
|
+
}
|
|
984
|
+
if (firstToConsider.type === "LookaroundAssertion") {
|
|
985
|
+
return firstToConsider.body[0].body[0];
|
|
986
|
+
}
|
|
987
|
+
if (firstToConsider.type === "CapturingGroup" || firstToConsider.type === "Group") {
|
|
988
|
+
const gNodesForGroup = [];
|
|
989
|
+
for (const alt of firstToConsider.body) {
|
|
990
|
+
const leadingG = getLeadingG(alt.body);
|
|
991
|
+
if (!leadingG) {
|
|
992
|
+
return null;
|
|
993
|
+
}
|
|
994
|
+
Array.isArray(leadingG) ? gNodesForGroup.push(...leadingG) : gNodesForGroup.push(leadingG);
|
|
995
|
+
}
|
|
996
|
+
return gNodesForGroup;
|
|
997
|
+
}
|
|
998
|
+
return null;
|
|
999
|
+
}
|
|
1000
|
+
function isAncestorOf(node, descendant) {
|
|
1001
|
+
const kids = getKids(node) ?? [];
|
|
1002
|
+
for (const kid of kids) {
|
|
1003
|
+
if (kid === descendant || isAncestorOf(kid, descendant)) {
|
|
1004
|
+
return true;
|
|
1005
|
+
}
|
|
1006
|
+
}
|
|
1007
|
+
return false;
|
|
1008
|
+
}
|
|
1009
|
+
function isAlwaysZeroLength({ type }) {
|
|
1010
|
+
return type === "Assertion" || type === "Directive" || type === "LookaroundAssertion";
|
|
1011
|
+
}
|
|
1012
|
+
function isAlwaysNonZeroLength(node) {
|
|
1013
|
+
const types = [
|
|
1014
|
+
"Character",
|
|
1015
|
+
"CharacterClass",
|
|
1016
|
+
"CharacterSet"
|
|
1017
|
+
];
|
|
1018
|
+
return types.includes(node.type) || node.type === "Quantifier" && node.min && types.includes(node.body.type);
|
|
1019
|
+
}
|
|
1020
|
+
function isLoneGLookaround(node, options) {
|
|
1021
|
+
const opts = {
|
|
1022
|
+
negate: null,
|
|
1023
|
+
...options
|
|
1024
|
+
};
|
|
1025
|
+
return node.type === "LookaroundAssertion" && (opts.negate === null || node.negate === opts.negate) && node.body.length === 1 && hasOnlyChild(node.body[0], {
|
|
1026
|
+
type: "Assertion",
|
|
1027
|
+
kind: "search_start"
|
|
1028
|
+
});
|
|
1029
|
+
}
|
|
1030
|
+
function isValidJsGroupName(name) {
|
|
1031
|
+
return /^[$_\p{IDS}][$\u200C\u200D\p{IDC}]*$/u.test(name);
|
|
1032
|
+
}
|
|
1033
|
+
function parseFragment(pattern, options) {
|
|
1034
|
+
const ast = parse(pattern, {
|
|
1035
|
+
...options,
|
|
1036
|
+
// Providing a custom set of Unicode property names avoids converting some JS Unicode
|
|
1037
|
+
// properties (ex: `\p{Alpha}`) to Onig POSIX classes
|
|
1038
|
+
unicodePropertyMap: JsUnicodePropertyMap
|
|
1039
|
+
});
|
|
1040
|
+
const alts = ast.body;
|
|
1041
|
+
if (alts.length > 1 || alts[0].body.length > 1) {
|
|
1042
|
+
return createGroup({ body: alts });
|
|
1043
|
+
}
|
|
1044
|
+
return alts[0].body[0];
|
|
1045
|
+
}
|
|
1046
|
+
function setNegate(node, negate) {
|
|
1047
|
+
node.negate = negate;
|
|
1048
|
+
return node;
|
|
1049
|
+
}
|
|
1050
|
+
function setParent(node, parent) {
|
|
1051
|
+
node.parent = parent;
|
|
1052
|
+
return node;
|
|
1053
|
+
}
|
|
1054
|
+
function setParentDeep(node, parent) {
|
|
1055
|
+
addParentProperties(node);
|
|
1056
|
+
node.parent = parent;
|
|
1057
|
+
return node;
|
|
1058
|
+
}
|
|
1059
|
+
|
|
1060
|
+
// src/generate.js
|
|
1061
|
+
import { createAlternative as createAlternative2, createCharacter as createCharacter2, createGroup as createGroup2 } from "oniguruma-parser/parser";
|
|
1062
|
+
import { traverse as traverse2 } from "oniguruma-parser/traverser";
|
|
1063
|
+
function generate(ast, options) {
|
|
1064
|
+
const opts = getOptions(options);
|
|
1065
|
+
const minTargetEs2024 = isMinTarget(opts.target, "ES2024");
|
|
1066
|
+
const minTargetEs2025 = isMinTarget(opts.target, "ES2025");
|
|
1067
|
+
const recursionLimit = opts.rules.recursionLimit;
|
|
1068
|
+
if (!Number.isInteger(recursionLimit) || recursionLimit < 2 || recursionLimit > 20) {
|
|
1069
|
+
throw new Error("Invalid recursionLimit; use 2-20");
|
|
1070
|
+
}
|
|
1071
|
+
let hasCaseInsensitiveNode = null;
|
|
1072
|
+
let hasCaseSensitiveNode = null;
|
|
1073
|
+
if (!minTargetEs2025) {
|
|
1074
|
+
const iStack = [ast.flags.ignoreCase];
|
|
1075
|
+
traverse2(ast, FlagModifierVisitor, {
|
|
1076
|
+
getCurrentModI: () => iStack.at(-1),
|
|
1077
|
+
popModI() {
|
|
1078
|
+
iStack.pop();
|
|
1079
|
+
},
|
|
1080
|
+
pushModI(isIOn) {
|
|
1081
|
+
iStack.push(isIOn);
|
|
1082
|
+
},
|
|
1083
|
+
setHasCasedChar() {
|
|
1084
|
+
if (iStack.at(-1)) {
|
|
1085
|
+
hasCaseInsensitiveNode = true;
|
|
1086
|
+
} else {
|
|
1087
|
+
hasCaseSensitiveNode = true;
|
|
1088
|
+
}
|
|
1089
|
+
}
|
|
1090
|
+
});
|
|
1091
|
+
}
|
|
1092
|
+
const appliedGlobalFlags = {
|
|
1093
|
+
dotAll: ast.flags.dotAll,
|
|
1094
|
+
// - Turn global flag i on if a case insensitive node was used and no case sensitive nodes were
|
|
1095
|
+
// used (to avoid unnecessary node expansion).
|
|
1096
|
+
// - Turn global flag i off if a case sensitive node was used (since case sensitivity can't be
|
|
1097
|
+
// forced without the use of ES2025 flag groups)
|
|
1098
|
+
ignoreCase: !!((ast.flags.ignoreCase || hasCaseInsensitiveNode) && !hasCaseSensitiveNode)
|
|
1099
|
+
};
|
|
1100
|
+
let lastNode = ast;
|
|
1101
|
+
const state = {
|
|
1102
|
+
accuracy: opts.accuracy,
|
|
1103
|
+
appliedGlobalFlags,
|
|
1104
|
+
captureMap: /* @__PURE__ */ new Map(),
|
|
1105
|
+
currentFlags: {
|
|
1106
|
+
dotAll: ast.flags.dotAll,
|
|
1107
|
+
ignoreCase: ast.flags.ignoreCase
|
|
1108
|
+
},
|
|
1109
|
+
inCharClass: false,
|
|
1110
|
+
lastNode,
|
|
1111
|
+
originMap: ast._originMap,
|
|
1112
|
+
recursionLimit,
|
|
1113
|
+
useAppliedIgnoreCase: !!(!minTargetEs2025 && hasCaseInsensitiveNode && hasCaseSensitiveNode),
|
|
1114
|
+
useFlagMods: minTargetEs2025,
|
|
1115
|
+
useFlagV: minTargetEs2024,
|
|
1116
|
+
verbose: opts.verbose
|
|
1117
|
+
};
|
|
1118
|
+
function gen(node) {
|
|
1119
|
+
state.lastNode = lastNode;
|
|
1120
|
+
lastNode = node;
|
|
1121
|
+
const fn = throwIfNullish(generator[node.type], `Unexpected node type "${node.type}"`);
|
|
1122
|
+
return fn(node, state, gen);
|
|
1123
|
+
}
|
|
1124
|
+
const result = {
|
|
1125
|
+
pattern: ast.body.map(gen).join("|"),
|
|
1126
|
+
// Could reset `lastNode` at this point via `lastNode = ast`, but it isn't needed by flags
|
|
1127
|
+
flags: gen(ast.flags),
|
|
1128
|
+
options: { ...ast.options }
|
|
1129
|
+
};
|
|
1130
|
+
if (!minTargetEs2024) {
|
|
1131
|
+
delete result.options.force.v;
|
|
1132
|
+
result.options.disable.v = true;
|
|
1133
|
+
result.options.unicodeSetsPlugin = null;
|
|
1134
|
+
}
|
|
1135
|
+
result._captureTransfers = /* @__PURE__ */ new Map();
|
|
1136
|
+
result._hiddenCaptures = [];
|
|
1137
|
+
state.captureMap.forEach((value, key) => {
|
|
1138
|
+
if (value.hidden) {
|
|
1139
|
+
result._hiddenCaptures.push(key);
|
|
1140
|
+
}
|
|
1141
|
+
if (value.transferTo) {
|
|
1142
|
+
getOrInsert(result._captureTransfers, value.transferTo, []).push(key);
|
|
1143
|
+
}
|
|
1144
|
+
});
|
|
1145
|
+
return result;
|
|
1146
|
+
}
|
|
1147
|
+
var FlagModifierVisitor = {
|
|
1148
|
+
"*": {
|
|
1149
|
+
enter({ node }, state) {
|
|
1150
|
+
if (isAnyGroup(node)) {
|
|
1151
|
+
const currentModI = state.getCurrentModI();
|
|
1152
|
+
state.pushModI(
|
|
1153
|
+
node.flags ? getNewCurrentFlags({ ignoreCase: currentModI }, node.flags).ignoreCase : currentModI
|
|
1154
|
+
);
|
|
1155
|
+
}
|
|
1156
|
+
},
|
|
1157
|
+
exit({ node }, state) {
|
|
1158
|
+
if (isAnyGroup(node)) {
|
|
1159
|
+
state.popModI();
|
|
1160
|
+
}
|
|
1161
|
+
}
|
|
1162
|
+
},
|
|
1163
|
+
Backreference(_, state) {
|
|
1164
|
+
state.setHasCasedChar();
|
|
1165
|
+
},
|
|
1166
|
+
Character({ node }, state) {
|
|
1167
|
+
if (charHasCase(cp(node.value))) {
|
|
1168
|
+
state.setHasCasedChar();
|
|
1169
|
+
}
|
|
1170
|
+
},
|
|
1171
|
+
CharacterClassRange({ node, skip }, state) {
|
|
1172
|
+
skip();
|
|
1173
|
+
if (getCasesOutsideCharClassRange(node, { firstOnly: true }).length) {
|
|
1174
|
+
state.setHasCasedChar();
|
|
1175
|
+
}
|
|
1176
|
+
},
|
|
1177
|
+
CharacterSet({ node }, state) {
|
|
1178
|
+
if (node.kind === "property" && UnicodePropertiesWithSpecificCase.has(node.value)) {
|
|
1179
|
+
state.setHasCasedChar();
|
|
1180
|
+
}
|
|
1181
|
+
}
|
|
1182
|
+
};
|
|
1183
|
+
var generator = {
|
|
1184
|
+
/**
|
|
1185
|
+
@param {AlternativeNode} node
|
|
1186
|
+
*/
|
|
1187
|
+
Alternative({ body }, _, gen) {
|
|
1188
|
+
return body.map(gen).join("");
|
|
1189
|
+
},
|
|
1190
|
+
/**
|
|
1191
|
+
@param {AssertionNode} node
|
|
1192
|
+
*/
|
|
1193
|
+
Assertion({ kind, negate }) {
|
|
1194
|
+
if (kind === "string_end") {
|
|
1195
|
+
return "$";
|
|
1196
|
+
}
|
|
1197
|
+
if (kind === "string_start") {
|
|
1198
|
+
return "^";
|
|
1199
|
+
}
|
|
1200
|
+
if (kind === "word_boundary") {
|
|
1201
|
+
return negate ? r`\B` : r`\b`;
|
|
1202
|
+
}
|
|
1203
|
+
throw new Error(`Unexpected assertion kind "${kind}"`);
|
|
1204
|
+
},
|
|
1205
|
+
/**
|
|
1206
|
+
@param {BackreferenceNode} node
|
|
1207
|
+
*/
|
|
1208
|
+
Backreference({ ref }, state) {
|
|
1209
|
+
if (typeof ref !== "number") {
|
|
1210
|
+
throw new Error("Unexpected named backref in transformed AST");
|
|
1211
|
+
}
|
|
1212
|
+
if (!state.useFlagMods && state.accuracy === "strict" && state.currentFlags.ignoreCase && !state.captureMap.get(ref).ignoreCase) {
|
|
1213
|
+
throw new Error("Use of case-insensitive backref to case-sensitive group requires target ES2025 or non-strict accuracy");
|
|
1214
|
+
}
|
|
1215
|
+
return "\\" + ref;
|
|
1216
|
+
},
|
|
1217
|
+
/**
|
|
1218
|
+
@param {CapturingGroupNode} node
|
|
1219
|
+
*/
|
|
1220
|
+
CapturingGroup(node, state, gen) {
|
|
1221
|
+
const { body, name, number } = node;
|
|
1222
|
+
const data = { ignoreCase: state.currentFlags.ignoreCase };
|
|
1223
|
+
const origin = state.originMap.get(node);
|
|
1224
|
+
if (origin) {
|
|
1225
|
+
data.hidden = true;
|
|
1226
|
+
if (number > origin.number) {
|
|
1227
|
+
data.transferTo = origin.number;
|
|
1228
|
+
}
|
|
1229
|
+
}
|
|
1230
|
+
state.captureMap.set(number, data);
|
|
1231
|
+
return `(${name ? `?<${name}>` : ""}${body.map(gen).join("|")})`;
|
|
1232
|
+
},
|
|
1233
|
+
/**
|
|
1234
|
+
@param {CharacterNode} node
|
|
1235
|
+
*/
|
|
1236
|
+
Character({ value }, state) {
|
|
1237
|
+
const char = cp(value);
|
|
1238
|
+
const escaped = getCharEscape(value, {
|
|
1239
|
+
escDigit: state.lastNode.type === "Backreference",
|
|
1240
|
+
inCharClass: state.inCharClass,
|
|
1241
|
+
useFlagV: state.useFlagV
|
|
1242
|
+
});
|
|
1243
|
+
if (escaped !== char) {
|
|
1244
|
+
return escaped;
|
|
1245
|
+
}
|
|
1246
|
+
if (state.useAppliedIgnoreCase && state.currentFlags.ignoreCase && charHasCase(char)) {
|
|
1247
|
+
const cases = getIgnoreCaseMatchChars(char);
|
|
1248
|
+
return state.inCharClass ? cases.join("") : cases.length > 1 ? `[${cases.join("")}]` : cases[0];
|
|
1249
|
+
}
|
|
1250
|
+
return char;
|
|
1251
|
+
},
|
|
1252
|
+
/**
|
|
1253
|
+
@param {CharacterClassNode} node
|
|
1254
|
+
*/
|
|
1255
|
+
CharacterClass(node, state, gen) {
|
|
1256
|
+
const { kind, negate, parent } = node;
|
|
1257
|
+
let { body } = node;
|
|
1258
|
+
if (kind === "intersection" && !state.useFlagV) {
|
|
1259
|
+
throw new Error("Use of character class intersection requires min target ES2024");
|
|
1260
|
+
}
|
|
1261
|
+
if (envFlags.bugFlagVLiteralHyphenIsRange && state.useFlagV && body.some(isLiteralHyphen)) {
|
|
1262
|
+
body = [createCharacter2(45), ...body.filter((kid) => !isLiteralHyphen(kid))];
|
|
1263
|
+
}
|
|
1264
|
+
const genClass = () => `[${negate ? "^" : ""}${body.map(gen).join(kind === "intersection" ? "&&" : "")}]`;
|
|
1265
|
+
if (!state.inCharClass) {
|
|
1266
|
+
if (
|
|
1267
|
+
// Already established `kind !== 'intersection'` if `!state.useFlagV`; don't check again
|
|
1268
|
+
(!state.useFlagV || envFlags.bugNestedClassIgnoresNegation) && !negate
|
|
1269
|
+
) {
|
|
1270
|
+
const negatedChildClasses = body.filter(
|
|
1271
|
+
(kid) => kid.type === "CharacterClass" && kid.kind === "union" && kid.negate
|
|
1272
|
+
);
|
|
1273
|
+
if (negatedChildClasses.length) {
|
|
1274
|
+
const group = createGroup2();
|
|
1275
|
+
const groupFirstAlt = group.body[0];
|
|
1276
|
+
group.parent = parent;
|
|
1277
|
+
groupFirstAlt.parent = group;
|
|
1278
|
+
body = body.filter((kid) => !negatedChildClasses.includes(kid));
|
|
1279
|
+
node.body = body;
|
|
1280
|
+
if (body.length) {
|
|
1281
|
+
node.parent = groupFirstAlt;
|
|
1282
|
+
groupFirstAlt.body.push(node);
|
|
1283
|
+
} else {
|
|
1284
|
+
group.body.pop();
|
|
1285
|
+
}
|
|
1286
|
+
negatedChildClasses.forEach((cc) => {
|
|
1287
|
+
const newAlt = createAlternative2({ body: [cc] });
|
|
1288
|
+
cc.parent = newAlt;
|
|
1289
|
+
newAlt.parent = group;
|
|
1290
|
+
group.body.push(newAlt);
|
|
1291
|
+
});
|
|
1292
|
+
return gen(group);
|
|
1293
|
+
}
|
|
1294
|
+
}
|
|
1295
|
+
state.inCharClass = true;
|
|
1296
|
+
const result = genClass();
|
|
1297
|
+
state.inCharClass = false;
|
|
1298
|
+
return result;
|
|
1299
|
+
}
|
|
1300
|
+
const firstEl = body[0];
|
|
1301
|
+
if (
|
|
1302
|
+
// Already established that the parent is a char class via `inCharClass`; don't check again
|
|
1303
|
+
kind === "union" && !negate && firstEl && // Allows many nested classes to work with `target` ES2018 which doesn't support nesting
|
|
1304
|
+
((!state.useFlagV || !state.verbose) && parent.kind === "union" && !(envFlags.bugFlagVLiteralHyphenIsRange && state.useFlagV) || !state.verbose && parent.kind === "intersection" && // JS doesn't allow intersection with union or ranges
|
|
1305
|
+
body.length === 1 && firstEl.type !== "CharacterClassRange")
|
|
1306
|
+
) {
|
|
1307
|
+
return body.map(gen).join("");
|
|
1308
|
+
}
|
|
1309
|
+
if (!state.useFlagV && parent.type === "CharacterClass") {
|
|
1310
|
+
throw new Error("Uses nested character class in a way that requires min target ES2024");
|
|
1311
|
+
}
|
|
1312
|
+
return genClass();
|
|
1313
|
+
},
|
|
1314
|
+
/**
|
|
1315
|
+
@param {CharacterClassRangeNode} node
|
|
1316
|
+
*/
|
|
1317
|
+
CharacterClassRange(node, state) {
|
|
1318
|
+
const min = node.min.value;
|
|
1319
|
+
const max = node.max.value;
|
|
1320
|
+
const escOpts = {
|
|
1321
|
+
escDigit: false,
|
|
1322
|
+
inCharClass: true,
|
|
1323
|
+
useFlagV: state.useFlagV
|
|
1324
|
+
};
|
|
1325
|
+
const minStr = getCharEscape(min, escOpts);
|
|
1326
|
+
const maxStr = getCharEscape(max, escOpts);
|
|
1327
|
+
const extraChars = /* @__PURE__ */ new Set();
|
|
1328
|
+
if (state.useAppliedIgnoreCase && state.currentFlags.ignoreCase) {
|
|
1329
|
+
const charsOutsideRange = getCasesOutsideCharClassRange(node);
|
|
1330
|
+
const ranges = getCodePointRangesFromChars(charsOutsideRange);
|
|
1331
|
+
ranges.forEach((value) => {
|
|
1332
|
+
extraChars.add(
|
|
1333
|
+
Array.isArray(value) ? `${getCharEscape(value[0], escOpts)}-${getCharEscape(value[1], escOpts)}` : getCharEscape(value, escOpts)
|
|
1334
|
+
);
|
|
1335
|
+
});
|
|
1336
|
+
}
|
|
1337
|
+
return `${minStr}-${maxStr}${[...extraChars].join("")}`;
|
|
1338
|
+
},
|
|
1339
|
+
/**
|
|
1340
|
+
@param {CharacterSetNode} node
|
|
1341
|
+
*/
|
|
1342
|
+
CharacterSet({ kind, negate, value, key }, state) {
|
|
1343
|
+
if (kind === "dot") {
|
|
1344
|
+
return state.currentFlags.dotAll ? state.appliedGlobalFlags.dotAll || state.useFlagMods ? "." : "[^]" : (
|
|
1345
|
+
// Onig's only line break char is line feed, unlike JS
|
|
1346
|
+
r`[^\n]`
|
|
1347
|
+
);
|
|
1348
|
+
}
|
|
1349
|
+
if (kind === "digit") {
|
|
1350
|
+
return negate ? r`\D` : r`\d`;
|
|
1351
|
+
}
|
|
1352
|
+
if (kind === "property") {
|
|
1353
|
+
if (state.useAppliedIgnoreCase && state.currentFlags.ignoreCase && UnicodePropertiesWithSpecificCase.has(value)) {
|
|
1354
|
+
throw new Error(`Unicode property "${value}" can't be case-insensitive when other chars have specific case`);
|
|
1355
|
+
}
|
|
1356
|
+
return `${negate ? r`\P` : r`\p`}{${key ? `${key}=` : ""}${value}}`;
|
|
1357
|
+
}
|
|
1358
|
+
if (kind === "word") {
|
|
1359
|
+
return negate ? r`\W` : r`\w`;
|
|
1360
|
+
}
|
|
1361
|
+
throw new Error(`Unexpected character set kind "${kind}"`);
|
|
1362
|
+
},
|
|
1363
|
+
/**
|
|
1364
|
+
@param {FlagsNode} node
|
|
1365
|
+
*/
|
|
1366
|
+
Flags(node, state) {
|
|
1367
|
+
return (
|
|
1368
|
+
// The transformer should never turn on the properties for flags d, g, m since Onig doesn't
|
|
1369
|
+
// have equivs. Flag m is never used since Onig uses different line break chars than JS
|
|
1370
|
+
// (node.hasIndices ? 'd' : '') +
|
|
1371
|
+
// (node.global ? 'g' : '') +
|
|
1372
|
+
// (node.multiline ? 'm' : '') +
|
|
1373
|
+
(state.appliedGlobalFlags.ignoreCase ? "i" : "") + (node.dotAll ? "s" : "") + (node.sticky ? "y" : "")
|
|
1374
|
+
);
|
|
1375
|
+
},
|
|
1376
|
+
/**
|
|
1377
|
+
@param {GroupNode} node
|
|
1378
|
+
*/
|
|
1379
|
+
Group({ atomic: atomic2, body, flags, parent }, state, gen) {
|
|
1380
|
+
const currentFlags = state.currentFlags;
|
|
1381
|
+
if (flags) {
|
|
1382
|
+
state.currentFlags = getNewCurrentFlags(currentFlags, flags);
|
|
1383
|
+
}
|
|
1384
|
+
const contents = body.map(gen).join("|");
|
|
1385
|
+
const result = !state.verbose && body.length === 1 && // Single alt
|
|
1386
|
+
parent.type !== "Quantifier" && !atomic2 && (!state.useFlagMods || !flags) ? contents : `(?${getGroupPrefix(atomic2, flags, state.useFlagMods)}${contents})`;
|
|
1387
|
+
state.currentFlags = currentFlags;
|
|
1388
|
+
return result;
|
|
1389
|
+
},
|
|
1390
|
+
/**
|
|
1391
|
+
@param {LookaroundAssertionNode} node
|
|
1392
|
+
*/
|
|
1393
|
+
LookaroundAssertion({ body, kind, negate }, _, gen) {
|
|
1394
|
+
const prefix = `${kind === "lookahead" ? "" : "<"}${negate ? "!" : "="}`;
|
|
1395
|
+
return `(?${prefix}${body.map(gen).join("|")})`;
|
|
1396
|
+
},
|
|
1397
|
+
/**
|
|
1398
|
+
@param {QuantifierNode} node
|
|
1399
|
+
*/
|
|
1400
|
+
Quantifier(node, _, gen) {
|
|
1401
|
+
return gen(node.body) + getQuantifierStr(node);
|
|
1402
|
+
},
|
|
1403
|
+
/**
|
|
1404
|
+
@param {SubroutineNode & {isRecursive: true}} node
|
|
1405
|
+
*/
|
|
1406
|
+
Subroutine({ isRecursive, ref }, state) {
|
|
1407
|
+
if (!isRecursive) {
|
|
1408
|
+
throw new Error("Unexpected non-recursive subroutine in transformed AST");
|
|
1409
|
+
}
|
|
1410
|
+
const limit = state.recursionLimit;
|
|
1411
|
+
return ref === 0 ? `(?R=${limit})` : r`\g<${ref}&R=${limit}>`;
|
|
1412
|
+
}
|
|
1413
|
+
};
|
|
1414
|
+
var BaseEscapeChars = /* @__PURE__ */ new Set([
|
|
1415
|
+
"$",
|
|
1416
|
+
"(",
|
|
1417
|
+
")",
|
|
1418
|
+
"*",
|
|
1419
|
+
"+",
|
|
1420
|
+
".",
|
|
1421
|
+
"?",
|
|
1422
|
+
"[",
|
|
1423
|
+
"\\",
|
|
1424
|
+
"]",
|
|
1425
|
+
"^",
|
|
1426
|
+
"{",
|
|
1427
|
+
"|",
|
|
1428
|
+
"}"
|
|
1429
|
+
]);
|
|
1430
|
+
var CharClassEscapeChars = /* @__PURE__ */ new Set([
|
|
1431
|
+
"-",
|
|
1432
|
+
"\\",
|
|
1433
|
+
"]",
|
|
1434
|
+
"^",
|
|
1435
|
+
// Literal `[` doesn't require escaping with flag u, but this can help work around regex source
|
|
1436
|
+
// linters and regex syntax processors that expect unescaped `[` to create a nested class
|
|
1437
|
+
"["
|
|
1438
|
+
]);
|
|
1439
|
+
var CharClassEscapeCharsFlagV = /* @__PURE__ */ new Set([
|
|
1440
|
+
"(",
|
|
1441
|
+
")",
|
|
1442
|
+
"-",
|
|
1443
|
+
"/",
|
|
1444
|
+
"[",
|
|
1445
|
+
"\\",
|
|
1446
|
+
"]",
|
|
1447
|
+
"^",
|
|
1448
|
+
"{",
|
|
1449
|
+
"|",
|
|
1450
|
+
"}",
|
|
1451
|
+
// Double punctuators; also includes already-listed `-` and `^`
|
|
1452
|
+
"!",
|
|
1453
|
+
"#",
|
|
1454
|
+
"$",
|
|
1455
|
+
"%",
|
|
1456
|
+
"&",
|
|
1457
|
+
"*",
|
|
1458
|
+
"+",
|
|
1459
|
+
",",
|
|
1460
|
+
".",
|
|
1461
|
+
":",
|
|
1462
|
+
";",
|
|
1463
|
+
"<",
|
|
1464
|
+
"=",
|
|
1465
|
+
">",
|
|
1466
|
+
"?",
|
|
1467
|
+
"@",
|
|
1468
|
+
"`",
|
|
1469
|
+
"~"
|
|
1470
|
+
]);
|
|
1471
|
+
var CharCodeEscapeMap = /* @__PURE__ */ new Map([
|
|
1472
|
+
[9, r`\t`],
|
|
1473
|
+
// horizontal tab
|
|
1474
|
+
[10, r`\n`],
|
|
1475
|
+
// line feed
|
|
1476
|
+
[11, r`\v`],
|
|
1477
|
+
// vertical tab
|
|
1478
|
+
[12, r`\f`],
|
|
1479
|
+
// form feed
|
|
1480
|
+
[13, r`\r`],
|
|
1481
|
+
// carriage return
|
|
1482
|
+
[8232, r`\u2028`],
|
|
1483
|
+
// line separator
|
|
1484
|
+
[8233, r`\u2029`],
|
|
1485
|
+
// paragraph separator
|
|
1486
|
+
[65279, r`\uFEFF`]
|
|
1487
|
+
// ZWNBSP/BOM
|
|
1488
|
+
]);
|
|
1489
|
+
var casedRe = /^\p{Cased}$/u;
|
|
1490
|
+
function charHasCase(char) {
|
|
1491
|
+
return casedRe.test(char);
|
|
1492
|
+
}
|
|
1493
|
+
function getCasesOutsideCharClassRange(node, options) {
|
|
1494
|
+
const firstOnly = !!options?.firstOnly;
|
|
1495
|
+
const min = node.min.value;
|
|
1496
|
+
const max = node.max.value;
|
|
1497
|
+
const found = [];
|
|
1498
|
+
if (min < 65 && (max === 65535 || max >= 131071) || min === 65536 && max >= 131071) {
|
|
1499
|
+
return found;
|
|
1500
|
+
}
|
|
1501
|
+
for (let i = min; i <= max; i++) {
|
|
1502
|
+
const char = cp(i);
|
|
1503
|
+
if (!charHasCase(char)) {
|
|
1504
|
+
continue;
|
|
1505
|
+
}
|
|
1506
|
+
const charsOutsideRange = getIgnoreCaseMatchChars(char).filter((caseOfChar) => {
|
|
1507
|
+
const num = caseOfChar.codePointAt(0);
|
|
1508
|
+
return num < min || num > max;
|
|
1509
|
+
});
|
|
1510
|
+
if (charsOutsideRange.length) {
|
|
1511
|
+
found.push(...charsOutsideRange);
|
|
1512
|
+
if (firstOnly) {
|
|
1513
|
+
break;
|
|
1514
|
+
}
|
|
1515
|
+
}
|
|
1516
|
+
}
|
|
1517
|
+
return found;
|
|
1518
|
+
}
|
|
1519
|
+
function getCharEscape(codePoint, { escDigit, inCharClass, useFlagV }) {
|
|
1520
|
+
if (CharCodeEscapeMap.has(codePoint)) {
|
|
1521
|
+
return CharCodeEscapeMap.get(codePoint);
|
|
1522
|
+
}
|
|
1523
|
+
if (
|
|
1524
|
+
// Control chars, etc.; condition modeled on the Chrome developer console's display for strings
|
|
1525
|
+
codePoint < 32 || codePoint > 126 && codePoint < 160 || // Unicode planes 4-16; unassigned, special purpose, and private use area
|
|
1526
|
+
codePoint > 262143 || // Avoid corrupting a preceding backref by immediately following it with a literal digit
|
|
1527
|
+
escDigit && isDigitCharCode(codePoint)
|
|
1528
|
+
) {
|
|
1529
|
+
return codePoint > 255 ? `\\u{${codePoint.toString(16).toUpperCase()}}` : `\\x${codePoint.toString(16).toUpperCase().padStart(2, "0")}`;
|
|
1530
|
+
}
|
|
1531
|
+
const escapeChars = inCharClass ? useFlagV ? CharClassEscapeCharsFlagV : CharClassEscapeChars : BaseEscapeChars;
|
|
1532
|
+
const char = cp(codePoint);
|
|
1533
|
+
return (escapeChars.has(char) ? "\\" : "") + char;
|
|
1534
|
+
}
|
|
1535
|
+
function getCodePointRangesFromChars(chars) {
|
|
1536
|
+
const codePoints = chars.map((char) => char.codePointAt(0)).sort((a, b) => a - b);
|
|
1537
|
+
const values = [];
|
|
1538
|
+
let start = null;
|
|
1539
|
+
for (let i = 0; i < codePoints.length; i++) {
|
|
1540
|
+
if (codePoints[i + 1] === codePoints[i] + 1) {
|
|
1541
|
+
start ??= codePoints[i];
|
|
1542
|
+
} else if (start === null) {
|
|
1543
|
+
values.push(codePoints[i]);
|
|
1544
|
+
} else {
|
|
1545
|
+
values.push([start, codePoints[i]]);
|
|
1546
|
+
start = null;
|
|
1547
|
+
}
|
|
1548
|
+
}
|
|
1549
|
+
return values;
|
|
1550
|
+
}
|
|
1551
|
+
function getGroupPrefix(atomic2, flagMods, useFlagMods) {
|
|
1552
|
+
if (atomic2) {
|
|
1553
|
+
return ">";
|
|
1554
|
+
}
|
|
1555
|
+
let mods = "";
|
|
1556
|
+
if (flagMods && useFlagMods) {
|
|
1557
|
+
const { enable, disable } = flagMods;
|
|
1558
|
+
mods = (enable?.ignoreCase ? "i" : "") + (enable?.dotAll ? "s" : "") + (disable ? "-" : "") + (disable?.ignoreCase ? "i" : "") + (disable?.dotAll ? "s" : "");
|
|
1559
|
+
}
|
|
1560
|
+
return `${mods}:`;
|
|
1561
|
+
}
|
|
1562
|
+
function getQuantifierStr({ kind, max, min }) {
|
|
1563
|
+
let base;
|
|
1564
|
+
if (!min && max === 1) {
|
|
1565
|
+
base = "?";
|
|
1566
|
+
} else if (!min && max === Infinity) {
|
|
1567
|
+
base = "*";
|
|
1568
|
+
} else if (min === 1 && max === Infinity) {
|
|
1569
|
+
base = "+";
|
|
1570
|
+
} else if (min === max) {
|
|
1571
|
+
base = `{${min}}`;
|
|
1572
|
+
} else {
|
|
1573
|
+
base = `{${min},${max === Infinity ? "" : max}}`;
|
|
1574
|
+
}
|
|
1575
|
+
return base + {
|
|
1576
|
+
greedy: "",
|
|
1577
|
+
lazy: "?",
|
|
1578
|
+
possessive: "+"
|
|
1579
|
+
}[kind];
|
|
1580
|
+
}
|
|
1581
|
+
function isAnyGroup({ type }) {
|
|
1582
|
+
return type === "CapturingGroup" || type === "Group" || type === "LookaroundAssertion";
|
|
1583
|
+
}
|
|
1584
|
+
function isDigitCharCode(value) {
|
|
1585
|
+
return value > 47 && value < 58;
|
|
1586
|
+
}
|
|
1587
|
+
function isLiteralHyphen({ type, value }) {
|
|
1588
|
+
return type === "Character" && value === 45;
|
|
1589
|
+
}
|
|
1590
|
+
|
|
1591
|
+
// src/subclass.js
|
|
1592
|
+
var EmulatedRegExp = class _EmulatedRegExp extends RegExp {
|
|
1593
|
+
/**
|
|
1594
|
+
@type {Map<number, {
|
|
1595
|
+
hidden?: true;
|
|
1596
|
+
transferTo?: number;
|
|
1597
|
+
}>}
|
|
1598
|
+
*/
|
|
1599
|
+
#captureMap = /* @__PURE__ */ new Map();
|
|
1600
|
+
/**
|
|
1601
|
+
@type {RegExp | EmulatedRegExp | null}
|
|
1602
|
+
*/
|
|
1603
|
+
#compiled = null;
|
|
1604
|
+
/**
|
|
1605
|
+
@type {string}
|
|
1606
|
+
*/
|
|
1607
|
+
#pattern;
|
|
1608
|
+
/**
|
|
1609
|
+
@type {Map<number, string>?}
|
|
1610
|
+
*/
|
|
1611
|
+
#nameMap = null;
|
|
1612
|
+
/**
|
|
1613
|
+
@type {string?}
|
|
1614
|
+
*/
|
|
1615
|
+
#strategy = null;
|
|
1616
|
+
/**
|
|
1617
|
+
Can be used to serialize the instance.
|
|
1618
|
+
@type {EmulatedRegExpOptions}
|
|
1619
|
+
*/
|
|
1620
|
+
rawOptions = {};
|
|
1621
|
+
// Override the getter with one that works with lazy-compiled regexes
|
|
1622
|
+
get source() {
|
|
1623
|
+
return this.#pattern || "(?:)";
|
|
1624
|
+
}
|
|
1625
|
+
/**
|
|
1626
|
+
@overload
|
|
1627
|
+
@param {string} pattern
|
|
1628
|
+
@param {string} [flags]
|
|
1629
|
+
@param {EmulatedRegExpOptions} [options]
|
|
1630
|
+
*/
|
|
1631
|
+
/**
|
|
1632
|
+
@overload
|
|
1633
|
+
@param {EmulatedRegExp} pattern
|
|
1634
|
+
@param {string} [flags]
|
|
1635
|
+
*/
|
|
1636
|
+
constructor(pattern, flags, options) {
|
|
1637
|
+
const lazyCompile = !!options?.lazyCompile;
|
|
1638
|
+
if (pattern instanceof RegExp) {
|
|
1639
|
+
if (options) {
|
|
1640
|
+
throw new Error("Cannot provide options when copying a regexp");
|
|
1641
|
+
}
|
|
1642
|
+
const re = pattern;
|
|
1643
|
+
super(re, flags);
|
|
1644
|
+
this.#pattern = re.source;
|
|
1645
|
+
if (re instanceof _EmulatedRegExp) {
|
|
1646
|
+
this.#captureMap = re.#captureMap;
|
|
1647
|
+
this.#nameMap = re.#nameMap;
|
|
1648
|
+
this.#strategy = re.#strategy;
|
|
1649
|
+
this.rawOptions = re.rawOptions;
|
|
1650
|
+
}
|
|
1651
|
+
} else {
|
|
1652
|
+
const opts = {
|
|
1653
|
+
hiddenCaptures: [],
|
|
1654
|
+
strategy: null,
|
|
1655
|
+
transfers: [],
|
|
1656
|
+
...options
|
|
1657
|
+
};
|
|
1658
|
+
super(lazyCompile ? "" : pattern, flags);
|
|
1659
|
+
this.#pattern = pattern;
|
|
1660
|
+
this.#captureMap = createCaptureMap(opts.hiddenCaptures, opts.transfers);
|
|
1661
|
+
this.#strategy = opts.strategy;
|
|
1662
|
+
this.rawOptions = options ?? {};
|
|
1663
|
+
}
|
|
1664
|
+
if (!lazyCompile) {
|
|
1665
|
+
this.#compiled = this;
|
|
1666
|
+
}
|
|
1667
|
+
}
|
|
1668
|
+
/**
|
|
1669
|
+
Called internally by all String/RegExp methods that use regexes.
|
|
1670
|
+
@override
|
|
1671
|
+
@param {string} str
|
|
1672
|
+
@returns {RegExpExecArray?}
|
|
1673
|
+
*/
|
|
1674
|
+
exec(str) {
|
|
1675
|
+
if (!this.#compiled) {
|
|
1676
|
+
const { lazyCompile, ...rest } = this.rawOptions;
|
|
1677
|
+
this.#compiled = new _EmulatedRegExp(this.#pattern, this.flags, rest);
|
|
1678
|
+
}
|
|
1679
|
+
const useLastIndex = this.global || this.sticky;
|
|
1680
|
+
const pos = this.lastIndex;
|
|
1681
|
+
if (this.#strategy === "clip_search" && useLastIndex && pos) {
|
|
1682
|
+
this.lastIndex = 0;
|
|
1683
|
+
const match = this.#execCore(str.slice(pos));
|
|
1684
|
+
if (match) {
|
|
1685
|
+
adjustMatchDetailsForOffset(match, pos, str, this.hasIndices);
|
|
1686
|
+
this.lastIndex += pos;
|
|
1687
|
+
}
|
|
1688
|
+
return match;
|
|
1689
|
+
}
|
|
1690
|
+
return this.#execCore(str);
|
|
1691
|
+
}
|
|
1692
|
+
/**
|
|
1693
|
+
Adds support for hidden and transfer captures.
|
|
1694
|
+
@param {string} str
|
|
1695
|
+
@returns
|
|
1696
|
+
*/
|
|
1697
|
+
#execCore(str) {
|
|
1698
|
+
this.#compiled.lastIndex = this.lastIndex;
|
|
1699
|
+
const match = super.exec.call(this.#compiled, str);
|
|
1700
|
+
this.lastIndex = this.#compiled.lastIndex;
|
|
1701
|
+
if (!match || !this.#captureMap.size) {
|
|
1702
|
+
return match;
|
|
1703
|
+
}
|
|
1704
|
+
const matchCopy = [...match];
|
|
1705
|
+
match.length = 1;
|
|
1706
|
+
let indicesCopy;
|
|
1707
|
+
if (this.hasIndices) {
|
|
1708
|
+
indicesCopy = [...match.indices];
|
|
1709
|
+
match.indices.length = 1;
|
|
1710
|
+
}
|
|
1711
|
+
const mappedNums = [0];
|
|
1712
|
+
for (let i = 1; i < matchCopy.length; i++) {
|
|
1713
|
+
const { hidden, transferTo } = this.#captureMap.get(i) ?? {};
|
|
1714
|
+
if (hidden) {
|
|
1715
|
+
mappedNums.push(null);
|
|
1716
|
+
} else {
|
|
1717
|
+
mappedNums.push(match.length);
|
|
1718
|
+
match.push(matchCopy[i]);
|
|
1719
|
+
if (this.hasIndices) {
|
|
1720
|
+
match.indices.push(indicesCopy[i]);
|
|
1721
|
+
}
|
|
1722
|
+
}
|
|
1723
|
+
if (transferTo && matchCopy[i] !== void 0) {
|
|
1724
|
+
const to = mappedNums[transferTo];
|
|
1725
|
+
if (!to) {
|
|
1726
|
+
throw new Error(`Invalid capture transfer to "${to}"`);
|
|
1727
|
+
}
|
|
1728
|
+
match[to] = matchCopy[i];
|
|
1729
|
+
if (this.hasIndices) {
|
|
1730
|
+
match.indices[to] = indicesCopy[i];
|
|
1731
|
+
}
|
|
1732
|
+
if (match.groups) {
|
|
1733
|
+
if (!this.#nameMap) {
|
|
1734
|
+
this.#nameMap = createNameMap(this.source);
|
|
1735
|
+
}
|
|
1736
|
+
const name = this.#nameMap.get(transferTo);
|
|
1737
|
+
if (name) {
|
|
1738
|
+
match.groups[name] = matchCopy[i];
|
|
1739
|
+
if (this.hasIndices) {
|
|
1740
|
+
match.indices.groups[name] = indicesCopy[i];
|
|
1741
|
+
}
|
|
1742
|
+
}
|
|
1743
|
+
}
|
|
1744
|
+
}
|
|
1745
|
+
}
|
|
1746
|
+
return match;
|
|
1747
|
+
}
|
|
1748
|
+
};
|
|
1749
|
+
function adjustMatchDetailsForOffset(match, offset, input, hasIndices) {
|
|
1750
|
+
match.index += offset;
|
|
1751
|
+
match.input = input;
|
|
1752
|
+
if (hasIndices) {
|
|
1753
|
+
const indices = match.indices;
|
|
1754
|
+
for (let i = 0; i < indices.length; i++) {
|
|
1755
|
+
const arr = indices[i];
|
|
1756
|
+
if (arr) {
|
|
1757
|
+
indices[i] = [arr[0] + offset, arr[1] + offset];
|
|
1758
|
+
}
|
|
1759
|
+
}
|
|
1760
|
+
const groupIndices = indices.groups;
|
|
1761
|
+
if (groupIndices) {
|
|
1762
|
+
Object.keys(groupIndices).forEach((key) => {
|
|
1763
|
+
const arr = groupIndices[key];
|
|
1764
|
+
if (arr) {
|
|
1765
|
+
groupIndices[key] = [arr[0] + offset, arr[1] + offset];
|
|
1766
|
+
}
|
|
1767
|
+
});
|
|
1768
|
+
}
|
|
1769
|
+
}
|
|
1770
|
+
}
|
|
1771
|
+
function createCaptureMap(hiddenCaptures, transfers) {
|
|
1772
|
+
const captureMap = /* @__PURE__ */ new Map();
|
|
1773
|
+
for (const num of hiddenCaptures) {
|
|
1774
|
+
captureMap.set(num, {
|
|
1775
|
+
hidden: true
|
|
1776
|
+
});
|
|
1777
|
+
}
|
|
1778
|
+
for (const [to, from] of transfers) {
|
|
1779
|
+
for (const num of from) {
|
|
1780
|
+
getOrInsert(captureMap, num, {}).transferTo = to;
|
|
1781
|
+
}
|
|
1782
|
+
}
|
|
1783
|
+
return captureMap;
|
|
1784
|
+
}
|
|
1785
|
+
function createNameMap(pattern) {
|
|
1786
|
+
const re = /(?<capture>\((?:\?<(?![=!])(?<name>[^>]+)>|(?!\?)))|\\?./gsu;
|
|
1787
|
+
const map = /* @__PURE__ */ new Map();
|
|
1788
|
+
let numCharClassesOpen = 0;
|
|
1789
|
+
let numCaptures = 0;
|
|
1790
|
+
let match;
|
|
1791
|
+
while (match = re.exec(pattern)) {
|
|
1792
|
+
const { 0: m, groups: { capture, name } } = match;
|
|
1793
|
+
if (m === "[") {
|
|
1794
|
+
numCharClassesOpen++;
|
|
1795
|
+
} else if (!numCharClassesOpen) {
|
|
1796
|
+
if (capture) {
|
|
1797
|
+
numCaptures++;
|
|
1798
|
+
if (name) {
|
|
1799
|
+
map.set(numCaptures, name);
|
|
1800
|
+
}
|
|
1801
|
+
}
|
|
1802
|
+
} else if (m === "]") {
|
|
1803
|
+
numCharClassesOpen--;
|
|
1804
|
+
}
|
|
1805
|
+
}
|
|
1806
|
+
return map;
|
|
1807
|
+
}
|
|
1808
|
+
|
|
1809
|
+
// src/index.js
|
|
1810
|
+
import { parse as parse2 } from "oniguruma-parser/parser";
|
|
1811
|
+
import { atomic, possessive } from "regex/internals";
|
|
1812
|
+
import { recursion } from "regex-recursion";
|
|
1813
|
+
function toRegExp(pattern, options) {
|
|
1814
|
+
const d = toRegExpDetails(pattern, options);
|
|
1815
|
+
if (d.options) {
|
|
1816
|
+
return new EmulatedRegExp(d.pattern, d.flags, d.options);
|
|
1817
|
+
}
|
|
1818
|
+
return new RegExp(d.pattern, d.flags);
|
|
1819
|
+
}
|
|
1820
|
+
function toRegExpDetails(pattern, options) {
|
|
1821
|
+
const opts = getOptions(options);
|
|
1822
|
+
const onigurumaAst = parse2(pattern, {
|
|
1823
|
+
flags: opts.flags,
|
|
1824
|
+
normalizeUnknownPropertyNames: true,
|
|
1825
|
+
rules: {
|
|
1826
|
+
captureGroup: opts.rules.captureGroup,
|
|
1827
|
+
singleline: opts.rules.singleline
|
|
1828
|
+
},
|
|
1829
|
+
skipBackrefValidation: opts.rules.allowOrphanBackrefs,
|
|
1830
|
+
unicodePropertyMap: JsUnicodePropertyMap
|
|
1831
|
+
});
|
|
1832
|
+
const regexPlusAst = transform(onigurumaAst, {
|
|
1833
|
+
accuracy: opts.accuracy,
|
|
1834
|
+
asciiWordBoundaries: opts.rules.asciiWordBoundaries,
|
|
1835
|
+
avoidSubclass: opts.avoidSubclass,
|
|
1836
|
+
bestEffortTarget: opts.target
|
|
1837
|
+
});
|
|
1838
|
+
const generated = generate(regexPlusAst, opts);
|
|
1839
|
+
const recursionResult = recursion(generated.pattern, {
|
|
1840
|
+
captureTransfers: generated._captureTransfers,
|
|
1841
|
+
hiddenCaptures: generated._hiddenCaptures,
|
|
1842
|
+
mode: "external"
|
|
1843
|
+
});
|
|
1844
|
+
const possessiveResult = possessive(recursionResult.pattern);
|
|
1845
|
+
const atomicResult = atomic(possessiveResult.pattern, {
|
|
1846
|
+
captureTransfers: recursionResult.captureTransfers,
|
|
1847
|
+
hiddenCaptures: recursionResult.hiddenCaptures
|
|
1848
|
+
});
|
|
1849
|
+
const details = {
|
|
1850
|
+
pattern: atomicResult.pattern,
|
|
1851
|
+
flags: `${opts.hasIndices ? "d" : ""}${opts.global ? "g" : ""}${generated.flags}${generated.options.disable.v ? "u" : "v"}`
|
|
1852
|
+
};
|
|
1853
|
+
if (opts.avoidSubclass) {
|
|
1854
|
+
if (opts.lazyCompileLength !== Infinity) {
|
|
1855
|
+
throw new Error("Lazy compilation requires subclass");
|
|
1856
|
+
}
|
|
1857
|
+
} else {
|
|
1858
|
+
const hiddenCaptures = atomicResult.hiddenCaptures.sort((a, b) => a - b);
|
|
1859
|
+
const transfers = Array.from(atomicResult.captureTransfers);
|
|
1860
|
+
const strategy = regexPlusAst._strategy;
|
|
1861
|
+
const lazyCompile = details.pattern.length >= opts.lazyCompileLength;
|
|
1862
|
+
if (hiddenCaptures.length || transfers.length || strategy || lazyCompile) {
|
|
1863
|
+
details.options = {
|
|
1864
|
+
...hiddenCaptures.length && { hiddenCaptures },
|
|
1865
|
+
...transfers.length && { transfers },
|
|
1866
|
+
...strategy && { strategy },
|
|
1867
|
+
...lazyCompile && { lazyCompile }
|
|
1868
|
+
};
|
|
1869
|
+
}
|
|
1870
|
+
}
|
|
1871
|
+
return details;
|
|
1872
|
+
}
|
|
1873
|
+
export {
|
|
1874
|
+
EmulatedRegExp,
|
|
1875
|
+
toRegExp,
|
|
1876
|
+
toRegExpDetails
|
|
1877
|
+
};
|
|
1878
|
+
//# sourceMappingURL=index.js.map
|