zudoku 0.42.0 → 0.42.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app/main.js +0 -6
- package/dist/app/main.js.map +1 -1
- package/dist/config/validators/common.d.ts +288 -420
- package/dist/config/validators/common.js +0 -10
- package/dist/config/validators/common.js.map +1 -1
- package/dist/config/validators/validate.d.ts +108 -161
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/index.js.map +1 -1
- package/dist/lib/components/Markdown.d.ts +1 -3
- package/dist/lib/components/Markdown.js +14 -8
- package/dist/lib/components/Markdown.js.map +1 -1
- package/dist/lib/components/context/ZudokuContext.d.ts +1 -1
- package/dist/lib/components/index.d.ts +1 -2
- package/dist/lib/core/ZudokuContext.d.ts +0 -7
- package/dist/lib/core/ZudokuContext.js.map +1 -1
- package/dist/lib/errors/ErrorAlert.js +1 -1
- package/dist/lib/errors/ErrorAlert.js.map +1 -1
- package/dist/lib/plugins/openapi/CollapsibleCode.js +1 -1
- package/dist/lib/plugins/openapi/CollapsibleCode.js.map +1 -1
- package/dist/lib/plugins/openapi/Sidecar.js +1 -1
- package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
- package/dist/lib/plugins/openapi/SidecarExamples.js +1 -1
- package/dist/lib/plugins/openapi/SidecarExamples.js.map +1 -1
- package/dist/lib/ui/Callout.js +1 -1
- package/dist/lib/ui/Callout.js.map +1 -1
- package/dist/lib/ui/SyntaxHighlight.d.ts +15 -10
- package/dist/lib/ui/SyntaxHighlight.js +60 -10
- package/dist/lib/ui/SyntaxHighlight.js.map +1 -1
- package/dist/lib/util/MdxComponents.d.ts +3 -9
- package/dist/lib/util/MdxComponents.js +10 -9
- package/dist/lib/util/MdxComponents.js.map +1 -1
- package/dist/vite/config.js +0 -34
- package/dist/vite/config.js.map +1 -1
- package/dist/vite/plugin-mdx.js +11 -4
- package/dist/vite/plugin-mdx.js.map +1 -1
- package/dist/vite/plugin.js +0 -2
- package/dist/vite/plugin.js.map +1 -1
- package/lib/AuthenticationPlugin-DPCuR3xm.js +58 -0
- package/lib/{AuthenticationPlugin-EeQpQI3D.js.map → AuthenticationPlugin-DPCuR3xm.js.map} +1 -1
- package/lib/{Button-Bdk_Ij3U.js → Button-BBNrKpQd.js} +3 -3
- package/lib/{Button-Bdk_Ij3U.js.map → Button-BBNrKpQd.js.map} +1 -1
- package/lib/{Callout-XadUe37J.js → Callout-D3Ja4OPX.js} +12 -12
- package/lib/{Callout-XadUe37J.js.map → Callout-D3Ja4OPX.js.map} +1 -1
- package/lib/{CategoryHeading-DZi-Szor.js → CategoryHeading-D06WK_Wo.js} +2 -2
- package/lib/{CategoryHeading-DZi-Szor.js.map → CategoryHeading-D06WK_Wo.js.map} +1 -1
- package/lib/{Dialog-CNf2oWXG.js → Dialog-ByYz4ABw.js} +2 -2
- package/lib/{Dialog-CNf2oWXG.js.map → Dialog-ByYz4ABw.js.map} +1 -1
- package/lib/{Drawer-BPBxzel2.js → Drawer-CEwbkLDb.js} +25 -25
- package/lib/{Drawer-BPBxzel2.js.map → Drawer-CEwbkLDb.js.map} +1 -1
- package/lib/Markdown-mFpg_n9p.js +17125 -0
- package/lib/Markdown-mFpg_n9p.js.map +1 -0
- package/lib/MdxPage-Cm7atiW3.js +85 -0
- package/lib/{MdxPage-Dxbq6lFr.js.map → MdxPage-Cm7atiW3.js.map} +1 -1
- package/lib/{OasProvider-DKpTJMH2.js → OasProvider-CZiF_RMW.js} +4 -4
- package/lib/{OasProvider-DKpTJMH2.js.map → OasProvider-CZiF_RMW.js.map} +1 -1
- package/lib/{OperationList-DVOyNeno.js → OperationList-CMMzLfIZ.js} +1417 -1385
- package/lib/{OperationList-DVOyNeno.js.map → OperationList-CMMzLfIZ.js.map} +1 -1
- package/lib/{Pagination-COMmV-g9.js → Pagination-DLPL5z77.js} +4 -4
- package/lib/{Pagination-COMmV-g9.js.map → Pagination-DLPL5z77.js.map} +1 -1
- package/lib/RouteGuard-DRtEu9nh.js +744 -0
- package/lib/{RouteGuard-CGqivwrh.js.map → RouteGuard-DRtEu9nh.js.map} +1 -1
- package/lib/{SchemaList-BTWzXyYQ.js → SchemaList-_d3Mf4IX.js} +44 -43
- package/lib/{SchemaList-BTWzXyYQ.js.map → SchemaList-_d3Mf4IX.js.map} +1 -1
- package/lib/{SchemaView-DNKKW3nB.js → SchemaView-J7Srn-Iy.js} +11 -7
- package/lib/{SchemaView-DNKKW3nB.js.map → SchemaView-J7Srn-Iy.js.map} +1 -1
- package/lib/Select-CT64Ou40.js +223 -0
- package/lib/{Select-m-ITdvFa.js.map → Select-CT64Ou40.js.map} +1 -1
- package/lib/SlotletProvider-CS_nO-XT.js +340 -0
- package/lib/SlotletProvider-CS_nO-XT.js.map +1 -0
- package/lib/SyntaxHighlight-CxhyyMkF.js +2890 -0
- package/lib/SyntaxHighlight-CxhyyMkF.js.map +1 -0
- package/lib/{Toc-CzMOgcPS.js → Toc-D_tV8_Ri.js} +3 -3
- package/lib/{Toc-CzMOgcPS.js.map → Toc-D_tV8_Ri.js.map} +1 -1
- package/lib/{chunk-BAXFHI7N-CFrZQ7Oh.js → chunk-BAXFHI7N-BVBOl9s0.js} +264 -257
- package/lib/{chunk-BAXFHI7N-CFrZQ7Oh.js.map → chunk-BAXFHI7N-BVBOl9s0.js.map} +1 -1
- package/lib/{circular-D__GEK2G.js → circular-ByJI6Mci.js} +47 -47
- package/lib/{circular-D__GEK2G.js.map → circular-ByJI6Mci.js.map} +1 -1
- package/lib/{cn-CwJPJKOE.js → cn-qaFjX9_3.js} +29 -28
- package/lib/{cn-CwJPJKOE.js.map → cn-qaFjX9_3.js.map} +1 -1
- package/lib/{createServer-B4l2NSkt.js → createServer-IW7v5hWm.js} +3868 -3724
- package/lib/{createServer-B4l2NSkt.js.map → createServer-IW7v5hWm.js.map} +1 -1
- package/lib/hook-CldJlP5c.js +1478 -0
- package/lib/{hook-CyNmcNr8.js.map → hook-CldJlP5c.js.map} +1 -1
- package/lib/{index-CCS3ifKs.js → index-BPqJMdth.js} +733 -690
- package/lib/{index-CCS3ifKs.js.map → index-BPqJMdth.js.map} +1 -1
- package/lib/{index-Z13x6tPX.js → index-CPNSgwSb.js} +5 -5
- package/lib/{index-Z13x6tPX.js.map → index-CPNSgwSb.js.map} +1 -1
- package/lib/{index-CrcNWbel.js → index-CuBIgTKC.js} +9 -9
- package/lib/{index-CrcNWbel.js.map → index-CuBIgTKC.js.map} +1 -1
- package/lib/{index-zddirpDj.js → index-DcHeSvkE.js} +609 -581
- package/lib/{index-zddirpDj.js.map → index-DcHeSvkE.js.map} +1 -1
- package/lib/index-DnQftvP4.js +5031 -0
- package/lib/{index-BcMPFdRU.js.map → index-DnQftvP4.js.map} +1 -1
- package/lib/{index--oeBayMa.js → index-DwT-v3zK.js} +2 -2
- package/lib/{index--oeBayMa.js.map → index-DwT-v3zK.js.map} +1 -1
- package/lib/{index-BvvmIczU.js → index-LNp6rxyU.js} +2 -2
- package/lib/{index-BvvmIczU.js.map → index-LNp6rxyU.js.map} +1 -1
- package/lib/invariant-Caa8-XvF.js +26 -0
- package/lib/{invariant-D3QcI9fa.js.map → invariant-Caa8-XvF.js.map} +1 -1
- package/lib/mutation-DBQh7AOZ.js +211 -0
- package/lib/{mutation-narTVsCe.js.map → mutation-DBQh7AOZ.js.map} +1 -1
- package/lib/prism-bash.min-HHIMdNJ_.js +7 -0
- package/lib/prism-bash.min-HHIMdNJ_.js.map +1 -0
- package/lib/prism-csharp.min-C43x1RY2.js +63 -0
- package/lib/prism-csharp.min-C43x1RY2.js.map +1 -0
- package/lib/prism-java.min-CQzr40NQ.js +35 -0
- package/lib/prism-java.min-CQzr40NQ.js.map +1 -0
- package/lib/prism-javascript.min-CEqHqgbm.js +9 -0
- package/lib/prism-javascript.min-CEqHqgbm.js.map +1 -0
- package/lib/prism-json.min-B1GJqK1k.js +2 -0
- package/lib/prism-json.min-B1GJqK1k.js.map +1 -0
- package/lib/prism-jsstacktrace.min-BfobCF2F.js +2 -0
- package/lib/prism-jsstacktrace.min-BfobCF2F.js.map +1 -0
- package/lib/prism-markdown.min-C0Qn0m-5.js +61 -0
- package/lib/prism-markdown.min-C0Qn0m-5.js.map +1 -0
- package/lib/prism-markup-BNGj0Tvm.js +174 -0
- package/lib/prism-markup-BNGj0Tvm.js.map +1 -0
- package/lib/prism-objectivec.min-BXSWqpJJ.js +2 -0
- package/lib/prism-objectivec.min-BXSWqpJJ.js.map +1 -0
- package/lib/prism-ruby.min-L9OdQ6tU.js +38 -0
- package/lib/prism-ruby.min-L9OdQ6tU.js.map +1 -0
- package/lib/prism-typescript.min-qTySPvCh.js +34 -0
- package/lib/prism-typescript.min-qTySPvCh.js.map +1 -0
- package/lib/processors/removeParameters.js +28 -27
- package/lib/processors/removeParameters.js.map +1 -1
- package/lib/processors/removePaths.js +17 -17
- package/lib/processors/removePaths.js.map +1 -1
- package/lib/ui/Accordion.js +1 -1
- package/lib/ui/ActionButton.js +2 -2
- package/lib/ui/Alert.js +2 -2
- package/lib/ui/AlertDialog.js +1 -1
- package/lib/ui/Badge.js +2 -2
- package/lib/ui/Breadcrumb.js +1 -1
- package/lib/ui/Button.js +2 -2
- package/lib/ui/Callout.js +7 -7
- package/lib/ui/Callout.js.map +1 -1
- package/lib/ui/Card.js +1 -1
- package/lib/ui/Carousel.js +175 -175
- package/lib/ui/Carousel.js.map +1 -1
- package/lib/ui/Checkbox.js +1 -1
- package/lib/ui/Command.js +58 -58
- package/lib/ui/Command.js.map +1 -1
- package/lib/ui/Dialog.js +1 -1
- package/lib/ui/Drawer.js +2 -2
- package/lib/ui/DropdownMenu.js +1 -1
- package/lib/ui/Form.js +1 -1
- package/lib/ui/HoverCard.js +1 -1
- package/lib/ui/Input.js +1 -1
- package/lib/ui/Label.js +2 -2
- package/lib/ui/Pagination.js +1 -1
- package/lib/ui/Popover.js +1 -1
- package/lib/ui/Progress.js +1 -1
- package/lib/ui/RadioGroup.js +1 -1
- package/lib/ui/ScrollArea.js +1 -1
- package/lib/ui/Select.js +1 -1
- package/lib/ui/Skeleton.js +1 -1
- package/lib/ui/Slider.js +1 -1
- package/lib/ui/Switch.js +1 -1
- package/lib/ui/SyntaxHighlight.js +6 -4
- package/lib/ui/SyntaxHighlight.js.map +1 -1
- package/lib/ui/Tabs.js +1 -1
- package/lib/ui/Textarea.js +1 -1
- package/lib/ui/Toggle.js +2 -2
- package/lib/ui/ToggleGroup.js +1 -1
- package/lib/ui/Tooltip.js +1 -1
- package/lib/ui/util.js +1 -1
- package/lib/{useExposedProps-n1u49409.js → useExposedProps-DbIZXspi.js} +2 -2
- package/lib/{useExposedProps-n1u49409.js.map → useExposedProps-DbIZXspi.js.map} +1 -1
- package/lib/zudoku.auth-auth0.js +31 -28
- package/lib/zudoku.auth-auth0.js.map +1 -1
- package/lib/zudoku.auth-clerk.js +68 -62
- package/lib/zudoku.auth-clerk.js.map +1 -1
- package/lib/zudoku.auth-openid.js +483 -475
- package/lib/zudoku.auth-openid.js.map +1 -1
- package/lib/zudoku.components.js +7 -7
- package/lib/zudoku.hooks.js +2 -2
- package/lib/zudoku.plugin-api-catalog.js +45 -45
- package/lib/zudoku.plugin-api-catalog.js.map +1 -1
- package/lib/zudoku.plugin-api-keys.js +6 -6
- package/lib/zudoku.plugin-custom-pages.js +3 -3
- package/lib/zudoku.plugin-markdown.js +28 -25
- package/lib/zudoku.plugin-markdown.js.map +1 -1
- package/lib/zudoku.plugin-openapi.js +3 -3
- package/lib/zudoku.plugin-redirect.js +1 -1
- package/lib/zudoku.plugin-search-inkeep.js +27 -26
- package/lib/zudoku.plugin-search-inkeep.js.map +1 -1
- package/lib/zudoku.plugin-search-pagefind.js +110 -107
- package/lib/zudoku.plugin-search-pagefind.js.map +1 -1
- package/package.json +6 -16
- package/src/app/main.css +3 -53
- package/src/app/main.tsx +0 -7
- package/src/lib/components/Markdown.tsx +24 -29
- package/src/lib/core/ZudokuContext.ts +0 -4
- package/src/lib/errors/ErrorAlert.tsx +1 -1
- package/src/lib/plugins/openapi/CollapsibleCode.tsx +2 -5
- package/src/lib/plugins/openapi/Sidecar.tsx +1 -1
- package/src/lib/plugins/openapi/SidecarExamples.tsx +2 -2
- package/src/lib/ui/Callout.tsx +1 -1
- package/src/lib/ui/SyntaxHighlight.tsx +182 -18
- package/src/lib/util/MdxComponents.tsx +14 -27
- package/dist/lib/shiki.d.ts +0 -35
- package/dist/lib/shiki.js +0 -103
- package/dist/lib/shiki.js.map +0 -1
- package/dist/lib/ui/CodeBlock.d.ts +0 -16
- package/dist/lib/ui/CodeBlock.js +0 -18
- package/dist/lib/ui/CodeBlock.js.map +0 -1
- package/dist/vite/plugin-shiki-register.d.ts +0 -3
- package/dist/vite/plugin-shiki-register.js +0 -38
- package/dist/vite/plugin-shiki-register.js.map +0 -1
- package/lib/AuthenticationPlugin-EeQpQI3D.js +0 -55
- package/lib/Markdown-1l-DtDbF.js +0 -7688
- package/lib/Markdown-1l-DtDbF.js.map +0 -1
- package/lib/MdxPage-Dxbq6lFr.js +0 -84
- package/lib/RouteGuard-CGqivwrh.js +0 -733
- package/lib/Select-m-ITdvFa.js +0 -211
- package/lib/SlotletProvider-DhK1Fmm9.js +0 -254
- package/lib/SlotletProvider-DhK1Fmm9.js.map +0 -1
- package/lib/SyntaxHighlight-CJ6FoYvt.js +0 -9104
- package/lib/SyntaxHighlight-CJ6FoYvt.js.map +0 -1
- package/lib/hook-CyNmcNr8.js +0 -1443
- package/lib/index-BcMPFdRU.js +0 -4975
- package/lib/invariant-D3QcI9fa.js +0 -22
- package/lib/mutation-narTVsCe.js +0 -196
- package/lib/ui/CodeBlock.js +0 -83
- package/lib/ui/CodeBlock.js.map +0 -1
- package/src/lib/shiki.ts +0 -129
- package/src/lib/ui/CodeBlock.tsx +0 -102
- package/src/shiki/langs/abap.js +0 -1
- package/src/shiki/langs/actionscript-3.js +0 -1
- package/src/shiki/langs/ada.js +0 -1
- package/src/shiki/langs/angular-expression.js +0 -1
- package/src/shiki/langs/angular-html.js +0 -1
- package/src/shiki/langs/angular-inline-style.js +0 -1
- package/src/shiki/langs/angular-inline-template.js +0 -1
- package/src/shiki/langs/angular-let-declaration.js +0 -1
- package/src/shiki/langs/angular-template-blocks.js +0 -1
- package/src/shiki/langs/angular-template.js +0 -1
- package/src/shiki/langs/angular-ts.js +0 -1
- package/src/shiki/langs/apache.js +0 -1
- package/src/shiki/langs/apex.js +0 -1
- package/src/shiki/langs/apl.js +0 -1
- package/src/shiki/langs/applescript.js +0 -1
- package/src/shiki/langs/ara.js +0 -1
- package/src/shiki/langs/asciidoc.js +0 -1
- package/src/shiki/langs/asm.js +0 -1
- package/src/shiki/langs/astro.js +0 -1
- package/src/shiki/langs/awk.js +0 -1
- package/src/shiki/langs/ballerina.js +0 -1
- package/src/shiki/langs/bat.js +0 -1
- package/src/shiki/langs/beancount.js +0 -1
- package/src/shiki/langs/berry.js +0 -1
- package/src/shiki/langs/bibtex.js +0 -1
- package/src/shiki/langs/bicep.js +0 -1
- package/src/shiki/langs/blade.js +0 -1
- package/src/shiki/langs/bsl.js +0 -1
- package/src/shiki/langs/c.js +0 -1
- package/src/shiki/langs/cadence.js +0 -1
- package/src/shiki/langs/cairo.js +0 -1
- package/src/shiki/langs/clarity.js +0 -1
- package/src/shiki/langs/clojure.js +0 -1
- package/src/shiki/langs/cmake.js +0 -1
- package/src/shiki/langs/cobol.js +0 -1
- package/src/shiki/langs/codeowners.js +0 -1
- package/src/shiki/langs/codeql.js +0 -1
- package/src/shiki/langs/coffee.js +0 -1
- package/src/shiki/langs/common-lisp.js +0 -1
- package/src/shiki/langs/coq.js +0 -1
- package/src/shiki/langs/cpp-macro.js +0 -1
- package/src/shiki/langs/cpp.js +0 -1
- package/src/shiki/langs/crystal.js +0 -1
- package/src/shiki/langs/csharp.js +0 -1
- package/src/shiki/langs/css.js +0 -1
- package/src/shiki/langs/csv.js +0 -1
- package/src/shiki/langs/cue.js +0 -1
- package/src/shiki/langs/cypher.js +0 -1
- package/src/shiki/langs/d.js +0 -1
- package/src/shiki/langs/dart.js +0 -1
- package/src/shiki/langs/dax.js +0 -1
- package/src/shiki/langs/desktop.js +0 -1
- package/src/shiki/langs/diff.js +0 -1
- package/src/shiki/langs/docker.js +0 -1
- package/src/shiki/langs/dotenv.js +0 -1
- package/src/shiki/langs/dream-maker.js +0 -1
- package/src/shiki/langs/edge.js +0 -1
- package/src/shiki/langs/elixir.js +0 -1
- package/src/shiki/langs/elm.js +0 -1
- package/src/shiki/langs/emacs-lisp.js +0 -1
- package/src/shiki/langs/erb.js +0 -1
- package/src/shiki/langs/erlang.js +0 -1
- package/src/shiki/langs/es-tag-css.js +0 -1
- package/src/shiki/langs/es-tag-glsl.js +0 -1
- package/src/shiki/langs/es-tag-html.js +0 -1
- package/src/shiki/langs/es-tag-sql.js +0 -1
- package/src/shiki/langs/es-tag-xml.js +0 -1
- package/src/shiki/langs/fennel.js +0 -1
- package/src/shiki/langs/fish.js +0 -1
- package/src/shiki/langs/fluent.js +0 -1
- package/src/shiki/langs/fortran-fixed-form.js +0 -1
- package/src/shiki/langs/fortran-free-form.js +0 -1
- package/src/shiki/langs/fsharp.js +0 -1
- package/src/shiki/langs/gdresource.js +0 -1
- package/src/shiki/langs/gdscript.js +0 -1
- package/src/shiki/langs/gdshader.js +0 -1
- package/src/shiki/langs/genie.js +0 -1
- package/src/shiki/langs/gherkin.js +0 -1
- package/src/shiki/langs/git-commit.js +0 -1
- package/src/shiki/langs/git-rebase.js +0 -1
- package/src/shiki/langs/gleam.js +0 -1
- package/src/shiki/langs/glimmer-js.js +0 -1
- package/src/shiki/langs/glimmer-ts.js +0 -1
- package/src/shiki/langs/glsl.js +0 -1
- package/src/shiki/langs/gnuplot.js +0 -1
- package/src/shiki/langs/go.js +0 -1
- package/src/shiki/langs/graphql.js +0 -1
- package/src/shiki/langs/groovy.js +0 -1
- package/src/shiki/langs/hack.js +0 -1
- package/src/shiki/langs/haml.js +0 -1
- package/src/shiki/langs/handlebars.js +0 -1
- package/src/shiki/langs/haskell.js +0 -1
- package/src/shiki/langs/haxe.js +0 -1
- package/src/shiki/langs/hcl.js +0 -1
- package/src/shiki/langs/hjson.js +0 -1
- package/src/shiki/langs/hlsl.js +0 -1
- package/src/shiki/langs/html-derivative.js +0 -1
- package/src/shiki/langs/html.js +0 -1
- package/src/shiki/langs/http.js +0 -1
- package/src/shiki/langs/hxml.js +0 -1
- package/src/shiki/langs/hy.js +0 -1
- package/src/shiki/langs/imba.js +0 -1
- package/src/shiki/langs/ini.js +0 -1
- package/src/shiki/langs/java.js +0 -1
- package/src/shiki/langs/javascript.js +0 -1
- package/src/shiki/langs/jinja-html.js +0 -1
- package/src/shiki/langs/jinja.js +0 -1
- package/src/shiki/langs/jison.js +0 -1
- package/src/shiki/langs/json.js +0 -1
- package/src/shiki/langs/json5.js +0 -1
- package/src/shiki/langs/jsonc.js +0 -1
- package/src/shiki/langs/jsonl.js +0 -1
- package/src/shiki/langs/jsonnet.js +0 -1
- package/src/shiki/langs/jssm.js +0 -1
- package/src/shiki/langs/jsx.js +0 -1
- package/src/shiki/langs/julia.js +0 -1
- package/src/shiki/langs/kotlin.js +0 -1
- package/src/shiki/langs/kusto.js +0 -1
- package/src/shiki/langs/latex.js +0 -1
- package/src/shiki/langs/lean.js +0 -1
- package/src/shiki/langs/less.js +0 -1
- package/src/shiki/langs/liquid.js +0 -1
- package/src/shiki/langs/llvm.js +0 -1
- package/src/shiki/langs/log.js +0 -1
- package/src/shiki/langs/logo.js +0 -1
- package/src/shiki/langs/lua.js +0 -1
- package/src/shiki/langs/luau.js +0 -1
- package/src/shiki/langs/make.js +0 -1
- package/src/shiki/langs/markdown-vue.js +0 -1
- package/src/shiki/langs/markdown.js +0 -1
- package/src/shiki/langs/marko.js +0 -1
- package/src/shiki/langs/matlab.js +0 -1
- package/src/shiki/langs/mdc.js +0 -1
- package/src/shiki/langs/mdx.js +0 -1
- package/src/shiki/langs/mermaid.js +0 -1
- package/src/shiki/langs/mipsasm.js +0 -1
- package/src/shiki/langs/mojo.js +0 -1
- package/src/shiki/langs/move.js +0 -1
- package/src/shiki/langs/narrat.js +0 -1
- package/src/shiki/langs/nextflow.js +0 -1
- package/src/shiki/langs/nginx.js +0 -1
- package/src/shiki/langs/nim.js +0 -1
- package/src/shiki/langs/nix.js +0 -1
- package/src/shiki/langs/nushell.js +0 -1
- package/src/shiki/langs/objective-c.js +0 -1
- package/src/shiki/langs/objective-cpp.js +0 -1
- package/src/shiki/langs/ocaml.js +0 -1
- package/src/shiki/langs/pascal.js +0 -1
- package/src/shiki/langs/perl.js +0 -1
- package/src/shiki/langs/php.js +0 -1
- package/src/shiki/langs/plsql.js +0 -1
- package/src/shiki/langs/po.js +0 -1
- package/src/shiki/langs/polar.js +0 -1
- package/src/shiki/langs/postcss.js +0 -1
- package/src/shiki/langs/powerquery.js +0 -1
- package/src/shiki/langs/powershell.js +0 -1
- package/src/shiki/langs/prisma.js +0 -1
- package/src/shiki/langs/prolog.js +0 -1
- package/src/shiki/langs/proto.js +0 -1
- package/src/shiki/langs/pug.js +0 -1
- package/src/shiki/langs/puppet.js +0 -1
- package/src/shiki/langs/purescript.js +0 -1
- package/src/shiki/langs/python.js +0 -1
- package/src/shiki/langs/qml.js +0 -1
- package/src/shiki/langs/qmldir.js +0 -1
- package/src/shiki/langs/qss.js +0 -1
- package/src/shiki/langs/r.js +0 -1
- package/src/shiki/langs/racket.js +0 -1
- package/src/shiki/langs/raku.js +0 -1
- package/src/shiki/langs/razor.js +0 -1
- package/src/shiki/langs/reg.js +0 -1
- package/src/shiki/langs/regexp.js +0 -1
- package/src/shiki/langs/rel.js +0 -1
- package/src/shiki/langs/riscv.js +0 -1
- package/src/shiki/langs/rst.js +0 -1
- package/src/shiki/langs/ruby.js +0 -1
- package/src/shiki/langs/rust.js +0 -1
- package/src/shiki/langs/sas.js +0 -1
- package/src/shiki/langs/sass.js +0 -1
- package/src/shiki/langs/scala.js +0 -1
- package/src/shiki/langs/scheme.js +0 -1
- package/src/shiki/langs/scss.js +0 -1
- package/src/shiki/langs/sdbl.js +0 -1
- package/src/shiki/langs/shaderlab.js +0 -1
- package/src/shiki/langs/shellscript.js +0 -1
- package/src/shiki/langs/shellsession.js +0 -1
- package/src/shiki/langs/smalltalk.js +0 -1
- package/src/shiki/langs/solidity.js +0 -1
- package/src/shiki/langs/soy.js +0 -1
- package/src/shiki/langs/sparql.js +0 -1
- package/src/shiki/langs/splunk.js +0 -1
- package/src/shiki/langs/sql.js +0 -1
- package/src/shiki/langs/ssh-config.js +0 -1
- package/src/shiki/langs/stata.js +0 -1
- package/src/shiki/langs/stylus.js +0 -1
- package/src/shiki/langs/svelte.js +0 -1
- package/src/shiki/langs/swift.js +0 -1
- package/src/shiki/langs/system-verilog.js +0 -1
- package/src/shiki/langs/systemd.js +0 -1
- package/src/shiki/langs/talonscript.js +0 -1
- package/src/shiki/langs/tasl.js +0 -1
- package/src/shiki/langs/tcl.js +0 -1
- package/src/shiki/langs/templ.js +0 -1
- package/src/shiki/langs/terraform.js +0 -1
- package/src/shiki/langs/tex.js +0 -1
- package/src/shiki/langs/toml.js +0 -1
- package/src/shiki/langs/ts-tags.js +0 -1
- package/src/shiki/langs/tsv.js +0 -1
- package/src/shiki/langs/tsx.js +0 -1
- package/src/shiki/langs/turtle.js +0 -1
- package/src/shiki/langs/twig.js +0 -1
- package/src/shiki/langs/typescript.js +0 -1
- package/src/shiki/langs/typespec.js +0 -1
- package/src/shiki/langs/typst.js +0 -1
- package/src/shiki/langs/v.js +0 -1
- package/src/shiki/langs/vala.js +0 -1
- package/src/shiki/langs/vb.js +0 -1
- package/src/shiki/langs/verilog.js +0 -1
- package/src/shiki/langs/vhdl.js +0 -1
- package/src/shiki/langs/viml.js +0 -1
- package/src/shiki/langs/vue-directives.js +0 -1
- package/src/shiki/langs/vue-html.js +0 -1
- package/src/shiki/langs/vue-interpolations.js +0 -1
- package/src/shiki/langs/vue-sfc-style-variable-injection.js +0 -1
- package/src/shiki/langs/vue.js +0 -1
- package/src/shiki/langs/vyper.js +0 -1
- package/src/shiki/langs/wasm.js +0 -1
- package/src/shiki/langs/wenyan.js +0 -1
- package/src/shiki/langs/wgsl.js +0 -1
- package/src/shiki/langs/wikitext.js +0 -1
- package/src/shiki/langs/wit.js +0 -1
- package/src/shiki/langs/wolfram.js +0 -1
- package/src/shiki/langs/xml.js +0 -1
- package/src/shiki/langs/xsl.js +0 -1
- package/src/shiki/langs/yaml.js +0 -1
- package/src/shiki/langs/zenscript.js +0 -1
- package/src/shiki/langs/zig.js +0 -1
- package/src/shiki/themes/andromeeda.js +0 -1
- package/src/shiki/themes/aurora-x.js +0 -1
- package/src/shiki/themes/ayu-dark.js +0 -1
- package/src/shiki/themes/catppuccin-frappe.js +0 -1
- package/src/shiki/themes/catppuccin-latte.js +0 -1
- package/src/shiki/themes/catppuccin-macchiato.js +0 -1
- package/src/shiki/themes/catppuccin-mocha.js +0 -1
- package/src/shiki/themes/dark-plus.js +0 -1
- package/src/shiki/themes/dracula-soft.js +0 -1
- package/src/shiki/themes/dracula.js +0 -1
- package/src/shiki/themes/everforest-dark.js +0 -1
- package/src/shiki/themes/everforest-light.js +0 -1
- package/src/shiki/themes/github-dark-default.js +0 -1
- package/src/shiki/themes/github-dark-dimmed.js +0 -1
- package/src/shiki/themes/github-dark-high-contrast.js +0 -1
- package/src/shiki/themes/github-dark.js +0 -1
- package/src/shiki/themes/github-light-default.js +0 -1
- package/src/shiki/themes/github-light-high-contrast.js +0 -1
- package/src/shiki/themes/github-light.js +0 -1
- package/src/shiki/themes/gruvbox-dark-hard.js +0 -1
- package/src/shiki/themes/gruvbox-dark-medium.js +0 -1
- package/src/shiki/themes/gruvbox-dark-soft.js +0 -1
- package/src/shiki/themes/gruvbox-light-hard.js +0 -1
- package/src/shiki/themes/gruvbox-light-medium.js +0 -1
- package/src/shiki/themes/gruvbox-light-soft.js +0 -1
- package/src/shiki/themes/houston.js +0 -1
- package/src/shiki/themes/kanagawa-dragon.js +0 -1
- package/src/shiki/themes/kanagawa-lotus.js +0 -1
- package/src/shiki/themes/kanagawa-wave.js +0 -1
- package/src/shiki/themes/laserwave.js +0 -1
- package/src/shiki/themes/light-plus.js +0 -1
- package/src/shiki/themes/material-theme-darker.js +0 -1
- package/src/shiki/themes/material-theme-lighter.js +0 -1
- package/src/shiki/themes/material-theme-ocean.js +0 -1
- package/src/shiki/themes/material-theme-palenight.js +0 -1
- package/src/shiki/themes/material-theme.js +0 -1
- package/src/shiki/themes/min-dark.js +0 -1
- package/src/shiki/themes/min-light.js +0 -1
- package/src/shiki/themes/monokai.js +0 -1
- package/src/shiki/themes/night-owl.js +0 -1
- package/src/shiki/themes/nord.js +0 -1
- package/src/shiki/themes/one-dark-pro.js +0 -1
- package/src/shiki/themes/one-light.js +0 -1
- package/src/shiki/themes/plastic.js +0 -1
- package/src/shiki/themes/poimandres.js +0 -1
- package/src/shiki/themes/red.js +0 -1
- package/src/shiki/themes/rose-pine-dawn.js +0 -1
- package/src/shiki/themes/rose-pine-moon.js +0 -1
- package/src/shiki/themes/rose-pine.js +0 -1
- package/src/shiki/themes/slack-dark.js +0 -1
- package/src/shiki/themes/slack-ochin.js +0 -1
- package/src/shiki/themes/snazzy-light.js +0 -1
- package/src/shiki/themes/solarized-dark.js +0 -1
- package/src/shiki/themes/solarized-light.js +0 -1
- package/src/shiki/themes/synthwave-84.js +0 -1
- package/src/shiki/themes/tokyo-night.js +0 -1
- package/src/shiki/themes/vesper.js +0 -1
- package/src/shiki/themes/vitesse-black.js +0 -1
- package/src/shiki/themes/vitesse-dark.js +0 -1
- package/src/shiki/themes/vitesse-light.js +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
const dt = Symbol.for("yaml.alias"), lt = Symbol.for("yaml.document"), G = Symbol.for("yaml.map"), qt = Symbol.for("yaml.pair"), R = Symbol.for("yaml.scalar"), he = Symbol.for("yaml.seq"),
|
|
1
|
+
const dt = Symbol.for("yaml.alias"), lt = Symbol.for("yaml.document"), G = Symbol.for("yaml.map"), qt = Symbol.for("yaml.pair"), R = Symbol.for("yaml.scalar"), he = Symbol.for("yaml.seq"), j = Symbol.for("yaml.node.type"), x = (s) => !!s && typeof s == "object" && s[j] === dt, ee = (s) => !!s && typeof s == "object" && s[j] === lt, de = (s) => !!s && typeof s == "object" && s[j] === G, T = (s) => !!s && typeof s == "object" && s[j] === qt, E = (s) => !!s && typeof s == "object" && s[j] === R, pe = (s) => !!s && typeof s == "object" && s[j] === he;
|
|
2
2
|
function L(s) {
|
|
3
3
|
if (s && typeof s == "object")
|
|
4
|
-
switch (s[
|
|
4
|
+
switch (s[j]) {
|
|
5
5
|
case G:
|
|
6
6
|
case he:
|
|
7
7
|
return !0;
|
|
@@ -10,7 +10,7 @@ function L(s) {
|
|
|
10
10
|
}
|
|
11
11
|
function $(s) {
|
|
12
12
|
if (s && typeof s == "object")
|
|
13
|
-
switch (s[
|
|
13
|
+
switch (s[j]) {
|
|
14
14
|
case dt:
|
|
15
15
|
case G:
|
|
16
16
|
case R:
|
|
@@ -112,18 +112,19 @@ function Rt(s) {
|
|
|
112
112
|
}, s) : s;
|
|
113
113
|
}
|
|
114
114
|
function Ut(s, e, t, n) {
|
|
115
|
+
var i, r, o, l, a;
|
|
115
116
|
if (typeof t == "function")
|
|
116
117
|
return t(s, e, n);
|
|
117
118
|
if (de(e))
|
|
118
|
-
return t.Map
|
|
119
|
+
return (i = t.Map) == null ? void 0 : i.call(t, s, e, n);
|
|
119
120
|
if (pe(e))
|
|
120
|
-
return t.Seq
|
|
121
|
+
return (r = t.Seq) == null ? void 0 : r.call(t, s, e, n);
|
|
121
122
|
if (T(e))
|
|
122
|
-
return t.Pair
|
|
123
|
+
return (o = t.Pair) == null ? void 0 : o.call(t, s, e, n);
|
|
123
124
|
if (E(e))
|
|
124
|
-
return t.Scalar
|
|
125
|
-
if (
|
|
126
|
-
return t.Alias
|
|
125
|
+
return (l = t.Scalar) == null ? void 0 : l.call(t, s, e, n);
|
|
126
|
+
if (x(e))
|
|
127
|
+
return (a = t.Alias) == null ? void 0 : a.call(t, s, e, n);
|
|
127
128
|
}
|
|
128
129
|
function Vt(s, e, t) {
|
|
129
130
|
const n = e[e.length - 1];
|
|
@@ -134,7 +135,7 @@ function Vt(s, e, t) {
|
|
|
134
135
|
else if (ee(n))
|
|
135
136
|
n.contents = t;
|
|
136
137
|
else {
|
|
137
|
-
const i =
|
|
138
|
+
const i = x(n) ? "alias" : "scalar";
|
|
138
139
|
throw new Error(`Cannot replace node with ${i} parent`);
|
|
139
140
|
}
|
|
140
141
|
}
|
|
@@ -330,9 +331,9 @@ function oe(s, e, t, n) {
|
|
|
330
331
|
}
|
|
331
332
|
return s.call(e, t, n);
|
|
332
333
|
}
|
|
333
|
-
function
|
|
334
|
+
function P(s, e, t) {
|
|
334
335
|
if (Array.isArray(s))
|
|
335
|
-
return s.map((n, i) =>
|
|
336
|
+
return s.map((n, i) => P(n, String(i), t));
|
|
336
337
|
if (s && typeof s.toJSON == "function") {
|
|
337
338
|
if (!t || !vs(s))
|
|
338
339
|
return s.toJSON(e, t);
|
|
@@ -343,11 +344,11 @@ function j(s, e, t) {
|
|
|
343
344
|
const i = s.toJSON(e, t);
|
|
344
345
|
return t.onCreate && t.onCreate(i), i;
|
|
345
346
|
}
|
|
346
|
-
return typeof s == "bigint" && !t
|
|
347
|
+
return typeof s == "bigint" && !(t != null && t.keep) ? Number(s) : s;
|
|
347
348
|
}
|
|
348
349
|
class pt {
|
|
349
350
|
constructor(e) {
|
|
350
|
-
Object.defineProperty(this,
|
|
351
|
+
Object.defineProperty(this, j, { value: e });
|
|
351
352
|
}
|
|
352
353
|
/** Create a copy of this node. */
|
|
353
354
|
clone() {
|
|
@@ -365,7 +366,7 @@ class pt {
|
|
|
365
366
|
mapAsMap: t === !0,
|
|
366
367
|
mapKeyWarned: !1,
|
|
367
368
|
maxAliasCount: typeof n == "number" ? n : 100
|
|
368
|
-
}, l =
|
|
369
|
+
}, l = P(this, "", o);
|
|
369
370
|
if (typeof i == "function")
|
|
370
371
|
for (const { count: a, res: c } of o.anchors.values())
|
|
371
372
|
i(c, a);
|
|
@@ -403,7 +404,7 @@ class Re extends pt {
|
|
|
403
404
|
throw new ReferenceError(a);
|
|
404
405
|
}
|
|
405
406
|
let l = n.get(o);
|
|
406
|
-
if (l || (
|
|
407
|
+
if (l || (P(o, null, t), l = n.get(o)), !l || l.res === void 0) {
|
|
407
408
|
const a = "This should not happen: Alias anchor was not resolved?";
|
|
408
409
|
throw new ReferenceError(a);
|
|
409
410
|
}
|
|
@@ -427,7 +428,7 @@ class Re extends pt {
|
|
|
427
428
|
}
|
|
428
429
|
}
|
|
429
430
|
function ve(s, e, t) {
|
|
430
|
-
if (
|
|
431
|
+
if (x(e)) {
|
|
431
432
|
const n = e.resolve(s), i = t && n && t.get(n);
|
|
432
433
|
return i ? i.count * i.aliasCount : 0;
|
|
433
434
|
} else if (L(e)) {
|
|
@@ -444,38 +445,42 @@ function ve(s, e, t) {
|
|
|
444
445
|
return 1;
|
|
445
446
|
}
|
|
446
447
|
const Qt = (s) => !s || typeof s != "function" && typeof s != "object";
|
|
447
|
-
class
|
|
448
|
+
class A extends pt {
|
|
448
449
|
constructor(e) {
|
|
449
450
|
super(R), this.value = e;
|
|
450
451
|
}
|
|
451
452
|
toJSON(e, t) {
|
|
452
|
-
return t
|
|
453
|
+
return t != null && t.keep ? this.value : P(this.value, e, t);
|
|
453
454
|
}
|
|
454
455
|
toString() {
|
|
455
456
|
return String(this.value);
|
|
456
457
|
}
|
|
457
458
|
}
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
const
|
|
464
|
-
function
|
|
459
|
+
A.BLOCK_FOLDED = "BLOCK_FOLDED";
|
|
460
|
+
A.BLOCK_LITERAL = "BLOCK_LITERAL";
|
|
461
|
+
A.PLAIN = "PLAIN";
|
|
462
|
+
A.QUOTE_DOUBLE = "QUOTE_DOUBLE";
|
|
463
|
+
A.QUOTE_SINGLE = "QUOTE_SINGLE";
|
|
464
|
+
const Ps = "tag:yaml.org,2002:";
|
|
465
|
+
function js(s, e, t) {
|
|
465
466
|
if (e) {
|
|
466
467
|
const n = t.filter((r) => r.tag === e), i = n.find((r) => !r.format) ?? n[0];
|
|
467
468
|
if (!i)
|
|
468
469
|
throw new Error(`Tag ${e} not found`);
|
|
469
470
|
return i;
|
|
470
471
|
}
|
|
471
|
-
return t.find((n) =>
|
|
472
|
+
return t.find((n) => {
|
|
473
|
+
var i;
|
|
474
|
+
return ((i = n.identify) == null ? void 0 : i.call(n, s)) && !n.format;
|
|
475
|
+
});
|
|
472
476
|
}
|
|
473
477
|
function ke(s, e, t) {
|
|
478
|
+
var f, d, h;
|
|
474
479
|
if (ee(s) && (s = s.contents), $(s))
|
|
475
480
|
return s;
|
|
476
481
|
if (T(s)) {
|
|
477
|
-
const f = t.schema[G].createNode
|
|
478
|
-
return
|
|
482
|
+
const y = (d = (f = t.schema[G]).createNode) == null ? void 0 : d.call(f, t.schema, null, t);
|
|
483
|
+
return y.items.push(s), y;
|
|
479
484
|
}
|
|
480
485
|
(s instanceof String || s instanceof Number || s instanceof Boolean || typeof BigInt < "u" && s instanceof BigInt) && (s = s.valueOf());
|
|
481
486
|
const { aliasDuplicateObjects: n, onAnchor: i, onTagObj: r, schema: o, sourceObjects: l } = t;
|
|
@@ -485,20 +490,20 @@ function ke(s, e, t) {
|
|
|
485
490
|
return a.anchor || (a.anchor = i(s)), new Re(a.anchor);
|
|
486
491
|
a = { anchor: null, node: null }, l.set(s, a);
|
|
487
492
|
}
|
|
488
|
-
e
|
|
489
|
-
let c =
|
|
493
|
+
e != null && e.startsWith("!!") && (e = Ps + e.slice(2));
|
|
494
|
+
let c = js(s, e, o.tags);
|
|
490
495
|
if (!c) {
|
|
491
496
|
if (s && typeof s.toJSON == "function" && (s = s.toJSON()), !s || typeof s != "object") {
|
|
492
|
-
const
|
|
493
|
-
return a && (a.node =
|
|
497
|
+
const y = new A(s);
|
|
498
|
+
return a && (a.node = y), y;
|
|
494
499
|
}
|
|
495
500
|
c = s instanceof Map ? o[G] : Symbol.iterator in Object(s) ? o[he] : o[G];
|
|
496
501
|
}
|
|
497
502
|
r && (r(c), delete t.onTagObj);
|
|
498
|
-
const
|
|
499
|
-
return e ?
|
|
503
|
+
const p = c != null && c.createNode ? c.createNode(t.schema, s, t) : typeof ((h = c == null ? void 0 : c.nodeClass) == null ? void 0 : h.from) == "function" ? c.nodeClass.from(t.schema, s, t) : new A(s);
|
|
504
|
+
return e ? p.tag = e : c.default || (p.tag = c.tag), a && (a.node = p), p;
|
|
500
505
|
}
|
|
501
|
-
function
|
|
506
|
+
function Pe(s, e, t) {
|
|
502
507
|
let n = t;
|
|
503
508
|
for (let i = e.length - 1; i >= 0; --i) {
|
|
504
509
|
const r = e[i];
|
|
@@ -550,7 +555,7 @@ class Wt extends pt {
|
|
|
550
555
|
if (L(r))
|
|
551
556
|
r.addIn(i, t);
|
|
552
557
|
else if (r === void 0 && this.schema)
|
|
553
|
-
this.set(n,
|
|
558
|
+
this.set(n, Pe(this.schema, i, t));
|
|
554
559
|
else
|
|
555
560
|
throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`);
|
|
556
561
|
}
|
|
@@ -608,7 +613,7 @@ class Wt extends pt {
|
|
|
608
613
|
if (L(r))
|
|
609
614
|
r.setIn(i, t);
|
|
610
615
|
else if (r === void 0 && this.schema)
|
|
611
|
-
this.set(n,
|
|
616
|
+
this.set(n, Pe(this.schema, i, t));
|
|
612
617
|
else
|
|
613
618
|
throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`);
|
|
614
619
|
}
|
|
@@ -629,64 +634,64 @@ function Ue(s, e, t = "flow", { indentAtStart: n, lineWidth: i = 80, minContentW
|
|
|
629
634
|
const a = Math.max(1 + r, 1 + i - e.length);
|
|
630
635
|
if (s.length <= a)
|
|
631
636
|
return s;
|
|
632
|
-
const c = [],
|
|
637
|
+
const c = [], p = {};
|
|
633
638
|
let f = i - e.length;
|
|
634
639
|
typeof n == "number" && (n > i - Math.max(2, r) ? c.push(0) : f = i - n);
|
|
635
|
-
let
|
|
636
|
-
t === at && (
|
|
637
|
-
for (let
|
|
638
|
-
if (t === Be &&
|
|
639
|
-
switch (
|
|
640
|
+
let d, h, y = !1, u = -1, m = -1, b = -1;
|
|
641
|
+
t === at && (u = $t(s, u, e.length), u !== -1 && (f = u + a));
|
|
642
|
+
for (let N; N = s[u += 1]; ) {
|
|
643
|
+
if (t === Be && N === "\\") {
|
|
644
|
+
switch (m = u, s[u + 1]) {
|
|
640
645
|
case "x":
|
|
641
|
-
|
|
646
|
+
u += 3;
|
|
642
647
|
break;
|
|
643
648
|
case "u":
|
|
644
|
-
|
|
649
|
+
u += 5;
|
|
645
650
|
break;
|
|
646
651
|
case "U":
|
|
647
|
-
|
|
652
|
+
u += 9;
|
|
648
653
|
break;
|
|
649
654
|
default:
|
|
650
|
-
|
|
655
|
+
u += 1;
|
|
651
656
|
}
|
|
652
|
-
b =
|
|
657
|
+
b = u;
|
|
653
658
|
}
|
|
654
|
-
if (
|
|
659
|
+
if (N === `
|
|
655
660
|
`)
|
|
656
|
-
t === at && (
|
|
661
|
+
t === at && (u = $t(s, u, e.length)), f = u + e.length + a, d = void 0;
|
|
657
662
|
else {
|
|
658
|
-
if (
|
|
659
|
-
` &&
|
|
660
|
-
const
|
|
661
|
-
|
|
662
|
-
` &&
|
|
663
|
+
if (N === " " && h && h !== " " && h !== `
|
|
664
|
+
` && h !== " ") {
|
|
665
|
+
const w = s[u + 1];
|
|
666
|
+
w && w !== " " && w !== `
|
|
667
|
+
` && w !== " " && (d = u);
|
|
663
668
|
}
|
|
664
|
-
if (
|
|
665
|
-
if (
|
|
666
|
-
c.push(
|
|
669
|
+
if (u >= f)
|
|
670
|
+
if (d)
|
|
671
|
+
c.push(d), f = d + a, d = void 0;
|
|
667
672
|
else if (t === Be) {
|
|
668
|
-
for (;
|
|
669
|
-
|
|
670
|
-
const
|
|
671
|
-
if (
|
|
673
|
+
for (; h === " " || h === " "; )
|
|
674
|
+
h = N, N = s[u += 1], y = !0;
|
|
675
|
+
const w = u > b + 1 ? u - 2 : m - 1;
|
|
676
|
+
if (p[w])
|
|
672
677
|
return s;
|
|
673
|
-
c.push(
|
|
678
|
+
c.push(w), p[w] = !0, f = w + a, d = void 0;
|
|
674
679
|
} else
|
|
675
680
|
y = !0;
|
|
676
681
|
}
|
|
677
|
-
|
|
682
|
+
h = N;
|
|
678
683
|
}
|
|
679
684
|
if (y && l && l(), c.length === 0)
|
|
680
685
|
return s;
|
|
681
686
|
o && o();
|
|
682
|
-
let
|
|
683
|
-
for (let
|
|
684
|
-
const
|
|
685
|
-
|
|
686
|
-
${e}${s.slice(0,
|
|
687
|
-
${e}${s.slice(
|
|
687
|
+
let S = s.slice(0, c[0]);
|
|
688
|
+
for (let N = 0; N < c.length; ++N) {
|
|
689
|
+
const w = c[N], k = c[N + 1] || s.length;
|
|
690
|
+
w === 0 ? S = `
|
|
691
|
+
${e}${s.slice(0, k)}` : (t === Be && p[w] && (S += `${s[w]}\\`), S += `
|
|
692
|
+
${e}${s.slice(w + 1, k)}`);
|
|
688
693
|
}
|
|
689
|
-
return
|
|
694
|
+
return S;
|
|
690
695
|
}
|
|
691
696
|
function $t(s, e, t) {
|
|
692
697
|
let n = e, i = e + 1, r = s[i];
|
|
@@ -735,8 +740,8 @@ function Se(s, e) {
|
|
|
735
740
|
case "u":
|
|
736
741
|
{
|
|
737
742
|
o += t.slice(l, a);
|
|
738
|
-
const
|
|
739
|
-
switch (
|
|
743
|
+
const p = t.substr(a + 2, 4);
|
|
744
|
+
switch (p) {
|
|
740
745
|
case "0000":
|
|
741
746
|
o += "\\0";
|
|
742
747
|
break;
|
|
@@ -762,7 +767,7 @@ function Se(s, e) {
|
|
|
762
767
|
o += "\\P";
|
|
763
768
|
break;
|
|
764
769
|
default:
|
|
765
|
-
|
|
770
|
+
p.substr(0, 2) === "00" ? o += "\\x" + p.substr(2) : o += t.substr(a, 6);
|
|
766
771
|
}
|
|
767
772
|
a += 5, l = a + 1;
|
|
768
773
|
}
|
|
@@ -816,62 +821,62 @@ function Me({ comment: s, type: e, value: t }, n, i, r) {
|
|
|
816
821
|
const { blockQuote: o, commentString: l, lineWidth: a } = n.options;
|
|
817
822
|
if (!o || /\n[\t ]+$/.test(t) || /^\s*$/.test(t))
|
|
818
823
|
return le(t, n);
|
|
819
|
-
const c = n.indent || (n.forceBlockIndent || Je(t) ? " " : ""),
|
|
824
|
+
const c = n.indent || (n.forceBlockIndent || Je(t) ? " " : ""), p = o === "literal" ? !0 : o === "folded" || e === A.BLOCK_FOLDED ? !1 : e === A.BLOCK_LITERAL ? !0 : !qs(t, a, c.length);
|
|
820
825
|
if (!t)
|
|
821
|
-
return
|
|
826
|
+
return p ? `|
|
|
822
827
|
` : `>
|
|
823
828
|
`;
|
|
824
|
-
let f,
|
|
825
|
-
for (
|
|
826
|
-
const
|
|
827
|
-
if (
|
|
828
|
-
` &&
|
|
829
|
+
let f, d;
|
|
830
|
+
for (d = t.length; d > 0; --d) {
|
|
831
|
+
const k = t[d - 1];
|
|
832
|
+
if (k !== `
|
|
833
|
+
` && k !== " " && k !== " ")
|
|
829
834
|
break;
|
|
830
835
|
}
|
|
831
|
-
let
|
|
832
|
-
const y =
|
|
836
|
+
let h = t.substring(d);
|
|
837
|
+
const y = h.indexOf(`
|
|
833
838
|
`);
|
|
834
|
-
y === -1 ? f = "-" : t ===
|
|
835
|
-
` && (
|
|
836
|
-
let
|
|
837
|
-
for (
|
|
838
|
-
const
|
|
839
|
-
if (
|
|
840
|
-
|
|
841
|
-
else if (
|
|
839
|
+
y === -1 ? f = "-" : t === h || y !== h.length - 1 ? (f = "+", r && r()) : f = "", h && (t = t.slice(0, -h.length), h[h.length - 1] === `
|
|
840
|
+
` && (h = h.slice(0, -1)), h = h.replace(ft, `$&${c}`));
|
|
841
|
+
let u = !1, m, b = -1;
|
|
842
|
+
for (m = 0; m < t.length; ++m) {
|
|
843
|
+
const k = t[m];
|
|
844
|
+
if (k === " ")
|
|
845
|
+
u = !0;
|
|
846
|
+
else if (k === `
|
|
842
847
|
`)
|
|
843
|
-
b =
|
|
848
|
+
b = m;
|
|
844
849
|
else
|
|
845
850
|
break;
|
|
846
851
|
}
|
|
847
|
-
let
|
|
848
|
-
|
|
849
|
-
let
|
|
850
|
-
if (s && (
|
|
851
|
-
const
|
|
852
|
+
let S = t.substring(0, b < m ? b + 1 : m);
|
|
853
|
+
S && (t = t.substring(S.length), S = S.replace(/\n+/g, `$&${c}`));
|
|
854
|
+
let w = (u ? c ? "2" : "1" : "") + f;
|
|
855
|
+
if (s && (w += " " + l(s.replace(/ ?[\r\n]+/g, " ")), i && i()), !p) {
|
|
856
|
+
const k = t.replace(/\n+/g, `
|
|
852
857
|
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g, "$1$2").replace(/\n+/g, `$&${c}`);
|
|
853
|
-
let
|
|
858
|
+
let O = !1;
|
|
854
859
|
const I = Ve(n, !0);
|
|
855
|
-
o !== "folded" && e !==
|
|
856
|
-
|
|
860
|
+
o !== "folded" && e !== A.BLOCK_FOLDED && (I.onOverflow = () => {
|
|
861
|
+
O = !0;
|
|
857
862
|
});
|
|
858
|
-
const g = Ue(`${
|
|
859
|
-
if (!
|
|
860
|
-
return `>${
|
|
863
|
+
const g = Ue(`${S}${k}${h}`, c, at, I);
|
|
864
|
+
if (!O)
|
|
865
|
+
return `>${w}
|
|
861
866
|
${c}${g}`;
|
|
862
867
|
}
|
|
863
|
-
return t = t.replace(/\n+/g, `$&${c}`), `|${
|
|
864
|
-
${c}${
|
|
868
|
+
return t = t.replace(/\n+/g, `$&${c}`), `|${w}
|
|
869
|
+
${c}${S}${t}${h}`;
|
|
865
870
|
}
|
|
866
871
|
function Fs(s, e, t, n) {
|
|
867
|
-
const { type: i, value: r } = s, { actualString: o, implicitKey: l, indent: a, indentStep: c, inFlow:
|
|
872
|
+
const { type: i, value: r } = s, { actualString: o, implicitKey: l, indent: a, indentStep: c, inFlow: p } = e;
|
|
868
873
|
if (l && r.includes(`
|
|
869
|
-
`) ||
|
|
874
|
+
`) || p && /[[\]{},]/.test(r))
|
|
870
875
|
return le(r, e);
|
|
871
876
|
if (!r || /^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(r))
|
|
872
|
-
return l ||
|
|
877
|
+
return l || p || !r.includes(`
|
|
873
878
|
`) ? le(r, e) : Me(s, e, t, n);
|
|
874
|
-
if (!l && !
|
|
879
|
+
if (!l && !p && i !== A.PLAIN && r.includes(`
|
|
875
880
|
`))
|
|
876
881
|
return Me(s, e, t, n);
|
|
877
882
|
if (Je(r)) {
|
|
@@ -883,8 +888,11 @@ function Fs(s, e, t, n) {
|
|
|
883
888
|
const f = r.replace(/\n+/g, `$&
|
|
884
889
|
${a}`);
|
|
885
890
|
if (o) {
|
|
886
|
-
const
|
|
887
|
-
|
|
891
|
+
const d = (u) => {
|
|
892
|
+
var m;
|
|
893
|
+
return u.default && u.tag !== "tag:yaml.org,2002:str" && ((m = u.test) == null ? void 0 : m.test(f));
|
|
894
|
+
}, { compat: h, tags: y } = e.doc.schema;
|
|
895
|
+
if (y.some(d) || h != null && h.some(d))
|
|
888
896
|
return le(r, e);
|
|
889
897
|
}
|
|
890
898
|
return l ? f : Ue(f, a, Ht, Ve(e, !1));
|
|
@@ -892,17 +900,17 @@ ${a}`);
|
|
|
892
900
|
function Ae(s, e, t, n) {
|
|
893
901
|
const { implicitKey: i, inFlow: r } = e, o = typeof s.value == "string" ? s : Object.assign({}, s, { value: String(s.value) });
|
|
894
902
|
let { type: l } = s;
|
|
895
|
-
l !==
|
|
896
|
-
const a = (
|
|
897
|
-
switch (
|
|
898
|
-
case
|
|
899
|
-
case
|
|
903
|
+
l !== A.QUOTE_DOUBLE && /[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value) && (l = A.QUOTE_DOUBLE);
|
|
904
|
+
const a = (p) => {
|
|
905
|
+
switch (p) {
|
|
906
|
+
case A.BLOCK_FOLDED:
|
|
907
|
+
case A.BLOCK_LITERAL:
|
|
900
908
|
return i || r ? le(o.value, e) : Me(o, e, t, n);
|
|
901
|
-
case
|
|
909
|
+
case A.QUOTE_DOUBLE:
|
|
902
910
|
return Se(o.value, e);
|
|
903
|
-
case
|
|
911
|
+
case A.QUOTE_SINGLE:
|
|
904
912
|
return ct(o.value, e);
|
|
905
|
-
case
|
|
913
|
+
case A.PLAIN:
|
|
906
914
|
return Fs(o, e, t, n);
|
|
907
915
|
default:
|
|
908
916
|
return null;
|
|
@@ -910,9 +918,9 @@ function Ae(s, e, t, n) {
|
|
|
910
918
|
};
|
|
911
919
|
let c = a(l);
|
|
912
920
|
if (c === null) {
|
|
913
|
-
const { defaultKeyType:
|
|
914
|
-
if (c = a(
|
|
915
|
-
throw new Error(`Unsupported default string type ${
|
|
921
|
+
const { defaultKeyType: p, defaultStringType: f } = e.options, d = i && p || f;
|
|
922
|
+
if (c = a(d), c === null)
|
|
923
|
+
throw new Error(`Unsupported default string type ${d}`);
|
|
916
924
|
}
|
|
917
925
|
return c;
|
|
918
926
|
}
|
|
@@ -958,25 +966,29 @@ function Xt(s, e) {
|
|
|
958
966
|
};
|
|
959
967
|
}
|
|
960
968
|
function Rs(s, e) {
|
|
969
|
+
var i;
|
|
961
970
|
if (e.tag) {
|
|
962
|
-
const
|
|
963
|
-
if (
|
|
964
|
-
return
|
|
971
|
+
const r = s.filter((o) => o.tag === e.tag);
|
|
972
|
+
if (r.length > 0)
|
|
973
|
+
return r.find((o) => o.format === e.format) ?? r[0];
|
|
965
974
|
}
|
|
966
975
|
let t, n;
|
|
967
976
|
if (E(e)) {
|
|
968
977
|
n = e.value;
|
|
969
|
-
let
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
978
|
+
let r = s.filter((o) => {
|
|
979
|
+
var l;
|
|
980
|
+
return (l = o.identify) == null ? void 0 : l.call(o, n);
|
|
981
|
+
});
|
|
982
|
+
if (r.length > 1) {
|
|
983
|
+
const o = r.filter((l) => l.test);
|
|
984
|
+
o.length > 0 && (r = o);
|
|
973
985
|
}
|
|
974
|
-
t =
|
|
986
|
+
t = r.find((o) => o.format === e.format) ?? r.find((o) => !o.format);
|
|
975
987
|
} else
|
|
976
|
-
n = e, t = s.find((
|
|
988
|
+
n = e, t = s.find((r) => r.nodeClass && n instanceof r.nodeClass);
|
|
977
989
|
if (!t) {
|
|
978
|
-
const i = n
|
|
979
|
-
throw new Error(`Tag not resolved for ${
|
|
990
|
+
const r = ((i = n == null ? void 0 : n.constructor) == null ? void 0 : i.name) ?? typeof n;
|
|
991
|
+
throw new Error(`Tag not resolved for ${r} value`);
|
|
980
992
|
}
|
|
981
993
|
return t;
|
|
982
994
|
}
|
|
@@ -989,17 +1001,18 @@ function Us(s, e, { anchors: t, doc: n }) {
|
|
|
989
1001
|
return o && i.push(n.directives.tagString(o)), i.join(" ");
|
|
990
1002
|
}
|
|
991
1003
|
function fe(s, e, t, n) {
|
|
1004
|
+
var a;
|
|
992
1005
|
if (T(s))
|
|
993
1006
|
return s.toString(e, t, n);
|
|
994
|
-
if (
|
|
1007
|
+
if (x(s)) {
|
|
995
1008
|
if (e.doc.directives)
|
|
996
1009
|
return s.toString(e);
|
|
997
|
-
if (e.resolvedAliases
|
|
1010
|
+
if ((a = e.resolvedAliases) != null && a.has(s))
|
|
998
1011
|
throw new TypeError("Cannot stringify circular structure without alias nodes");
|
|
999
1012
|
e.resolvedAliases ? e.resolvedAliases.add(s) : e.resolvedAliases = /* @__PURE__ */ new Set([s]), s = s.resolve(e.doc);
|
|
1000
1013
|
}
|
|
1001
1014
|
let i;
|
|
1002
|
-
const r = $(s) ? s : e.doc.createNode(s, { onTagObj: (
|
|
1015
|
+
const r = $(s) ? s : e.doc.createNode(s, { onTagObj: (c) => i = c });
|
|
1003
1016
|
i || (i = Rs(e.doc.schema.tags, r));
|
|
1004
1017
|
const o = Us(r, i, e);
|
|
1005
1018
|
o.length > 0 && (e.indentAtStart = (e.indentAtStart ?? 0) + o.length + 1);
|
|
@@ -1008,67 +1021,67 @@ function fe(s, e, t, n) {
|
|
|
1008
1021
|
${e.indent}${l}` : l;
|
|
1009
1022
|
}
|
|
1010
1023
|
function Vs({ key: s, value: e }, t, n, i) {
|
|
1011
|
-
const { allNullValues: r, doc: o, indent: l, indentStep: a, options: { commentString: c, indentSeq:
|
|
1012
|
-
let
|
|
1024
|
+
const { allNullValues: r, doc: o, indent: l, indentStep: a, options: { commentString: c, indentSeq: p, simpleKeys: f } } = t;
|
|
1025
|
+
let d = $(s) && s.comment || null;
|
|
1013
1026
|
if (f) {
|
|
1014
|
-
if (
|
|
1027
|
+
if (d)
|
|
1015
1028
|
throw new Error("With simple keys, key nodes cannot have comments");
|
|
1016
1029
|
if (L(s) || !$(s) && typeof s == "object") {
|
|
1017
1030
|
const I = "With simple keys, collection cannot be used as a key value";
|
|
1018
1031
|
throw new Error(I);
|
|
1019
1032
|
}
|
|
1020
1033
|
}
|
|
1021
|
-
let
|
|
1034
|
+
let h = !f && (!s || d && e == null && !t.inFlow || L(s) || (E(s) ? s.type === A.BLOCK_FOLDED || s.type === A.BLOCK_LITERAL : typeof s == "object"));
|
|
1022
1035
|
t = Object.assign({}, t, {
|
|
1023
1036
|
allNullValues: !1,
|
|
1024
|
-
implicitKey: !
|
|
1037
|
+
implicitKey: !h && (f || !r),
|
|
1025
1038
|
indent: l + a
|
|
1026
1039
|
});
|
|
1027
|
-
let y = !1,
|
|
1028
|
-
if (!
|
|
1040
|
+
let y = !1, u = !1, m = fe(s, t, () => y = !0, () => u = !0);
|
|
1041
|
+
if (!h && !t.inFlow && m.length > 1024) {
|
|
1029
1042
|
if (f)
|
|
1030
1043
|
throw new Error("With simple keys, single line scalar must not span more than 1024 characters");
|
|
1031
|
-
|
|
1044
|
+
h = !0;
|
|
1032
1045
|
}
|
|
1033
1046
|
if (t.inFlow) {
|
|
1034
1047
|
if (r || e == null)
|
|
1035
|
-
return y && n && n(),
|
|
1036
|
-
} else if (r && !f || e == null &&
|
|
1037
|
-
return
|
|
1038
|
-
y && (
|
|
1039
|
-
${l}:`) : (
|
|
1040
|
-
let b,
|
|
1041
|
-
$(e) ? (b = !!e.spaceBefore,
|
|
1042
|
-
let
|
|
1043
|
-
const
|
|
1044
|
-
let
|
|
1045
|
-
if (
|
|
1046
|
-
if (
|
|
1047
|
-
` : "",
|
|
1048
|
-
const I = c(
|
|
1049
|
-
|
|
1048
|
+
return y && n && n(), m === "" ? "?" : h ? `? ${m}` : m;
|
|
1049
|
+
} else if (r && !f || e == null && h)
|
|
1050
|
+
return m = `? ${m}`, d && !y ? m += H(m, t.indent, c(d)) : u && i && i(), m;
|
|
1051
|
+
y && (d = null), h ? (d && (m += H(m, t.indent, c(d))), m = `? ${m}
|
|
1052
|
+
${l}:`) : (m = `${m}:`, d && (m += H(m, t.indent, c(d))));
|
|
1053
|
+
let b, S, N;
|
|
1054
|
+
$(e) ? (b = !!e.spaceBefore, S = e.commentBefore, N = e.comment) : (b = !1, S = null, N = null, e && typeof e == "object" && (e = o.createNode(e))), t.implicitKey = !1, !h && !d && E(e) && (t.indentAtStart = m.length + 1), u = !1, !p && a.length >= 2 && !t.inFlow && !h && pe(e) && !e.flow && !e.tag && !e.anchor && (t.indent = t.indent.substring(2));
|
|
1055
|
+
let w = !1;
|
|
1056
|
+
const k = fe(e, t, () => w = !0, () => u = !0);
|
|
1057
|
+
let O = " ";
|
|
1058
|
+
if (d || b || S) {
|
|
1059
|
+
if (O = b ? `
|
|
1060
|
+
` : "", S) {
|
|
1061
|
+
const I = c(S);
|
|
1062
|
+
O += `
|
|
1050
1063
|
${U(I, t.indent)}`;
|
|
1051
1064
|
}
|
|
1052
|
-
|
|
1053
|
-
` && (
|
|
1065
|
+
k === "" && !t.inFlow ? O === `
|
|
1066
|
+
` && (O = `
|
|
1054
1067
|
|
|
1055
|
-
`) :
|
|
1068
|
+
`) : O += `
|
|
1056
1069
|
${t.indent}`;
|
|
1057
|
-
} else if (!
|
|
1058
|
-
const I =
|
|
1070
|
+
} else if (!h && L(e)) {
|
|
1071
|
+
const I = k[0], g = k.indexOf(`
|
|
1059
1072
|
`), _ = g !== -1, J = t.inFlow ?? e.flow ?? e.items.length === 0;
|
|
1060
1073
|
if (_ || !J) {
|
|
1061
1074
|
let te = !1;
|
|
1062
1075
|
if (_ && (I === "&" || I === "!")) {
|
|
1063
|
-
let C =
|
|
1064
|
-
I === "&" && C !== -1 && C < g &&
|
|
1076
|
+
let C = k.indexOf(" ");
|
|
1077
|
+
I === "&" && C !== -1 && C < g && k[C + 1] === "!" && (C = k.indexOf(" ", C + 1)), (C === -1 || g < C) && (te = !0);
|
|
1065
1078
|
}
|
|
1066
|
-
te || (
|
|
1079
|
+
te || (O = `
|
|
1067
1080
|
${t.indent}`);
|
|
1068
1081
|
}
|
|
1069
|
-
} else (
|
|
1070
|
-
`) && (
|
|
1071
|
-
return
|
|
1082
|
+
} else (k === "" || k[0] === `
|
|
1083
|
+
`) && (O = "");
|
|
1084
|
+
return m += O + k, t.inFlow ? w && n && n() : N && !w ? m += H(m, t.indent, c(N)) : u && i && i(), m;
|
|
1072
1085
|
}
|
|
1073
1086
|
function zt(s, e) {
|
|
1074
1087
|
(s === "debug" || s === "warn") && console.warn(e);
|
|
@@ -1078,13 +1091,13 @@ const Te = "<<", V = {
|
|
|
1078
1091
|
default: "key",
|
|
1079
1092
|
tag: "tag:yaml.org,2002:merge",
|
|
1080
1093
|
test: /^<<$/,
|
|
1081
|
-
resolve: () => Object.assign(new
|
|
1082
|
-
addToJSMap:
|
|
1094
|
+
resolve: () => Object.assign(new A(Symbol(Te)), {
|
|
1095
|
+
addToJSMap: Zt
|
|
1083
1096
|
}),
|
|
1084
1097
|
stringify: () => Te
|
|
1085
|
-
}, Js = (s, e) => (V.identify(e) || E(e) && (!e.type || e.type ===
|
|
1086
|
-
function
|
|
1087
|
-
if (t = s &&
|
|
1098
|
+
}, Js = (s, e) => (V.identify(e) || E(e) && (!e.type || e.type === A.PLAIN) && V.identify(e.value)) && (s == null ? void 0 : s.doc.schema.tags.some((t) => t.tag === V.tag && t.default));
|
|
1099
|
+
function Zt(s, e, t) {
|
|
1100
|
+
if (t = s && x(t) ? t.resolve(s.doc) : t, pe(t))
|
|
1088
1101
|
for (const n of t.items)
|
|
1089
1102
|
et(s, e, n);
|
|
1090
1103
|
else if (Array.isArray(t))
|
|
@@ -1094,7 +1107,7 @@ function xt(s, e, t) {
|
|
|
1094
1107
|
et(s, e, t);
|
|
1095
1108
|
}
|
|
1096
1109
|
function et(s, e, t) {
|
|
1097
|
-
const n = s &&
|
|
1110
|
+
const n = s && x(t) ? t.resolve(s.doc) : t;
|
|
1098
1111
|
if (!de(n))
|
|
1099
1112
|
throw new Error("Merge sources must be maps or map aliases");
|
|
1100
1113
|
const i = n.toJSON(null, s, Map);
|
|
@@ -1107,19 +1120,19 @@ function et(s, e, t) {
|
|
|
1107
1120
|
});
|
|
1108
1121
|
return e;
|
|
1109
1122
|
}
|
|
1110
|
-
function
|
|
1123
|
+
function xt(s, e, { key: t, value: n }) {
|
|
1111
1124
|
if ($(t) && t.addToJSMap)
|
|
1112
1125
|
t.addToJSMap(s, e, n);
|
|
1113
1126
|
else if (Js(s, t))
|
|
1114
|
-
|
|
1127
|
+
Zt(s, e, n);
|
|
1115
1128
|
else {
|
|
1116
|
-
const i =
|
|
1129
|
+
const i = P(t, "", s);
|
|
1117
1130
|
if (e instanceof Map)
|
|
1118
|
-
e.set(i,
|
|
1131
|
+
e.set(i, P(n, i, s));
|
|
1119
1132
|
else if (e instanceof Set)
|
|
1120
1133
|
e.add(i);
|
|
1121
1134
|
else {
|
|
1122
|
-
const r = Ys(t, i, s), o =
|
|
1135
|
+
const r = Ys(t, i, s), o = P(n, r, s);
|
|
1123
1136
|
r in e ? Object.defineProperty(e, r, {
|
|
1124
1137
|
value: o,
|
|
1125
1138
|
writable: !0,
|
|
@@ -1135,7 +1148,7 @@ function Ys(s, e, t) {
|
|
|
1135
1148
|
return "";
|
|
1136
1149
|
if (typeof e != "object")
|
|
1137
1150
|
return String(e);
|
|
1138
|
-
if ($(s) && t
|
|
1151
|
+
if ($(s) && (t != null && t.doc)) {
|
|
1139
1152
|
const n = Xt(t.doc, {});
|
|
1140
1153
|
n.anchors = /* @__PURE__ */ new Set();
|
|
1141
1154
|
for (const r of t.anchors.keys())
|
|
@@ -1156,54 +1169,54 @@ function mt(s, e, t) {
|
|
|
1156
1169
|
}
|
|
1157
1170
|
class v {
|
|
1158
1171
|
constructor(e, t = null) {
|
|
1159
|
-
Object.defineProperty(this,
|
|
1172
|
+
Object.defineProperty(this, j, { value: qt }), this.key = e, this.value = t;
|
|
1160
1173
|
}
|
|
1161
1174
|
clone(e) {
|
|
1162
1175
|
let { key: t, value: n } = this;
|
|
1163
1176
|
return $(t) && (t = t.clone(e)), $(n) && (n = n.clone(e)), new v(t, n);
|
|
1164
1177
|
}
|
|
1165
1178
|
toJSON(e, t) {
|
|
1166
|
-
const n = t
|
|
1167
|
-
return
|
|
1179
|
+
const n = t != null && t.mapAsMap ? /* @__PURE__ */ new Map() : {};
|
|
1180
|
+
return xt(t, n, this);
|
|
1168
1181
|
}
|
|
1169
1182
|
toString(e, t, n) {
|
|
1170
|
-
return e
|
|
1183
|
+
return e != null && e.doc ? Vs(this, e, t, n) : JSON.stringify(this);
|
|
1171
1184
|
}
|
|
1172
1185
|
}
|
|
1173
1186
|
function es(s, e, t) {
|
|
1174
1187
|
return (e.inFlow ?? s.flow ? Qs : Gs)(s, e, t);
|
|
1175
1188
|
}
|
|
1176
1189
|
function Gs({ comment: s, items: e }, t, { blockItemPrefix: n, flowChars: i, itemIndent: r, onChompKeep: o, onComment: l }) {
|
|
1177
|
-
const { indent: a, options: { commentString: c } } = t,
|
|
1190
|
+
const { indent: a, options: { commentString: c } } = t, p = Object.assign({}, t, { indent: r, type: null });
|
|
1178
1191
|
let f = !1;
|
|
1179
|
-
const
|
|
1192
|
+
const d = [];
|
|
1180
1193
|
for (let y = 0; y < e.length; ++y) {
|
|
1181
|
-
const
|
|
1182
|
-
let
|
|
1183
|
-
if ($(
|
|
1184
|
-
!f &&
|
|
1185
|
-
else if (T(
|
|
1186
|
-
const
|
|
1187
|
-
|
|
1194
|
+
const u = e[y];
|
|
1195
|
+
let m = null;
|
|
1196
|
+
if ($(u))
|
|
1197
|
+
!f && u.spaceBefore && d.push(""), je(t, d, u.commentBefore, f), u.comment && (m = u.comment);
|
|
1198
|
+
else if (T(u)) {
|
|
1199
|
+
const S = $(u.key) ? u.key : null;
|
|
1200
|
+
S && (!f && S.spaceBefore && d.push(""), je(t, d, S.commentBefore, f));
|
|
1188
1201
|
}
|
|
1189
1202
|
f = !1;
|
|
1190
|
-
let b = fe(
|
|
1191
|
-
|
|
1203
|
+
let b = fe(u, p, () => m = null, () => f = !0);
|
|
1204
|
+
m && (b += H(b, r, c(m))), f && m && (f = !1), d.push(n + b);
|
|
1192
1205
|
}
|
|
1193
|
-
let
|
|
1194
|
-
if (
|
|
1195
|
-
|
|
1206
|
+
let h;
|
|
1207
|
+
if (d.length === 0)
|
|
1208
|
+
h = i.start + i.end;
|
|
1196
1209
|
else {
|
|
1197
|
-
|
|
1198
|
-
for (let y = 1; y <
|
|
1199
|
-
const
|
|
1200
|
-
|
|
1201
|
-
${a}${
|
|
1210
|
+
h = d[0];
|
|
1211
|
+
for (let y = 1; y < d.length; ++y) {
|
|
1212
|
+
const u = d[y];
|
|
1213
|
+
h += u ? `
|
|
1214
|
+
${a}${u}` : `
|
|
1202
1215
|
`;
|
|
1203
1216
|
}
|
|
1204
1217
|
}
|
|
1205
|
-
return s ? (
|
|
1206
|
-
` + U(c(s), a), l && l()) : f && o && o(),
|
|
1218
|
+
return s ? (h += `
|
|
1219
|
+
` + U(c(s), a), l && l()) : f && o && o(), h;
|
|
1207
1220
|
}
|
|
1208
1221
|
function Qs({ items: s }, e, { flowChars: t, itemIndent: n }) {
|
|
1209
1222
|
const { indent: i, indentStep: r, flowCollectionPadding: o, options: { commentString: l } } = e;
|
|
@@ -1213,43 +1226,43 @@ function Qs({ items: s }, e, { flowChars: t, itemIndent: n }) {
|
|
|
1213
1226
|
inFlow: !0,
|
|
1214
1227
|
type: null
|
|
1215
1228
|
});
|
|
1216
|
-
let c = !1,
|
|
1229
|
+
let c = !1, p = 0;
|
|
1217
1230
|
const f = [];
|
|
1218
1231
|
for (let y = 0; y < s.length; ++y) {
|
|
1219
|
-
const
|
|
1220
|
-
let
|
|
1221
|
-
if ($(
|
|
1222
|
-
|
|
1223
|
-
else if (T(
|
|
1224
|
-
const
|
|
1225
|
-
|
|
1226
|
-
const
|
|
1227
|
-
|
|
1232
|
+
const u = s[y];
|
|
1233
|
+
let m = null;
|
|
1234
|
+
if ($(u))
|
|
1235
|
+
u.spaceBefore && f.push(""), je(e, f, u.commentBefore, !1), u.comment && (m = u.comment);
|
|
1236
|
+
else if (T(u)) {
|
|
1237
|
+
const S = $(u.key) ? u.key : null;
|
|
1238
|
+
S && (S.spaceBefore && f.push(""), je(e, f, S.commentBefore, !1), S.comment && (c = !0));
|
|
1239
|
+
const N = $(u.value) ? u.value : null;
|
|
1240
|
+
N ? (N.comment && (m = N.comment), N.commentBefore && (c = !0)) : u.value == null && (S != null && S.comment) && (m = S.comment);
|
|
1228
1241
|
}
|
|
1229
|
-
|
|
1230
|
-
let b = fe(
|
|
1231
|
-
y < s.length - 1 && (b += ","),
|
|
1232
|
-
`)) && (c = !0), f.push(b),
|
|
1242
|
+
m && (c = !0);
|
|
1243
|
+
let b = fe(u, a, () => m = null);
|
|
1244
|
+
y < s.length - 1 && (b += ","), m && (b += H(b, n, l(m))), !c && (f.length > p || b.includes(`
|
|
1245
|
+
`)) && (c = !0), f.push(b), p = f.length;
|
|
1233
1246
|
}
|
|
1234
|
-
const { start:
|
|
1247
|
+
const { start: d, end: h } = t;
|
|
1235
1248
|
if (f.length === 0)
|
|
1236
|
-
return
|
|
1249
|
+
return d + h;
|
|
1237
1250
|
if (!c) {
|
|
1238
|
-
const y = f.reduce((
|
|
1251
|
+
const y = f.reduce((u, m) => u + m.length + 2, 2);
|
|
1239
1252
|
c = e.options.lineWidth > 0 && y > e.options.lineWidth;
|
|
1240
1253
|
}
|
|
1241
1254
|
if (c) {
|
|
1242
|
-
let y =
|
|
1243
|
-
for (const
|
|
1244
|
-
y +=
|
|
1245
|
-
${r}${i}${
|
|
1255
|
+
let y = d;
|
|
1256
|
+
for (const u of f)
|
|
1257
|
+
y += u ? `
|
|
1258
|
+
${r}${i}${u}` : `
|
|
1246
1259
|
`;
|
|
1247
1260
|
return `${y}
|
|
1248
|
-
${i}${
|
|
1261
|
+
${i}${h}`;
|
|
1249
1262
|
} else
|
|
1250
|
-
return `${
|
|
1263
|
+
return `${d}${o}${f.join(" ")}${o}${h}`;
|
|
1251
1264
|
}
|
|
1252
|
-
function
|
|
1265
|
+
function je({ indent: s, options: { commentString: e } }, t, n, i) {
|
|
1253
1266
|
if (n && i && (n = n.replace(/^\n+/, "")), n) {
|
|
1254
1267
|
const r = U(e(n), s);
|
|
1255
1268
|
t.push(r.trimStart());
|
|
@@ -1295,16 +1308,17 @@ class K extends Wt {
|
|
|
1295
1308
|
* collection will throw. Otherwise, overwrites the previous value.
|
|
1296
1309
|
*/
|
|
1297
1310
|
add(e, t) {
|
|
1311
|
+
var o;
|
|
1298
1312
|
let n;
|
|
1299
|
-
T(e) ? n = e : !e || typeof e != "object" || !("key" in e) ? n = new v(e, e
|
|
1300
|
-
const i = X(this.items, n.key), r = this.schema
|
|
1313
|
+
T(e) ? n = e : !e || typeof e != "object" || !("key" in e) ? n = new v(e, e == null ? void 0 : e.value) : n = new v(e.key, e.value);
|
|
1314
|
+
const i = X(this.items, n.key), r = (o = this.schema) == null ? void 0 : o.sortMapEntries;
|
|
1301
1315
|
if (i) {
|
|
1302
1316
|
if (!t)
|
|
1303
1317
|
throw new Error(`Key ${n.key} already set`);
|
|
1304
1318
|
E(i.value) && Qt(n.value) ? i.value.value = n.value : i.value = n.value;
|
|
1305
1319
|
} else if (r) {
|
|
1306
|
-
const
|
|
1307
|
-
|
|
1320
|
+
const l = this.items.findIndex((a) => r(n, a) < 0);
|
|
1321
|
+
l === -1 ? this.items.push(n) : this.items.splice(l, 0, n);
|
|
1308
1322
|
} else
|
|
1309
1323
|
this.items.push(n);
|
|
1310
1324
|
}
|
|
@@ -1313,7 +1327,7 @@ class K extends Wt {
|
|
|
1313
1327
|
return t ? this.items.splice(this.items.indexOf(t), 1).length > 0 : !1;
|
|
1314
1328
|
}
|
|
1315
1329
|
get(e, t) {
|
|
1316
|
-
const
|
|
1330
|
+
const n = X(this.items, e), i = n == null ? void 0 : n.value;
|
|
1317
1331
|
return (!t && E(i) ? i.value : i) ?? void 0;
|
|
1318
1332
|
}
|
|
1319
1333
|
has(e) {
|
|
@@ -1328,10 +1342,10 @@ class K extends Wt {
|
|
|
1328
1342
|
* @returns Instance of Type, Map, or Object
|
|
1329
1343
|
*/
|
|
1330
1344
|
toJSON(e, t, n) {
|
|
1331
|
-
const i = n ? new n() : t
|
|
1332
|
-
t
|
|
1345
|
+
const i = n ? new n() : t != null && t.mapAsMap ? /* @__PURE__ */ new Map() : {};
|
|
1346
|
+
t != null && t.onCreate && t.onCreate(i);
|
|
1333
1347
|
for (const r of this.items)
|
|
1334
|
-
|
|
1348
|
+
xt(t, i, r);
|
|
1335
1349
|
return i;
|
|
1336
1350
|
}
|
|
1337
1351
|
toString(e, t, n) {
|
|
@@ -1414,10 +1428,10 @@ class W extends Wt {
|
|
|
1414
1428
|
}
|
|
1415
1429
|
toJSON(e, t) {
|
|
1416
1430
|
const n = [];
|
|
1417
|
-
t
|
|
1431
|
+
t != null && t.onCreate && t.onCreate(n);
|
|
1418
1432
|
let i = 0;
|
|
1419
1433
|
for (const r of this.items)
|
|
1420
|
-
n.push(
|
|
1434
|
+
n.push(P(r, String(i++), t));
|
|
1421
1435
|
return n;
|
|
1422
1436
|
}
|
|
1423
1437
|
toString(e, t, n) {
|
|
@@ -1467,18 +1481,18 @@ const ye = {
|
|
|
1467
1481
|
}
|
|
1468
1482
|
}, Ge = {
|
|
1469
1483
|
identify: (s) => s == null,
|
|
1470
|
-
createNode: () => new
|
|
1484
|
+
createNode: () => new A(null),
|
|
1471
1485
|
default: !0,
|
|
1472
1486
|
tag: "tag:yaml.org,2002:null",
|
|
1473
1487
|
test: /^(?:~|[Nn]ull|NULL)?$/,
|
|
1474
|
-
resolve: () => new
|
|
1488
|
+
resolve: () => new A(null),
|
|
1475
1489
|
stringify: ({ source: s }, e) => typeof s == "string" && Ge.test.test(s) ? s : e.options.nullStr
|
|
1476
1490
|
}, yt = {
|
|
1477
1491
|
identify: (s) => typeof s == "boolean",
|
|
1478
1492
|
default: !0,
|
|
1479
1493
|
tag: "tag:yaml.org,2002:bool",
|
|
1480
1494
|
test: /^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,
|
|
1481
|
-
resolve: (s) => new
|
|
1495
|
+
resolve: (s) => new A(s[0] === "t" || s[0] === "T"),
|
|
1482
1496
|
stringify({ source: s, value: e }, t) {
|
|
1483
1497
|
if (s && yt.test.test(s)) {
|
|
1484
1498
|
const n = s[0] === "t" || s[0] === "T";
|
|
@@ -1528,7 +1542,7 @@ const ts = {
|
|
|
1528
1542
|
tag: "tag:yaml.org,2002:float",
|
|
1529
1543
|
test: /^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,
|
|
1530
1544
|
resolve(s) {
|
|
1531
|
-
const e = new
|
|
1545
|
+
const e = new A(parseFloat(s)), t = s.indexOf(".");
|
|
1532
1546
|
return t !== -1 && s[s.length - 1] === "0" && (e.minFractionDigits = s.length - t - 1), e;
|
|
1533
1547
|
},
|
|
1534
1548
|
stringify: q
|
|
@@ -1586,7 +1600,7 @@ const $e = ({ value: s }) => JSON.stringify(s), Hs = [
|
|
|
1586
1600
|
},
|
|
1587
1601
|
{
|
|
1588
1602
|
identify: (s) => s == null,
|
|
1589
|
-
createNode: () => new
|
|
1603
|
+
createNode: () => new A(null),
|
|
1590
1604
|
default: !0,
|
|
1591
1605
|
tag: "tag:yaml.org,2002:null",
|
|
1592
1606
|
test: /^null$/,
|
|
@@ -1658,11 +1672,11 @@ const $e = ({ value: s }) => JSON.stringify(s), Hs = [
|
|
|
1658
1672
|
l = btoa(a);
|
|
1659
1673
|
} else
|
|
1660
1674
|
throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");
|
|
1661
|
-
if (e || (e =
|
|
1662
|
-
const a = Math.max(n.options.lineWidth - n.indent.length, n.options.minContentWidth), c = Math.ceil(l.length / a),
|
|
1663
|
-
for (let f = 0,
|
|
1664
|
-
|
|
1665
|
-
l =
|
|
1675
|
+
if (e || (e = A.BLOCK_LITERAL), e !== A.QUOTE_DOUBLE) {
|
|
1676
|
+
const a = Math.max(n.options.lineWidth - n.indent.length, n.options.minContentWidth), c = Math.ceil(l.length / a), p = new Array(c);
|
|
1677
|
+
for (let f = 0, d = 0; f < c; ++f, d += a)
|
|
1678
|
+
p[f] = l.substr(d, a);
|
|
1679
|
+
l = p.join(e === A.BLOCK_LITERAL ? `
|
|
1666
1680
|
` : " ");
|
|
1667
1681
|
}
|
|
1668
1682
|
return Ae({ comment: s, type: e, value: l }, n, i, r);
|
|
@@ -1675,7 +1689,7 @@ function as(s, e) {
|
|
|
1675
1689
|
if (!T(n)) {
|
|
1676
1690
|
if (de(n)) {
|
|
1677
1691
|
n.items.length > 1 && e("Each pair must have its own sequence indicator");
|
|
1678
|
-
const i = n.items[0] || new v(new
|
|
1692
|
+
const i = n.items[0] || new v(new A(null));
|
|
1679
1693
|
if (n.commentBefore && (i.key.commentBefore = i.key.commentBefore ? `${n.commentBefore}
|
|
1680
1694
|
${i.key.commentBefore}` : n.commentBefore), n.comment) {
|
|
1681
1695
|
const r = i.value ?? i.key;
|
|
@@ -1735,10 +1749,10 @@ class ae extends W {
|
|
|
1735
1749
|
if (!t)
|
|
1736
1750
|
return super.toJSON(e);
|
|
1737
1751
|
const n = /* @__PURE__ */ new Map();
|
|
1738
|
-
t
|
|
1752
|
+
t != null && t.onCreate && t.onCreate(n);
|
|
1739
1753
|
for (const i of this.items) {
|
|
1740
1754
|
let r, o;
|
|
1741
|
-
if (T(i) ? (r =
|
|
1755
|
+
if (T(i) ? (r = P(i.key, "", t), o = P(i.value, r, t)) : r = P(i, "", t), n.has(r))
|
|
1742
1756
|
throw new Error("Ordered maps must not include duplicate keys");
|
|
1743
1757
|
n.set(r, o);
|
|
1744
1758
|
}
|
|
@@ -1772,23 +1786,23 @@ const us = {
|
|
|
1772
1786
|
default: !0,
|
|
1773
1787
|
tag: "tag:yaml.org,2002:bool",
|
|
1774
1788
|
test: /^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,
|
|
1775
|
-
resolve: () => new
|
|
1789
|
+
resolve: () => new A(!0),
|
|
1776
1790
|
stringify: fs
|
|
1777
1791
|
}, hs = {
|
|
1778
1792
|
identify: (s) => s === !1,
|
|
1779
1793
|
default: !0,
|
|
1780
1794
|
tag: "tag:yaml.org,2002:bool",
|
|
1781
1795
|
test: /^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,
|
|
1782
|
-
resolve: () => new
|
|
1796
|
+
resolve: () => new A(!1),
|
|
1783
1797
|
stringify: fs
|
|
1784
|
-
},
|
|
1798
|
+
}, Zs = {
|
|
1785
1799
|
identify: (s) => typeof s == "number",
|
|
1786
1800
|
default: !0,
|
|
1787
1801
|
tag: "tag:yaml.org,2002:float",
|
|
1788
1802
|
test: /^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,
|
|
1789
1803
|
resolve: (s) => s.slice(-3).toLowerCase() === "nan" ? NaN : s[0] === "-" ? Number.NEGATIVE_INFINITY : Number.POSITIVE_INFINITY,
|
|
1790
1804
|
stringify: q
|
|
1791
|
-
},
|
|
1805
|
+
}, xs = {
|
|
1792
1806
|
identify: (s) => typeof s == "number",
|
|
1793
1807
|
default: !0,
|
|
1794
1808
|
tag: "tag:yaml.org,2002:float",
|
|
@@ -1805,7 +1819,7 @@ const us = {
|
|
|
1805
1819
|
tag: "tag:yaml.org,2002:float",
|
|
1806
1820
|
test: /^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,
|
|
1807
1821
|
resolve(s) {
|
|
1808
|
-
const e = new
|
|
1822
|
+
const e = new A(parseFloat(s.replace(/_/g, ""))), t = s.indexOf(".");
|
|
1809
1823
|
if (t !== -1) {
|
|
1810
1824
|
const n = s.substring(t + 1).replace(/_/g, "");
|
|
1811
1825
|
n[n.length - 1] === "0" && (e.minFractionDigits = n.length);
|
|
@@ -1977,14 +1991,14 @@ const ps = {
|
|
|
1977
1991
|
throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");
|
|
1978
1992
|
const [, t, n, i, r, o, l] = e.map(Number), a = e[7] ? Number((e[7] + "00").substr(1, 3)) : 0;
|
|
1979
1993
|
let c = Date.UTC(t, n - 1, i, r || 0, o || 0, l || 0, a);
|
|
1980
|
-
const
|
|
1981
|
-
if (
|
|
1982
|
-
let f = Ot(
|
|
1994
|
+
const p = e[8];
|
|
1995
|
+
if (p && p !== "Z") {
|
|
1996
|
+
let f = Ot(p, !1);
|
|
1983
1997
|
Math.abs(f) < 30 && (f *= 60), c -= 6e4 * f;
|
|
1984
1998
|
}
|
|
1985
1999
|
return new Date(c);
|
|
1986
2000
|
},
|
|
1987
|
-
stringify: ({ value: s }) => s
|
|
2001
|
+
stringify: ({ value: s }) => (s == null ? void 0 : s.toISOString().replace(/(T00:00:00)?\.000Z$/, "")) ?? ""
|
|
1988
2002
|
}, Ct = [
|
|
1989
2003
|
me,
|
|
1990
2004
|
ye,
|
|
@@ -1996,8 +2010,8 @@ const ps = {
|
|
|
1996
2010
|
sn,
|
|
1997
2011
|
nn,
|
|
1998
2012
|
rn,
|
|
1999
|
-
xs,
|
|
2000
2013
|
Zs,
|
|
2014
|
+
xs,
|
|
2001
2015
|
en,
|
|
2002
2016
|
bt,
|
|
2003
2017
|
V,
|
|
@@ -2059,7 +2073,7 @@ function tt(s, e, t) {
|
|
|
2059
2073
|
return t && (i = i.concat(V)), i.reduce((r, o) => {
|
|
2060
2074
|
const l = typeof o == "string" ? Bt[o] : o;
|
|
2061
2075
|
if (!l) {
|
|
2062
|
-
const a = JSON.stringify(o), c = Object.keys(Bt).map((
|
|
2076
|
+
const a = JSON.stringify(o), c = Object.keys(Bt).map((p) => JSON.stringify(p)).join(", ");
|
|
2063
2077
|
throw new Error(`Unknown custom tag ${a}; use one of ${c}`);
|
|
2064
2078
|
}
|
|
2065
2079
|
return r.includes(l) || r.push(l), r;
|
|
@@ -2076,43 +2090,44 @@ class Xe {
|
|
|
2076
2090
|
}
|
|
2077
2091
|
}
|
|
2078
2092
|
function an(s, e) {
|
|
2093
|
+
var a;
|
|
2079
2094
|
const t = [];
|
|
2080
2095
|
let n = e.directives === !0;
|
|
2081
2096
|
if (e.directives !== !1 && s.directives) {
|
|
2082
|
-
const
|
|
2083
|
-
|
|
2097
|
+
const c = s.directives.toString(s);
|
|
2098
|
+
c ? (t.push(c), n = !0) : s.directives.docStart && (n = !0);
|
|
2084
2099
|
}
|
|
2085
2100
|
n && t.push("---");
|
|
2086
2101
|
const i = Xt(s, e), { commentString: r } = i.options;
|
|
2087
2102
|
if (s.commentBefore) {
|
|
2088
2103
|
t.length !== 1 && t.unshift("");
|
|
2089
|
-
const
|
|
2090
|
-
t.unshift(U(
|
|
2104
|
+
const c = r(s.commentBefore);
|
|
2105
|
+
t.unshift(U(c, ""));
|
|
2091
2106
|
}
|
|
2092
2107
|
let o = !1, l = null;
|
|
2093
2108
|
if (s.contents) {
|
|
2094
2109
|
if ($(s.contents)) {
|
|
2095
2110
|
if (s.contents.spaceBefore && n && t.push(""), s.contents.commentBefore) {
|
|
2096
|
-
const
|
|
2097
|
-
t.push(U(
|
|
2111
|
+
const f = r(s.contents.commentBefore);
|
|
2112
|
+
t.push(U(f, ""));
|
|
2098
2113
|
}
|
|
2099
2114
|
i.forceBlockIndent = !!s.comment, l = s.contents.comment;
|
|
2100
2115
|
}
|
|
2101
|
-
const
|
|
2102
|
-
let
|
|
2103
|
-
l && (
|
|
2116
|
+
const c = l ? void 0 : () => o = !0;
|
|
2117
|
+
let p = fe(s.contents, i, () => l = null, c);
|
|
2118
|
+
l && (p += H(p, "", r(l))), (p[0] === "|" || p[0] === ">") && t[t.length - 1] === "---" ? t[t.length - 1] = `--- ${p}` : t.push(p);
|
|
2104
2119
|
} else
|
|
2105
2120
|
t.push(fe(s.contents, i));
|
|
2106
|
-
if (s.directives
|
|
2121
|
+
if ((a = s.directives) != null && a.docEnd)
|
|
2107
2122
|
if (s.comment) {
|
|
2108
|
-
const
|
|
2109
|
-
|
|
2110
|
-
`) ? (t.push("..."), t.push(U(
|
|
2123
|
+
const c = r(s.comment);
|
|
2124
|
+
c.includes(`
|
|
2125
|
+
`) ? (t.push("..."), t.push(U(c, ""))) : t.push(`... ${c}`);
|
|
2111
2126
|
} else
|
|
2112
2127
|
t.push("...");
|
|
2113
2128
|
else {
|
|
2114
|
-
let
|
|
2115
|
-
|
|
2129
|
+
let c = s.comment;
|
|
2130
|
+
c && o && (c = c.replace(/^\n+/, "")), c && ((!o || l) && t[t.length - 1] !== "" && t.push(""), t.push(U(r(c), "")));
|
|
2116
2131
|
}
|
|
2117
2132
|
return t.join(`
|
|
2118
2133
|
`) + `
|
|
@@ -2120,7 +2135,7 @@ function an(s, e) {
|
|
|
2120
2135
|
}
|
|
2121
2136
|
class ge {
|
|
2122
2137
|
constructor(e, t, n) {
|
|
2123
|
-
this.commentBefore = null, this.comment = null, this.errors = [], this.warnings = [], Object.defineProperty(this,
|
|
2138
|
+
this.commentBefore = null, this.comment = null, this.errors = [], this.warnings = [], Object.defineProperty(this, j, { value: lt });
|
|
2124
2139
|
let i = null;
|
|
2125
2140
|
typeof t == "function" || Array.isArray(t) ? i = t : n === void 0 && t && (n = t, t = void 0);
|
|
2126
2141
|
const r = Object.assign({
|
|
@@ -2135,7 +2150,7 @@ class ge {
|
|
|
2135
2150
|
}, n);
|
|
2136
2151
|
this.options = r;
|
|
2137
2152
|
let { version: o } = r;
|
|
2138
|
-
n
|
|
2153
|
+
n != null && n._directives ? (this.directives = n._directives.atDocument(), this.directives.yaml.explicit && (o = this.directives.yaml.version)) : this.directives = new B({ version: o }), this.setSchema(o, n), this.contents = e === void 0 ? null : this.createNode(e, i, n);
|
|
2139
2154
|
}
|
|
2140
2155
|
/**
|
|
2141
2156
|
* Create a deep copy of this Document and its contents.
|
|
@@ -2144,7 +2159,7 @@ class ge {
|
|
|
2144
2159
|
*/
|
|
2145
2160
|
clone() {
|
|
2146
2161
|
const e = Object.create(ge.prototype, {
|
|
2147
|
-
[
|
|
2162
|
+
[j]: { value: lt }
|
|
2148
2163
|
});
|
|
2149
2164
|
return e.commentBefore = this.commentBefore, e.comment = this.comment, e.errors = this.errors.slice(), e.warnings = this.warnings.slice(), e.options = Object.assign({}, this.options), this.directives && (e.directives = this.directives.clone()), e.schema = this.schema.clone(), e.contents = $(this.contents) ? this.contents.clone(e.schema) : this.contents, this.range && (e.range = this.range.slice()), e;
|
|
2150
2165
|
}
|
|
@@ -2178,10 +2193,10 @@ class ge {
|
|
|
2178
2193
|
if (typeof t == "function")
|
|
2179
2194
|
e = t.call({ "": e }, "", e), i = t;
|
|
2180
2195
|
else if (Array.isArray(t)) {
|
|
2181
|
-
const
|
|
2196
|
+
const m = (S) => typeof S == "number" || S instanceof String || S instanceof Number, b = t.filter(m).map(String);
|
|
2182
2197
|
b.length > 0 && (t = t.concat(b)), i = t;
|
|
2183
2198
|
} else n === void 0 && t && (n = t, t = void 0);
|
|
2184
|
-
const { aliasDuplicateObjects: r, anchorPrefix: o, flow: l, keepUndefined: a, onTagObj: c, tag:
|
|
2199
|
+
const { aliasDuplicateObjects: r, anchorPrefix: o, flow: l, keepUndefined: a, onTagObj: c, tag: p } = n ?? {}, { onAnchor: f, setAnchors: d, sourceObjects: h } = Ks(
|
|
2185
2200
|
this,
|
|
2186
2201
|
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
|
|
2187
2202
|
o || "a"
|
|
@@ -2192,9 +2207,9 @@ class ge {
|
|
|
2192
2207
|
onTagObj: c,
|
|
2193
2208
|
replacer: i,
|
|
2194
2209
|
schema: this.schema,
|
|
2195
|
-
sourceObjects:
|
|
2196
|
-
},
|
|
2197
|
-
return l && L(
|
|
2210
|
+
sourceObjects: h
|
|
2211
|
+
}, u = ke(e, p, y);
|
|
2212
|
+
return l && L(u) && (u.flow = !0), d(), u;
|
|
2198
2213
|
}
|
|
2199
2214
|
/**
|
|
2200
2215
|
* Convert a key and a value into a `Pair` using the current schema,
|
|
@@ -2251,14 +2266,14 @@ class ge {
|
|
|
2251
2266
|
* boolean to add/remove the item from the set.
|
|
2252
2267
|
*/
|
|
2253
2268
|
set(e, t) {
|
|
2254
|
-
this.contents == null ? this.contents =
|
|
2269
|
+
this.contents == null ? this.contents = Pe(this.schema, [e], t) : se(this.contents) && this.contents.set(e, t);
|
|
2255
2270
|
}
|
|
2256
2271
|
/**
|
|
2257
2272
|
* Sets a value in this document. For `!!set`, `value` needs to be a
|
|
2258
2273
|
* boolean to add/remove the item from the set.
|
|
2259
2274
|
*/
|
|
2260
2275
|
setIn(e, t) {
|
|
2261
|
-
we(e) ? this.contents = t : this.contents == null ? this.contents =
|
|
2276
|
+
we(e) ? this.contents = t : this.contents == null ? this.contents = Pe(this.schema, Array.from(e), t) : se(this.contents) && this.contents.setIn(e, t);
|
|
2262
2277
|
}
|
|
2263
2278
|
/**
|
|
2264
2279
|
* Change the YAML version and schema used by the document.
|
|
@@ -2302,10 +2317,10 @@ class ge {
|
|
|
2302
2317
|
mapAsMap: n === !0,
|
|
2303
2318
|
mapKeyWarned: !1,
|
|
2304
2319
|
maxAliasCount: typeof i == "number" ? i : 100
|
|
2305
|
-
}, a =
|
|
2320
|
+
}, a = P(this.contents, t ?? "", l);
|
|
2306
2321
|
if (typeof r == "function")
|
|
2307
|
-
for (const { count: c, res:
|
|
2308
|
-
r(
|
|
2322
|
+
for (const { count: c, res: p } of l.anchors.values())
|
|
2323
|
+
r(p, c);
|
|
2309
2324
|
return typeof o == "function" ? oe(o, { "": a }, "", a) : a;
|
|
2310
2325
|
}
|
|
2311
2326
|
/**
|
|
@@ -2377,52 +2392,52 @@ ${c}
|
|
|
2377
2392
|
}
|
|
2378
2393
|
};
|
|
2379
2394
|
function ue(s, { flow: e, indicator: t, next: n, offset: i, onError: r, parentIndent: o, startOnNewline: l }) {
|
|
2380
|
-
let a = !1, c = l,
|
|
2395
|
+
let a = !1, c = l, p = l, f = "", d = "", h = !1, y = !1, u = null, m = null, b = null, S = null, N = null, w = null, k = null;
|
|
2381
2396
|
for (const g of s)
|
|
2382
|
-
switch (y && (g.type !== "space" && g.type !== "newline" && g.type !== "comma" && r(g.offset, "MISSING_CHAR", "Tags and anchors must be separated from the next token by white space"), y = !1),
|
|
2397
|
+
switch (y && (g.type !== "space" && g.type !== "newline" && g.type !== "comma" && r(g.offset, "MISSING_CHAR", "Tags and anchors must be separated from the next token by white space"), y = !1), u && (c && g.type !== "comment" && g.type !== "newline" && r(u, "TAB_AS_INDENT", "Tabs are not allowed as indentation"), u = null), g.type) {
|
|
2383
2398
|
case "space":
|
|
2384
|
-
!e && (t !== "doc-start" || n
|
|
2399
|
+
!e && (t !== "doc-start" || (n == null ? void 0 : n.type) !== "flow-collection") && g.source.includes(" ") && (u = g), p = !0;
|
|
2385
2400
|
break;
|
|
2386
2401
|
case "comment": {
|
|
2387
|
-
|
|
2402
|
+
p || r(g, "MISSING_CHAR", "Comments must be separated from other tokens by white space characters");
|
|
2388
2403
|
const _ = g.source.substring(1) || " ";
|
|
2389
|
-
f ? f +=
|
|
2404
|
+
f ? f += d + _ : f = _, d = "", c = !1;
|
|
2390
2405
|
break;
|
|
2391
2406
|
}
|
|
2392
2407
|
case "newline":
|
|
2393
|
-
c ? f ? f += g.source : (!
|
|
2408
|
+
c ? f ? f += g.source : (!w || t !== "seq-item-ind") && (a = !0) : d += g.source, c = !0, h = !0, (m || b) && (S = g), p = !0;
|
|
2394
2409
|
break;
|
|
2395
2410
|
case "anchor":
|
|
2396
|
-
|
|
2411
|
+
m && r(g, "MULTIPLE_ANCHORS", "A node can have at most one anchor"), g.source.endsWith(":") && r(g.offset + g.source.length - 1, "BAD_ALIAS", "Anchor ending in : is ambiguous", !0), m = g, k === null && (k = g.offset), c = !1, p = !1, y = !0;
|
|
2397
2412
|
break;
|
|
2398
2413
|
case "tag": {
|
|
2399
|
-
b && r(g, "MULTIPLE_TAGS", "A node can have at most one tag"), b = g,
|
|
2414
|
+
b && r(g, "MULTIPLE_TAGS", "A node can have at most one tag"), b = g, k === null && (k = g.offset), c = !1, p = !1, y = !0;
|
|
2400
2415
|
break;
|
|
2401
2416
|
}
|
|
2402
2417
|
case t:
|
|
2403
|
-
(
|
|
2418
|
+
(m || b) && r(g, "BAD_PROP_ORDER", `Anchors and tags must be after the ${g.source} indicator`), w && r(g, "UNEXPECTED_TOKEN", `Unexpected ${g.source} in ${e ?? "collection"}`), w = g, c = t === "seq-item-ind" || t === "explicit-key-ind", p = !1;
|
|
2404
2419
|
break;
|
|
2405
2420
|
case "comma":
|
|
2406
2421
|
if (e) {
|
|
2407
|
-
|
|
2422
|
+
N && r(g, "UNEXPECTED_TOKEN", `Unexpected , in ${e}`), N = g, c = !1, p = !1;
|
|
2408
2423
|
break;
|
|
2409
2424
|
}
|
|
2410
2425
|
// else fallthrough
|
|
2411
2426
|
default:
|
|
2412
|
-
r(g, "UNEXPECTED_TOKEN", `Unexpected ${g.type} token`), c = !1,
|
|
2427
|
+
r(g, "UNEXPECTED_TOKEN", `Unexpected ${g.type} token`), c = !1, p = !1;
|
|
2413
2428
|
}
|
|
2414
|
-
const
|
|
2415
|
-
return y && n && n.type !== "space" && n.type !== "newline" && n.type !== "comma" && (n.type !== "scalar" || n.source !== "") && r(n.offset, "MISSING_CHAR", "Tags and anchors must be separated from the next token by white space"),
|
|
2416
|
-
comma:
|
|
2417
|
-
found:
|
|
2429
|
+
const O = s[s.length - 1], I = O ? O.offset + O.source.length : i;
|
|
2430
|
+
return y && n && n.type !== "space" && n.type !== "newline" && n.type !== "comma" && (n.type !== "scalar" || n.source !== "") && r(n.offset, "MISSING_CHAR", "Tags and anchors must be separated from the next token by white space"), u && (c && u.indent <= o || (n == null ? void 0 : n.type) === "block-map" || (n == null ? void 0 : n.type) === "block-seq") && r(u, "TAB_AS_INDENT", "Tabs are not allowed as indentation"), {
|
|
2431
|
+
comma: N,
|
|
2432
|
+
found: w,
|
|
2418
2433
|
spaceBefore: a,
|
|
2419
2434
|
comment: f,
|
|
2420
|
-
hasNewline:
|
|
2421
|
-
anchor:
|
|
2435
|
+
hasNewline: h,
|
|
2436
|
+
anchor: m,
|
|
2422
2437
|
tag: b,
|
|
2423
|
-
newlineAfterProp:
|
|
2438
|
+
newlineAfterProp: S,
|
|
2424
2439
|
end: I,
|
|
2425
|
-
start:
|
|
2440
|
+
start: k ?? I
|
|
2426
2441
|
};
|
|
2427
2442
|
}
|
|
2428
2443
|
function Ne(s) {
|
|
@@ -2461,7 +2476,7 @@ function Ne(s) {
|
|
|
2461
2476
|
}
|
|
2462
2477
|
}
|
|
2463
2478
|
function ut(s, e, t) {
|
|
2464
|
-
if (e
|
|
2479
|
+
if ((e == null ? void 0 : e.type) === "flow-collection") {
|
|
2465
2480
|
const n = e.end[0];
|
|
2466
2481
|
n.indent === s && (n.source === "]" || n.source === "}") && Ne(e) && t(n, "BAD_INDENT", "Flow end indicator should be more indented than parent", !0);
|
|
2467
2482
|
}
|
|
@@ -2475,58 +2490,59 @@ function gs(s, e, t) {
|
|
|
2475
2490
|
}
|
|
2476
2491
|
const Mt = "All mapping items must start at the same column";
|
|
2477
2492
|
function cn({ composeNode: s, composeEmptyNode: e }, t, n, i, r) {
|
|
2478
|
-
|
|
2493
|
+
var p;
|
|
2494
|
+
const o = (r == null ? void 0 : r.nodeClass) ?? K, l = new o(t.schema);
|
|
2479
2495
|
t.atRoot && (t.atRoot = !1);
|
|
2480
2496
|
let a = n.offset, c = null;
|
|
2481
|
-
for (const
|
|
2482
|
-
const { start:
|
|
2497
|
+
for (const f of n.items) {
|
|
2498
|
+
const { start: d, key: h, sep: y, value: u } = f, m = ue(d, {
|
|
2483
2499
|
indicator: "explicit-key-ind",
|
|
2484
|
-
next:
|
|
2500
|
+
next: h ?? (y == null ? void 0 : y[0]),
|
|
2485
2501
|
offset: a,
|
|
2486
2502
|
onError: i,
|
|
2487
2503
|
parentIndent: n.indent,
|
|
2488
2504
|
startOnNewline: !0
|
|
2489
|
-
}),
|
|
2490
|
-
if (
|
|
2491
|
-
if (
|
|
2492
|
-
c =
|
|
2493
|
-
` +
|
|
2505
|
+
}), b = !m.found;
|
|
2506
|
+
if (b) {
|
|
2507
|
+
if (h && (h.type === "block-seq" ? i(a, "BLOCK_AS_IMPLICIT_KEY", "A block sequence may not be used as an implicit map key") : "indent" in h && h.indent !== n.indent && i(a, "BAD_INDENT", Mt)), !m.anchor && !m.tag && !y) {
|
|
2508
|
+
c = m.end, m.comment && (l.comment ? l.comment += `
|
|
2509
|
+
` + m.comment : l.comment = m.comment);
|
|
2494
2510
|
continue;
|
|
2495
2511
|
}
|
|
2496
|
-
(
|
|
2497
|
-
} else
|
|
2512
|
+
(m.newlineAfterProp || Ne(h)) && i(h ?? d[d.length - 1], "MULTILINE_IMPLICIT_KEY", "Implicit keys need to be on a single line");
|
|
2513
|
+
} else ((p = m.found) == null ? void 0 : p.indent) !== n.indent && i(a, "BAD_INDENT", Mt);
|
|
2498
2514
|
t.atKey = !0;
|
|
2499
|
-
const
|
|
2500
|
-
t.schema.compat && ut(n.indent,
|
|
2501
|
-
const
|
|
2515
|
+
const S = m.end, N = h ? s(t, h, m, i) : e(t, S, d, null, m, i);
|
|
2516
|
+
t.schema.compat && ut(n.indent, h, i), t.atKey = !1, gs(t, l.items, N) && i(S, "DUPLICATE_KEY", "Map keys must be unique");
|
|
2517
|
+
const w = ue(y ?? [], {
|
|
2502
2518
|
indicator: "map-value-ind",
|
|
2503
|
-
next:
|
|
2504
|
-
offset:
|
|
2519
|
+
next: u,
|
|
2520
|
+
offset: N.range[2],
|
|
2505
2521
|
onError: i,
|
|
2506
2522
|
parentIndent: n.indent,
|
|
2507
|
-
startOnNewline: !
|
|
2523
|
+
startOnNewline: !h || h.type === "block-scalar"
|
|
2508
2524
|
});
|
|
2509
|
-
if (a =
|
|
2510
|
-
|
|
2511
|
-
const k =
|
|
2512
|
-
t.schema.compat && ut(n.indent,
|
|
2513
|
-
const
|
|
2514
|
-
t.options.keepSourceTokens && (
|
|
2525
|
+
if (a = w.end, w.found) {
|
|
2526
|
+
b && ((u == null ? void 0 : u.type) === "block-map" && !w.hasNewline && i(a, "BLOCK_AS_IMPLICIT_KEY", "Nested mappings are not allowed in compact mappings"), t.options.strict && m.start < w.found.offset - 1024 && i(N.range, "KEY_OVER_1024_CHARS", "The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));
|
|
2527
|
+
const k = u ? s(t, u, w, i) : e(t, a, y, null, w, i);
|
|
2528
|
+
t.schema.compat && ut(n.indent, u, i), a = k.range[2];
|
|
2529
|
+
const O = new v(N, k);
|
|
2530
|
+
t.options.keepSourceTokens && (O.srcToken = f), l.items.push(O);
|
|
2515
2531
|
} else {
|
|
2516
|
-
|
|
2517
|
-
` +
|
|
2518
|
-
const k = new v(
|
|
2519
|
-
t.options.keepSourceTokens && (k.srcToken =
|
|
2532
|
+
b && i(N.range, "MISSING_CHAR", "Implicit map keys need to be followed by map values"), w.comment && (N.comment ? N.comment += `
|
|
2533
|
+
` + w.comment : N.comment = w.comment);
|
|
2534
|
+
const k = new v(N);
|
|
2535
|
+
t.options.keepSourceTokens && (k.srcToken = f), l.items.push(k);
|
|
2520
2536
|
}
|
|
2521
2537
|
}
|
|
2522
2538
|
return c && c < a && i(c, "IMPOSSIBLE", "Map comment with trailing content"), l.range = [n.offset, a, c ?? a], l;
|
|
2523
2539
|
}
|
|
2524
2540
|
function fn({ composeNode: s, composeEmptyNode: e }, t, n, i, r) {
|
|
2525
|
-
const o = r
|
|
2541
|
+
const o = (r == null ? void 0 : r.nodeClass) ?? W, l = new o(t.schema);
|
|
2526
2542
|
t.atRoot && (t.atRoot = !1), t.atKey && (t.atKey = !1);
|
|
2527
2543
|
let a = n.offset, c = null;
|
|
2528
|
-
for (const { start:
|
|
2529
|
-
const
|
|
2544
|
+
for (const { start: p, value: f } of n.items) {
|
|
2545
|
+
const d = ue(p, {
|
|
2530
2546
|
indicator: "seq-item-ind",
|
|
2531
2547
|
next: f,
|
|
2532
2548
|
offset: a,
|
|
@@ -2534,15 +2550,15 @@ function fn({ composeNode: s, composeEmptyNode: e }, t, n, i, r) {
|
|
|
2534
2550
|
parentIndent: n.indent,
|
|
2535
2551
|
startOnNewline: !0
|
|
2536
2552
|
});
|
|
2537
|
-
if (!
|
|
2538
|
-
if (
|
|
2539
|
-
f && f.type === "block-seq" ? i(
|
|
2553
|
+
if (!d.found)
|
|
2554
|
+
if (d.anchor || d.tag || f)
|
|
2555
|
+
f && f.type === "block-seq" ? i(d.end, "BAD_INDENT", "All sequence items must start at the same column") : i(a, "MISSING_CHAR", "Sequence item without - indicator");
|
|
2540
2556
|
else {
|
|
2541
|
-
c =
|
|
2557
|
+
c = d.end, d.comment && (l.comment = d.comment);
|
|
2542
2558
|
continue;
|
|
2543
2559
|
}
|
|
2544
|
-
const
|
|
2545
|
-
t.schema.compat && ut(n.indent, f, i), a =
|
|
2560
|
+
const h = f ? s(t, f, d, i) : e(t, d.end, p, null, d, i);
|
|
2561
|
+
t.schema.compat && ut(n.indent, f, i), a = h.range[2], l.items.push(h);
|
|
2546
2562
|
}
|
|
2547
2563
|
return l.range = [n.offset, a, c ?? a], l;
|
|
2548
2564
|
}
|
|
@@ -2558,8 +2574,8 @@ function Ie(s, e, t, n) {
|
|
|
2558
2574
|
break;
|
|
2559
2575
|
case "comment": {
|
|
2560
2576
|
t && !r && n(l, "MISSING_CHAR", "Comments must be separated from other tokens by white space characters");
|
|
2561
|
-
const
|
|
2562
|
-
i ? i += o +
|
|
2577
|
+
const p = a.substring(1) || " ";
|
|
2578
|
+
i ? i += o + p : i = p, o = "";
|
|
2563
2579
|
break;
|
|
2564
2580
|
}
|
|
2565
2581
|
case "newline":
|
|
@@ -2575,39 +2591,39 @@ function Ie(s, e, t, n) {
|
|
|
2575
2591
|
}
|
|
2576
2592
|
const st = "Block collections are not allowed within flow collections", nt = (s) => s && (s.type === "block-map" || s.type === "block-seq");
|
|
2577
2593
|
function un({ composeNode: s, composeEmptyNode: e }, t, n, i, r) {
|
|
2578
|
-
const o = n.start.source === "{", l = o ? "flow map" : "flow sequence", a = r
|
|
2594
|
+
const o = n.start.source === "{", l = o ? "flow map" : "flow sequence", a = (r == null ? void 0 : r.nodeClass) ?? (o ? K : W), c = new a(t.schema);
|
|
2579
2595
|
c.flow = !0;
|
|
2580
|
-
const
|
|
2581
|
-
|
|
2596
|
+
const p = t.atRoot;
|
|
2597
|
+
p && (t.atRoot = !1), t.atKey && (t.atKey = !1);
|
|
2582
2598
|
let f = n.offset + n.start.source.length;
|
|
2583
|
-
for (let
|
|
2584
|
-
const b = n.items[
|
|
2599
|
+
for (let m = 0; m < n.items.length; ++m) {
|
|
2600
|
+
const b = n.items[m], { start: S, key: N, sep: w, value: k } = b, O = ue(S, {
|
|
2585
2601
|
flow: l,
|
|
2586
2602
|
indicator: "explicit-key-ind",
|
|
2587
|
-
next:
|
|
2603
|
+
next: N ?? (w == null ? void 0 : w[0]),
|
|
2588
2604
|
offset: f,
|
|
2589
2605
|
onError: i,
|
|
2590
2606
|
parentIndent: n.indent,
|
|
2591
2607
|
startOnNewline: !1
|
|
2592
2608
|
});
|
|
2593
|
-
if (!
|
|
2594
|
-
if (!
|
|
2595
|
-
|
|
2596
|
-
` +
|
|
2609
|
+
if (!O.found) {
|
|
2610
|
+
if (!O.anchor && !O.tag && !w && !k) {
|
|
2611
|
+
m === 0 && O.comma ? i(O.comma, "UNEXPECTED_TOKEN", `Unexpected , in ${l}`) : m < n.items.length - 1 && i(O.start, "UNEXPECTED_TOKEN", `Unexpected empty item in ${l}`), O.comment && (c.comment ? c.comment += `
|
|
2612
|
+
` + O.comment : c.comment = O.comment), f = O.end;
|
|
2597
2613
|
continue;
|
|
2598
2614
|
}
|
|
2599
|
-
!o && t.options.strict && Ne(
|
|
2600
|
-
|
|
2615
|
+
!o && t.options.strict && Ne(N) && i(
|
|
2616
|
+
N,
|
|
2601
2617
|
// checked by containsNewline()
|
|
2602
2618
|
"MULTILINE_IMPLICIT_KEY",
|
|
2603
2619
|
"Implicit keys of flow sequence pairs need to be on a single line"
|
|
2604
2620
|
);
|
|
2605
2621
|
}
|
|
2606
|
-
if (
|
|
2607
|
-
|
|
2608
|
-
else if (
|
|
2622
|
+
if (m === 0)
|
|
2623
|
+
O.comma && i(O.comma, "UNEXPECTED_TOKEN", `Unexpected , in ${l}`);
|
|
2624
|
+
else if (O.comma || i(O.start, "MISSING_CHAR", `Missing , between ${l} items`), O.comment) {
|
|
2609
2625
|
let I = "";
|
|
2610
|
-
e: for (const g of
|
|
2626
|
+
e: for (const g of S)
|
|
2611
2627
|
switch (g.type) {
|
|
2612
2628
|
case "comma":
|
|
2613
2629
|
case "space":
|
|
@@ -2621,29 +2637,29 @@ function un({ composeNode: s, composeEmptyNode: e }, t, n, i, r) {
|
|
|
2621
2637
|
if (I) {
|
|
2622
2638
|
let g = c.items[c.items.length - 1];
|
|
2623
2639
|
T(g) && (g = g.value ?? g.key), g.comment ? g.comment += `
|
|
2624
|
-
` + I : g.comment = I,
|
|
2640
|
+
` + I : g.comment = I, O.comment = O.comment.substring(I.length + 1);
|
|
2625
2641
|
}
|
|
2626
2642
|
}
|
|
2627
|
-
if (!o && !
|
|
2628
|
-
const I =
|
|
2629
|
-
c.items.push(I), f = I.range[2], nt(
|
|
2643
|
+
if (!o && !w && !O.found) {
|
|
2644
|
+
const I = k ? s(t, k, O, i) : e(t, O.end, w, null, O, i);
|
|
2645
|
+
c.items.push(I), f = I.range[2], nt(k) && i(I.range, "BLOCK_IN_FLOW", st);
|
|
2630
2646
|
} else {
|
|
2631
2647
|
t.atKey = !0;
|
|
2632
|
-
const I =
|
|
2633
|
-
nt(
|
|
2634
|
-
const _ = ue(
|
|
2648
|
+
const I = O.end, g = N ? s(t, N, O, i) : e(t, I, S, null, O, i);
|
|
2649
|
+
nt(N) && i(g.range, "BLOCK_IN_FLOW", st), t.atKey = !1;
|
|
2650
|
+
const _ = ue(w ?? [], {
|
|
2635
2651
|
flow: l,
|
|
2636
2652
|
indicator: "map-value-ind",
|
|
2637
|
-
next:
|
|
2653
|
+
next: k,
|
|
2638
2654
|
offset: g.range[2],
|
|
2639
2655
|
onError: i,
|
|
2640
2656
|
parentIndent: n.indent,
|
|
2641
2657
|
startOnNewline: !1
|
|
2642
2658
|
});
|
|
2643
2659
|
if (_.found) {
|
|
2644
|
-
if (!o && !
|
|
2645
|
-
if (
|
|
2646
|
-
for (const C of
|
|
2660
|
+
if (!o && !O.found && t.options.strict) {
|
|
2661
|
+
if (w)
|
|
2662
|
+
for (const C of w) {
|
|
2647
2663
|
if (C === _.found)
|
|
2648
2664
|
break;
|
|
2649
2665
|
if (C.type === "newline") {
|
|
@@ -2651,11 +2667,11 @@ function un({ composeNode: s, composeEmptyNode: e }, t, n, i, r) {
|
|
|
2651
2667
|
break;
|
|
2652
2668
|
}
|
|
2653
2669
|
}
|
|
2654
|
-
|
|
2670
|
+
O.start < _.found.offset - 1024 && i(_.found, "KEY_OVER_1024_CHARS", "The : indicator must be at most 1024 chars after the start of an implicit flow sequence key");
|
|
2655
2671
|
}
|
|
2656
|
-
} else
|
|
2657
|
-
const J =
|
|
2658
|
-
J ? nt(
|
|
2672
|
+
} else k && ("source" in k && k.source && k.source[0] === ":" ? i(k, "MISSING_CHAR", `Missing space after : in ${l}`) : i(_.start, "MISSING_CHAR", `Missing , or : between ${l} items`));
|
|
2673
|
+
const J = k ? s(t, k, _, i) : _.found ? e(t, _.end, w, null, _, i) : null;
|
|
2674
|
+
J ? nt(k) && i(J.range, "BLOCK_IN_FLOW", st) : _.comment && (g.comment ? g.comment += `
|
|
2659
2675
|
` + _.comment : g.comment = _.comment);
|
|
2660
2676
|
const te = new v(g, J);
|
|
2661
2677
|
if (t.options.keepSourceTokens && (te.srcToken = b), o) {
|
|
@@ -2670,20 +2686,20 @@ function un({ composeNode: s, composeEmptyNode: e }, t, n, i, r) {
|
|
|
2670
2686
|
f = J ? J.range[2] : _.end;
|
|
2671
2687
|
}
|
|
2672
2688
|
}
|
|
2673
|
-
const
|
|
2674
|
-
let
|
|
2675
|
-
if (
|
|
2676
|
-
|
|
2689
|
+
const d = o ? "}" : "]", [h, ...y] = n.end;
|
|
2690
|
+
let u = f;
|
|
2691
|
+
if (h && h.source === d)
|
|
2692
|
+
u = h.offset + h.source.length;
|
|
2677
2693
|
else {
|
|
2678
|
-
const
|
|
2679
|
-
i(f,
|
|
2694
|
+
const m = l[0].toUpperCase() + l.substring(1), b = p ? `${m} must end with a ${d}` : `${m} in block collection must be sufficiently indented and end with a ${d}`;
|
|
2695
|
+
i(f, p ? "MISSING_CHAR" : "BAD_INDENT", b), h && h.source.length !== 1 && y.unshift(h);
|
|
2680
2696
|
}
|
|
2681
2697
|
if (y.length > 0) {
|
|
2682
|
-
const
|
|
2683
|
-
|
|
2684
|
-
` +
|
|
2698
|
+
const m = Ie(y, u, t.options.strict, i);
|
|
2699
|
+
m.comment && (c.comment ? c.comment += `
|
|
2700
|
+
` + m.comment : c.comment = m.comment), c.range = [n.offset, u, m.offset];
|
|
2685
2701
|
} else
|
|
2686
|
-
c.range = [n.offset,
|
|
2702
|
+
c.range = [n.offset, u, u];
|
|
2687
2703
|
return c;
|
|
2688
2704
|
}
|
|
2689
2705
|
function it(s, e, t, n, i, r) {
|
|
@@ -2691,87 +2707,88 @@ function it(s, e, t, n, i, r) {
|
|
|
2691
2707
|
return i === "!" || i === l.tagName ? (o.tag = l.tagName, o) : (i && (o.tag = i), o);
|
|
2692
2708
|
}
|
|
2693
2709
|
function hn(s, e, t, n, i) {
|
|
2694
|
-
|
|
2710
|
+
var d;
|
|
2711
|
+
const r = n.tag, o = r ? e.directives.tagName(r.source, (h) => i(r, "TAG_RESOLVE_FAILED", h)) : null;
|
|
2695
2712
|
if (t.type === "block-seq") {
|
|
2696
|
-
const { anchor:
|
|
2697
|
-
|
|
2713
|
+
const { anchor: h, newlineAfterProp: y } = n, u = h && r ? h.offset > r.offset ? h : r : h ?? r;
|
|
2714
|
+
u && (!y || y.offset < u.offset) && i(u, "MISSING_CHAR", "Missing newline after block sequence props");
|
|
2698
2715
|
}
|
|
2699
2716
|
const l = t.type === "block-map" ? "map" : t.type === "block-seq" ? "seq" : t.start.source === "{" ? "map" : "seq";
|
|
2700
2717
|
if (!r || !o || o === "!" || o === K.tagName && l === "map" || o === W.tagName && l === "seq")
|
|
2701
2718
|
return it(s, e, t, i, o);
|
|
2702
|
-
let a = e.schema.tags.find((
|
|
2719
|
+
let a = e.schema.tags.find((h) => h.tag === o && h.collection === l);
|
|
2703
2720
|
if (!a) {
|
|
2704
|
-
const
|
|
2705
|
-
if (
|
|
2706
|
-
e.schema.tags.push(Object.assign({},
|
|
2721
|
+
const h = e.schema.knownTags[o];
|
|
2722
|
+
if (h && h.collection === l)
|
|
2723
|
+
e.schema.tags.push(Object.assign({}, h, { default: !1 })), a = h;
|
|
2707
2724
|
else
|
|
2708
|
-
return
|
|
2725
|
+
return h ? i(r, "BAD_COLLECTION_TYPE", `${h.tag} used for ${l} collection, but expects ${h.collection ?? "scalar"}`, !0) : i(r, "TAG_RESOLVE_FAILED", `Unresolved tag: ${o}`, !0), it(s, e, t, i, o);
|
|
2709
2726
|
}
|
|
2710
|
-
const c = it(s, e, t, i, o, a), d = a.resolve
|
|
2711
|
-
return f.range = c.range, f.tag = o, a
|
|
2727
|
+
const c = it(s, e, t, i, o, a), p = ((d = a.resolve) == null ? void 0 : d.call(a, c, (h) => i(r, "TAG_RESOLVE_FAILED", h), e.options)) ?? c, f = $(p) ? p : new A(p);
|
|
2728
|
+
return f.range = c.range, f.tag = o, a != null && a.format && (f.format = a.format), f;
|
|
2712
2729
|
}
|
|
2713
2730
|
function bs(s, e, t) {
|
|
2714
2731
|
const n = e.offset, i = dn(e, s.options.strict, t);
|
|
2715
2732
|
if (!i)
|
|
2716
2733
|
return { value: "", type: null, comment: "", range: [n, n, n] };
|
|
2717
|
-
const r = i.mode === ">" ?
|
|
2734
|
+
const r = i.mode === ">" ? A.BLOCK_FOLDED : A.BLOCK_LITERAL, o = e.source ? pn(e.source) : [];
|
|
2718
2735
|
let l = o.length;
|
|
2719
|
-
for (let
|
|
2720
|
-
const
|
|
2721
|
-
if (
|
|
2722
|
-
l =
|
|
2736
|
+
for (let u = o.length - 1; u >= 0; --u) {
|
|
2737
|
+
const m = o[u][1];
|
|
2738
|
+
if (m === "" || m === "\r")
|
|
2739
|
+
l = u;
|
|
2723
2740
|
else
|
|
2724
2741
|
break;
|
|
2725
2742
|
}
|
|
2726
2743
|
if (l === 0) {
|
|
2727
|
-
const
|
|
2744
|
+
const u = i.chomp === "+" && o.length > 0 ? `
|
|
2728
2745
|
`.repeat(Math.max(1, o.length - 1)) : "";
|
|
2729
|
-
let
|
|
2730
|
-
return e.source && (
|
|
2746
|
+
let m = n + i.length;
|
|
2747
|
+
return e.source && (m += e.source.length), { value: u, type: r, comment: i.comment, range: [n, m, m] };
|
|
2731
2748
|
}
|
|
2732
|
-
let a = e.indent + i.indent, c = e.offset + i.length,
|
|
2733
|
-
for (let
|
|
2734
|
-
const [
|
|
2749
|
+
let a = e.indent + i.indent, c = e.offset + i.length, p = 0;
|
|
2750
|
+
for (let u = 0; u < l; ++u) {
|
|
2751
|
+
const [m, b] = o[u];
|
|
2735
2752
|
if (b === "" || b === "\r")
|
|
2736
|
-
i.indent === 0 &&
|
|
2753
|
+
i.indent === 0 && m.length > a && (a = m.length);
|
|
2737
2754
|
else {
|
|
2738
|
-
|
|
2755
|
+
m.length < a && t(c + m.length, "MISSING_CHAR", "Block scalars with more-indented leading empty lines must use an explicit indentation indicator"), i.indent === 0 && (a = m.length), p = u, a === 0 && !s.atRoot && t(c, "BAD_INDENT", "Block scalar values in collections must be indented");
|
|
2739
2756
|
break;
|
|
2740
2757
|
}
|
|
2741
|
-
c +=
|
|
2758
|
+
c += m.length + b.length + 1;
|
|
2742
2759
|
}
|
|
2743
|
-
for (let
|
|
2744
|
-
o[
|
|
2745
|
-
let f = "",
|
|
2746
|
-
for (let
|
|
2747
|
-
f += o[
|
|
2760
|
+
for (let u = o.length - 1; u >= l; --u)
|
|
2761
|
+
o[u][0].length > a && (l = u + 1);
|
|
2762
|
+
let f = "", d = "", h = !1;
|
|
2763
|
+
for (let u = 0; u < p; ++u)
|
|
2764
|
+
f += o[u][0].slice(a) + `
|
|
2748
2765
|
`;
|
|
2749
|
-
for (let
|
|
2750
|
-
let [
|
|
2751
|
-
c +=
|
|
2752
|
-
const
|
|
2753
|
-
if (
|
|
2754
|
-
const
|
|
2755
|
-
t(c - b.length - (
|
|
2766
|
+
for (let u = p; u < l; ++u) {
|
|
2767
|
+
let [m, b] = o[u];
|
|
2768
|
+
c += m.length + b.length + 1;
|
|
2769
|
+
const S = b[b.length - 1] === "\r";
|
|
2770
|
+
if (S && (b = b.slice(0, -1)), b && m.length < a) {
|
|
2771
|
+
const w = `Block scalar lines must not be less indented than their ${i.indent ? "explicit indentation indicator" : "first line"}`;
|
|
2772
|
+
t(c - b.length - (S ? 2 : 1), "BAD_INDENT", w), m = "";
|
|
2756
2773
|
}
|
|
2757
|
-
r ===
|
|
2758
|
-
`) :
|
|
2759
|
-
` : !
|
|
2760
|
-
` && (
|
|
2774
|
+
r === A.BLOCK_LITERAL ? (f += d + m.slice(a) + b, d = `
|
|
2775
|
+
`) : m.length > a || b[0] === " " ? (d === " " ? d = `
|
|
2776
|
+
` : !h && d === `
|
|
2777
|
+
` && (d = `
|
|
2761
2778
|
|
|
2762
|
-
`), f +=
|
|
2763
|
-
`,
|
|
2779
|
+
`), f += d + m.slice(a) + b, d = `
|
|
2780
|
+
`, h = !0) : b === "" ? d === `
|
|
2764
2781
|
` ? f += `
|
|
2765
|
-
` :
|
|
2766
|
-
` : (f +=
|
|
2782
|
+
` : d = `
|
|
2783
|
+
` : (f += d + b, d = " ", h = !1);
|
|
2767
2784
|
}
|
|
2768
2785
|
switch (i.chomp) {
|
|
2769
2786
|
case "-":
|
|
2770
2787
|
break;
|
|
2771
2788
|
case "+":
|
|
2772
|
-
for (let
|
|
2789
|
+
for (let u = l; u < o.length; ++u)
|
|
2773
2790
|
f += `
|
|
2774
|
-
` + o[
|
|
2791
|
+
` + o[u][0].slice(a);
|
|
2775
2792
|
f[f.length - 1] !== `
|
|
2776
2793
|
` && (f += `
|
|
2777
2794
|
`);
|
|
@@ -2788,45 +2805,45 @@ function dn({ offset: s, props: e }, t, n) {
|
|
|
2788
2805
|
return n(e[0], "IMPOSSIBLE", "Block scalar header not found"), null;
|
|
2789
2806
|
const { source: i } = e[0], r = i[0];
|
|
2790
2807
|
let o = 0, l = "", a = -1;
|
|
2791
|
-
for (let
|
|
2792
|
-
const
|
|
2793
|
-
if (!l && (
|
|
2794
|
-
l =
|
|
2808
|
+
for (let d = 1; d < i.length; ++d) {
|
|
2809
|
+
const h = i[d];
|
|
2810
|
+
if (!l && (h === "-" || h === "+"))
|
|
2811
|
+
l = h;
|
|
2795
2812
|
else {
|
|
2796
|
-
const y = Number(
|
|
2797
|
-
!o && y ? o = y : a === -1 && (a = s +
|
|
2813
|
+
const y = Number(h);
|
|
2814
|
+
!o && y ? o = y : a === -1 && (a = s + d);
|
|
2798
2815
|
}
|
|
2799
2816
|
}
|
|
2800
2817
|
a !== -1 && n(a, "UNEXPECTED_TOKEN", `Block scalar header includes extra characters: ${i}`);
|
|
2801
|
-
let c = !1,
|
|
2802
|
-
for (let
|
|
2803
|
-
const
|
|
2804
|
-
switch (
|
|
2818
|
+
let c = !1, p = "", f = i.length;
|
|
2819
|
+
for (let d = 1; d < e.length; ++d) {
|
|
2820
|
+
const h = e[d];
|
|
2821
|
+
switch (h.type) {
|
|
2805
2822
|
case "space":
|
|
2806
2823
|
c = !0;
|
|
2807
2824
|
// fallthrough
|
|
2808
2825
|
case "newline":
|
|
2809
|
-
f +=
|
|
2826
|
+
f += h.source.length;
|
|
2810
2827
|
break;
|
|
2811
2828
|
case "comment":
|
|
2812
|
-
t && !c && n(
|
|
2829
|
+
t && !c && n(h, "MISSING_CHAR", "Comments must be separated from other tokens by white space characters"), f += h.source.length, p = h.source.substring(1);
|
|
2813
2830
|
break;
|
|
2814
2831
|
case "error":
|
|
2815
|
-
n(
|
|
2832
|
+
n(h, "UNEXPECTED_TOKEN", h.message), f += h.source.length;
|
|
2816
2833
|
break;
|
|
2817
2834
|
/* istanbul ignore next should not happen */
|
|
2818
2835
|
default: {
|
|
2819
|
-
const y = `Unexpected token in block scalar header: ${
|
|
2820
|
-
n(
|
|
2821
|
-
const
|
|
2822
|
-
|
|
2836
|
+
const y = `Unexpected token in block scalar header: ${h.type}`;
|
|
2837
|
+
n(h, "UNEXPECTED_TOKEN", y);
|
|
2838
|
+
const u = h.source;
|
|
2839
|
+
u && typeof u == "string" && (f += u.length);
|
|
2823
2840
|
}
|
|
2824
2841
|
}
|
|
2825
2842
|
}
|
|
2826
|
-
return { mode: r, indent: o, chomp: l, comment:
|
|
2843
|
+
return { mode: r, indent: o, chomp: l, comment: p, length: f };
|
|
2827
2844
|
}
|
|
2828
2845
|
function pn(s) {
|
|
2829
|
-
const e = s.split(/\n( *)/), t = e[0], n = t.match(/^( *)/), r = [n
|
|
2846
|
+
const e = s.split(/\n( *)/), t = e[0], n = t.match(/^( *)/), r = [n != null && n[1] ? [n[1], t.slice(n[1].length)] : ["", t]];
|
|
2830
2847
|
for (let o = 1; o < e.length; o += 2)
|
|
2831
2848
|
r.push([e[o], e[o + 1]]);
|
|
2832
2849
|
return r;
|
|
@@ -2834,16 +2851,16 @@ function pn(s) {
|
|
|
2834
2851
|
function ws(s, e, t) {
|
|
2835
2852
|
const { offset: n, type: i, source: r, end: o } = s;
|
|
2836
2853
|
let l, a;
|
|
2837
|
-
const c = (
|
|
2854
|
+
const c = (d, h, y) => t(n + d, h, y);
|
|
2838
2855
|
switch (i) {
|
|
2839
2856
|
case "scalar":
|
|
2840
|
-
l =
|
|
2857
|
+
l = A.PLAIN, a = mn(r, c);
|
|
2841
2858
|
break;
|
|
2842
2859
|
case "single-quoted-scalar":
|
|
2843
|
-
l =
|
|
2860
|
+
l = A.QUOTE_SINGLE, a = yn(r, c);
|
|
2844
2861
|
break;
|
|
2845
2862
|
case "double-quoted-scalar":
|
|
2846
|
-
l =
|
|
2863
|
+
l = A.QUOTE_DOUBLE, a = gn(r, c);
|
|
2847
2864
|
break;
|
|
2848
2865
|
/* istanbul ignore next should not happen */
|
|
2849
2866
|
default:
|
|
@@ -2854,12 +2871,12 @@ function ws(s, e, t) {
|
|
|
2854
2871
|
range: [n, n + r.length, n + r.length]
|
|
2855
2872
|
};
|
|
2856
2873
|
}
|
|
2857
|
-
const
|
|
2874
|
+
const p = n + r.length, f = Ie(o, p, e, t);
|
|
2858
2875
|
return {
|
|
2859
2876
|
value: a,
|
|
2860
2877
|
type: l,
|
|
2861
2878
|
comment: f.comment,
|
|
2862
|
-
range: [n,
|
|
2879
|
+
range: [n, p, f.offset]
|
|
2863
2880
|
};
|
|
2864
2881
|
}
|
|
2865
2882
|
function mn(s, e) {
|
|
@@ -2909,7 +2926,7 @@ function Ss(s) {
|
|
|
2909
2926
|
` ? i += r : r = `
|
|
2910
2927
|
` : (i += r + n[1], r = " "), o = t.lastIndex;
|
|
2911
2928
|
const l = /[ \t]*(.*)/sy;
|
|
2912
|
-
return l.lastIndex = o, n = l.exec(s), i + r + (n
|
|
2929
|
+
return l.lastIndex = o, n = l.exec(s), i + r + ((n == null ? void 0 : n[1]) ?? "");
|
|
2913
2930
|
}
|
|
2914
2931
|
function gn(s, e) {
|
|
2915
2932
|
let t = "";
|
|
@@ -3010,39 +3027,46 @@ function ks(s, e, t, n) {
|
|
|
3010
3027
|
const { value: i, type: r, comment: o, range: l } = e.type === "block-scalar" ? bs(s, e, n) : ws(e, s.options.strict, n), a = t ? s.directives.tagName(t.source, (f) => n(t, "TAG_RESOLVE_FAILED", f)) : null;
|
|
3011
3028
|
let c;
|
|
3012
3029
|
s.options.stringKeys && s.atKey ? c = s.schema[R] : a ? c = kn(s.schema, i, a, t, n) : e.type === "scalar" ? c = Nn(s, i, e, n) : c = s.schema[R];
|
|
3013
|
-
let
|
|
3030
|
+
let p;
|
|
3014
3031
|
try {
|
|
3015
|
-
const f = c.resolve(i, (
|
|
3016
|
-
|
|
3032
|
+
const f = c.resolve(i, (d) => n(t ?? e, "TAG_RESOLVE_FAILED", d), s.options);
|
|
3033
|
+
p = E(f) ? f : new A(f);
|
|
3017
3034
|
} catch (f) {
|
|
3018
|
-
const
|
|
3019
|
-
n(t ?? e, "TAG_RESOLVE_FAILED",
|
|
3035
|
+
const d = f instanceof Error ? f.message : String(f);
|
|
3036
|
+
n(t ?? e, "TAG_RESOLVE_FAILED", d), p = new A(i);
|
|
3020
3037
|
}
|
|
3021
|
-
return
|
|
3038
|
+
return p.range = l, p.source = i, r && (p.type = r), a && (p.tag = a), c.format && (p.format = c.format), o && (p.comment = o), p;
|
|
3022
3039
|
}
|
|
3023
3040
|
function kn(s, e, t, n, i) {
|
|
3041
|
+
var l;
|
|
3024
3042
|
if (t === "!")
|
|
3025
3043
|
return s[R];
|
|
3026
3044
|
const r = [];
|
|
3027
|
-
for (const
|
|
3028
|
-
if (!
|
|
3029
|
-
if (
|
|
3030
|
-
r.push(
|
|
3045
|
+
for (const a of s.tags)
|
|
3046
|
+
if (!a.collection && a.tag === t)
|
|
3047
|
+
if (a.default && a.test)
|
|
3048
|
+
r.push(a);
|
|
3031
3049
|
else
|
|
3032
|
-
return
|
|
3033
|
-
for (const
|
|
3034
|
-
if (l.test
|
|
3035
|
-
return
|
|
3050
|
+
return a;
|
|
3051
|
+
for (const a of r)
|
|
3052
|
+
if ((l = a.test) != null && l.test(e))
|
|
3053
|
+
return a;
|
|
3036
3054
|
const o = s.knownTags[t];
|
|
3037
3055
|
return o && !o.collection ? (s.tags.push(Object.assign({}, o, { default: !1, test: void 0 })), o) : (i(n, "TAG_RESOLVE_FAILED", `Unresolved tag: ${t}`, t !== "tag:yaml.org,2002:str"), s[R]);
|
|
3038
3056
|
}
|
|
3039
3057
|
function Nn({ atKey: s, directives: e, schema: t }, n, i, r) {
|
|
3040
|
-
const o = t.tags.find((l) =>
|
|
3058
|
+
const o = t.tags.find((l) => {
|
|
3059
|
+
var a;
|
|
3060
|
+
return (l.default === !0 || s && l.default === "key") && ((a = l.test) == null ? void 0 : a.test(n));
|
|
3061
|
+
}) || t[R];
|
|
3041
3062
|
if (t.compat) {
|
|
3042
|
-
const l = t.compat.find((a) =>
|
|
3063
|
+
const l = t.compat.find((a) => {
|
|
3064
|
+
var c;
|
|
3065
|
+
return a.default && ((c = a.test) == null ? void 0 : c.test(n));
|
|
3066
|
+
}) ?? t[R];
|
|
3043
3067
|
if (o.tag !== l.tag) {
|
|
3044
|
-
const a = e.tagString(o.tag), c = e.tagString(l.tag),
|
|
3045
|
-
r(i, "TAG_RESOLVE_FAILED",
|
|
3068
|
+
const a = e.tagString(o.tag), c = e.tagString(l.tag), p = `Value may be parsed as either ${a} or ${c}`;
|
|
3069
|
+
r(i, "TAG_RESOLVE_FAILED", p, !0);
|
|
3046
3070
|
}
|
|
3047
3071
|
}
|
|
3048
3072
|
return o;
|
|
@@ -3059,7 +3083,7 @@ function On(s, e, t) {
|
|
|
3059
3083
|
s -= i.source.length;
|
|
3060
3084
|
continue;
|
|
3061
3085
|
}
|
|
3062
|
-
for (i = e[++n]; i
|
|
3086
|
+
for (i = e[++n]; (i == null ? void 0 : i.type) === "space"; )
|
|
3063
3087
|
s += i.source.length, i = e[++n];
|
|
3064
3088
|
break;
|
|
3065
3089
|
}
|
|
@@ -3069,7 +3093,7 @@ function On(s, e, t) {
|
|
|
3069
3093
|
const An = { composeNode: Ns, composeEmptyNode: Et };
|
|
3070
3094
|
function Ns(s, e, t, n) {
|
|
3071
3095
|
const i = s.atKey, { spaceBefore: r, comment: o, anchor: l, tag: a } = t;
|
|
3072
|
-
let c,
|
|
3096
|
+
let c, p = !0;
|
|
3073
3097
|
switch (e.type) {
|
|
3074
3098
|
case "alias":
|
|
3075
3099
|
c = En(s, e, n), (l || a) && n(e, "ALIAS_PROPS", "An alias node must not specify any properties");
|
|
@@ -3087,18 +3111,18 @@ function Ns(s, e, t, n) {
|
|
|
3087
3111
|
break;
|
|
3088
3112
|
default: {
|
|
3089
3113
|
const f = e.type === "error" ? e.message : `Unsupported token (type: ${e.type})`;
|
|
3090
|
-
n(e, "UNEXPECTED_TOKEN", f), c = Et(s, e.offset, void 0, null, t, n),
|
|
3114
|
+
n(e, "UNEXPECTED_TOKEN", f), c = Et(s, e.offset, void 0, null, t, n), p = !1;
|
|
3091
3115
|
}
|
|
3092
3116
|
}
|
|
3093
|
-
return l && c.anchor === "" && n(l, "BAD_ALIAS", "Anchor cannot be an empty string"), i && s.options.stringKeys && (!E(c) || typeof c.value != "string" || c.tag && c.tag !== "tag:yaml.org,2002:str") && n(a ?? e, "NON_STRING_KEY", "With stringKeys, all keys must be strings"), r && (c.spaceBefore = !0), o && (e.type === "scalar" && e.source === "" ? c.comment = o : c.commentBefore = o), s.options.keepSourceTokens &&
|
|
3117
|
+
return l && c.anchor === "" && n(l, "BAD_ALIAS", "Anchor cannot be an empty string"), i && s.options.stringKeys && (!E(c) || typeof c.value != "string" || c.tag && c.tag !== "tag:yaml.org,2002:str") && n(a ?? e, "NON_STRING_KEY", "With stringKeys, all keys must be strings"), r && (c.spaceBefore = !0), o && (e.type === "scalar" && e.source === "" ? c.comment = o : c.commentBefore = o), s.options.keepSourceTokens && p && (c.srcToken = e), c;
|
|
3094
3118
|
}
|
|
3095
3119
|
function Et(s, e, t, n, { spaceBefore: i, comment: r, anchor: o, tag: l, end: a }, c) {
|
|
3096
|
-
const
|
|
3120
|
+
const p = {
|
|
3097
3121
|
type: "scalar",
|
|
3098
3122
|
offset: On(e, t, n),
|
|
3099
3123
|
indent: -1,
|
|
3100
3124
|
source: ""
|
|
3101
|
-
}, f = ks(s,
|
|
3125
|
+
}, f = ks(s, p, l, c);
|
|
3102
3126
|
return o && (f.anchor = o.source.substring(1), f.anchor === "" && c(o, "BAD_ALIAS", "Anchor cannot be an empty string")), i && (f.spaceBefore = !0), r && (f.comment = r, f.range[2] = a), f;
|
|
3103
3127
|
}
|
|
3104
3128
|
function En({ options: s }, { offset: e, source: t, end: n }, i) {
|
|
@@ -3114,17 +3138,17 @@ function In(s, e, { offset: t, start: n, value: i, end: r }, o) {
|
|
|
3114
3138
|
directives: a.directives,
|
|
3115
3139
|
options: a.options,
|
|
3116
3140
|
schema: a.schema
|
|
3117
|
-
},
|
|
3141
|
+
}, p = ue(n, {
|
|
3118
3142
|
indicator: "doc-start",
|
|
3119
|
-
next: i ?? r
|
|
3143
|
+
next: i ?? (r == null ? void 0 : r[0]),
|
|
3120
3144
|
offset: t,
|
|
3121
3145
|
onError: o,
|
|
3122
3146
|
parentIndent: 0,
|
|
3123
3147
|
startOnNewline: !0
|
|
3124
3148
|
});
|
|
3125
|
-
|
|
3126
|
-
const f = a.contents.range[2],
|
|
3127
|
-
return
|
|
3149
|
+
p.found && (a.directives.docStart = !0, i && (i.type === "block-map" || i.type === "block-seq") && !p.hasNewline && o(p.end, "MISSING_CHAR", "Block collection cannot start on same line with directives-end marker")), a.contents = i ? Ns(c, i, p, o) : Et(c, p.end, n, null, p, o);
|
|
3150
|
+
const f = a.contents.range[2], d = Ie(r, f, !1, o);
|
|
3151
|
+
return d.comment && (a.comment = d.comment), a.range = [t, f, d.offset], a;
|
|
3128
3152
|
}
|
|
3129
3153
|
function be(s) {
|
|
3130
3154
|
if (typeof s == "number")
|
|
@@ -3135,18 +3159,19 @@ function be(s) {
|
|
|
3135
3159
|
return [e, e + (typeof t == "string" ? t.length : 1)];
|
|
3136
3160
|
}
|
|
3137
3161
|
function Kt(s) {
|
|
3162
|
+
var i;
|
|
3138
3163
|
let e = "", t = !1, n = !1;
|
|
3139
|
-
for (let
|
|
3140
|
-
const
|
|
3141
|
-
switch (
|
|
3164
|
+
for (let r = 0; r < s.length; ++r) {
|
|
3165
|
+
const o = s[r];
|
|
3166
|
+
switch (o[0]) {
|
|
3142
3167
|
case "#":
|
|
3143
3168
|
e += (e === "" ? "" : n ? `
|
|
3144
3169
|
|
|
3145
3170
|
` : `
|
|
3146
|
-
`) + (
|
|
3171
|
+
`) + (o.substring(1) || " "), t = !0, n = !1;
|
|
3147
3172
|
break;
|
|
3148
3173
|
case "%":
|
|
3149
|
-
s[
|
|
3174
|
+
((i = s[r + 1]) == null ? void 0 : i[0]) !== "#" && (r += 1), t = !1;
|
|
3150
3175
|
break;
|
|
3151
3176
|
default:
|
|
3152
3177
|
t || (n = !0), t = !1;
|
|
@@ -3303,12 +3328,12 @@ function Ln(s, e) {
|
|
|
3303
3328
|
case "|":
|
|
3304
3329
|
case ">": {
|
|
3305
3330
|
const c = l.indexOf(`
|
|
3306
|
-
`),
|
|
3307
|
-
`,
|
|
3308
|
-
{ type: "block-scalar-header", offset: r, indent: n, source:
|
|
3331
|
+
`), p = l.substring(0, c), f = l.substring(c + 1) + `
|
|
3332
|
+
`, d = [
|
|
3333
|
+
{ type: "block-scalar-header", offset: r, indent: n, source: p }
|
|
3309
3334
|
];
|
|
3310
|
-
return Os(
|
|
3311
|
-
` }), { type: "block-scalar", offset: r, indent: n, props:
|
|
3335
|
+
return Os(d, a) || d.push({ type: "newline", offset: -1, indent: n, source: `
|
|
3336
|
+
` }), { type: "block-scalar", offset: r, indent: n, props: d, source: f };
|
|
3312
3337
|
}
|
|
3313
3338
|
case '"':
|
|
3314
3339
|
return { type: "double-quoted-scalar", offset: r, indent: n, source: l, end: a };
|
|
@@ -3473,16 +3498,16 @@ function Ke({ start: s, key: e, sep: t, value: n }) {
|
|
|
3473
3498
|
return n && (i += qe(n)), i;
|
|
3474
3499
|
}
|
|
3475
3500
|
const ht = Symbol("break visit"), vn = Symbol("skip children"), As = Symbol("remove item");
|
|
3476
|
-
function
|
|
3501
|
+
function Z(s, e) {
|
|
3477
3502
|
"type" in s && s.type === "document" && (s = { start: s.start, value: s.value }), Es(Object.freeze([]), s, e);
|
|
3478
3503
|
}
|
|
3479
|
-
|
|
3480
|
-
|
|
3481
|
-
|
|
3482
|
-
|
|
3504
|
+
Z.BREAK = ht;
|
|
3505
|
+
Z.SKIP = vn;
|
|
3506
|
+
Z.REMOVE = As;
|
|
3507
|
+
Z.itemAtPath = (s, e) => {
|
|
3483
3508
|
let t = s;
|
|
3484
3509
|
for (const [n, i] of e) {
|
|
3485
|
-
const r = t
|
|
3510
|
+
const r = t == null ? void 0 : t[n];
|
|
3486
3511
|
if (r && "items" in r)
|
|
3487
3512
|
t = r.items[i];
|
|
3488
3513
|
else
|
|
@@ -3490,8 +3515,8 @@ x.itemAtPath = (s, e) => {
|
|
|
3490
3515
|
}
|
|
3491
3516
|
return t;
|
|
3492
3517
|
};
|
|
3493
|
-
|
|
3494
|
-
const t =
|
|
3518
|
+
Z.parentCollection = (s, e) => {
|
|
3519
|
+
const t = Z.itemAtPath(s, e.slice(0, -1)), n = e[e.length - 1][0], i = t == null ? void 0 : t[n];
|
|
3495
3520
|
if (i && "items" in i)
|
|
3496
3521
|
return i;
|
|
3497
3522
|
throw new Error("Parent collection not found");
|
|
@@ -3518,14 +3543,14 @@ function Es(s, e, t) {
|
|
|
3518
3543
|
}
|
|
3519
3544
|
return typeof n == "function" ? n(e, s) : n;
|
|
3520
3545
|
}
|
|
3521
|
-
const ze = "\uFEFF",
|
|
3546
|
+
const ze = "\uFEFF", Ze = "", xe = "", Oe = "", Bn = (s) => !!s && "items" in s, Mn = (s) => !!s && (s.type === "scalar" || s.type === "single-quoted-scalar" || s.type === "double-quoted-scalar" || s.type === "block-scalar");
|
|
3522
3547
|
function Kn(s) {
|
|
3523
3548
|
switch (s) {
|
|
3524
3549
|
case ze:
|
|
3525
3550
|
return "<BOM>";
|
|
3526
|
-
case xe:
|
|
3527
|
-
return "<DOC>";
|
|
3528
3551
|
case Ze:
|
|
3552
|
+
return "<DOC>";
|
|
3553
|
+
case xe:
|
|
3529
3554
|
return "<FLOW_END>";
|
|
3530
3555
|
case Oe:
|
|
3531
3556
|
return "<SCALAR>";
|
|
@@ -3537,9 +3562,9 @@ function Is(s) {
|
|
|
3537
3562
|
switch (s) {
|
|
3538
3563
|
case ze:
|
|
3539
3564
|
return "byte-order-mark";
|
|
3540
|
-
case xe:
|
|
3541
|
-
return "doc-mode";
|
|
3542
3565
|
case Ze:
|
|
3566
|
+
return "doc-mode";
|
|
3567
|
+
case xe:
|
|
3543
3568
|
return "flow-error-end";
|
|
3544
3569
|
case Oe:
|
|
3545
3570
|
return "scalar";
|
|
@@ -3594,11 +3619,11 @@ function Is(s) {
|
|
|
3594
3619
|
}
|
|
3595
3620
|
return null;
|
|
3596
3621
|
}
|
|
3597
|
-
const
|
|
3622
|
+
const Pn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3598
3623
|
__proto__: null,
|
|
3599
3624
|
BOM: ze,
|
|
3600
|
-
DOCUMENT:
|
|
3601
|
-
FLOW_END:
|
|
3625
|
+
DOCUMENT: Ze,
|
|
3626
|
+
FLOW_END: xe,
|
|
3602
3627
|
SCALAR: Oe,
|
|
3603
3628
|
createScalarToken: Ln,
|
|
3604
3629
|
isCollection: Bn,
|
|
@@ -3608,7 +3633,7 @@ const jn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
3608
3633
|
setScalarValue: $n,
|
|
3609
3634
|
stringify: Cn,
|
|
3610
3635
|
tokenType: Is,
|
|
3611
|
-
visit:
|
|
3636
|
+
visit: Z
|
|
3612
3637
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3613
3638
|
function D(s) {
|
|
3614
3639
|
switch (s) {
|
|
@@ -3623,7 +3648,7 @@ function D(s) {
|
|
|
3623
3648
|
return !1;
|
|
3624
3649
|
}
|
|
3625
3650
|
}
|
|
3626
|
-
const
|
|
3651
|
+
const Pt = new Set("0123456789ABCDEFabcdef"), jn = new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"), _e = new Set(",[]{}"), Dn = new Set(` ,[]{}
|
|
3627
3652
|
\r `), ot = (s) => !s || Dn.has(s);
|
|
3628
3653
|
class Ts {
|
|
3629
3654
|
constructor() {
|
|
@@ -3741,7 +3766,7 @@ class Ts {
|
|
|
3741
3766
|
const t = yield* this.pushSpaces(!0);
|
|
3742
3767
|
return yield* this.pushCount(e.length - t), yield* this.pushNewline(), "stream";
|
|
3743
3768
|
}
|
|
3744
|
-
return yield
|
|
3769
|
+
return yield Ze, yield* this.parseLineStart();
|
|
3745
3770
|
}
|
|
3746
3771
|
*parseLineStart() {
|
|
3747
3772
|
const e = this.charAt(0);
|
|
@@ -3805,7 +3830,7 @@ class Ts {
|
|
|
3805
3830
|
if (i === null)
|
|
3806
3831
|
return this.setNext("flow");
|
|
3807
3832
|
if ((n !== -1 && n < this.indentNext && i[0] !== "#" || n === 0 && (i.startsWith("---") || i.startsWith("...")) && D(i[3])) && !(n === this.indentNext - 1 && this.flowLevel === 1 && (i[0] === "]" || i[0] === "}")))
|
|
3808
|
-
return this.flowLevel = 0, yield
|
|
3833
|
+
return this.flowLevel = 0, yield xe, yield* this.parseLineStart();
|
|
3809
3834
|
let r = 0;
|
|
3810
3835
|
for (; i[r] === ","; )
|
|
3811
3836
|
r += yield* this.pushCount(1), r += yield* this.pushSpaces(!0), this.flowKey = !1;
|
|
@@ -4010,9 +4035,9 @@ class Ts {
|
|
|
4010
4035
|
} else {
|
|
4011
4036
|
let e = this.pos + 1, t = this.buffer[e];
|
|
4012
4037
|
for (; t; )
|
|
4013
|
-
if (
|
|
4038
|
+
if (jn.has(t))
|
|
4014
4039
|
t = this.buffer[++e];
|
|
4015
|
-
else if (t === "%" &&
|
|
4040
|
+
else if (t === "%" && Pt.has(this.buffer[e + 1]) && Pt.has(this.buffer[e + 2]))
|
|
4016
4041
|
t = this.buffer[e += 3];
|
|
4017
4042
|
else
|
|
4018
4043
|
break;
|
|
@@ -4063,7 +4088,7 @@ function Y(s, e) {
|
|
|
4063
4088
|
return !0;
|
|
4064
4089
|
return !1;
|
|
4065
4090
|
}
|
|
4066
|
-
function
|
|
4091
|
+
function jt(s) {
|
|
4067
4092
|
for (let e = 0; e < s.length; ++e)
|
|
4068
4093
|
switch (s[e].type) {
|
|
4069
4094
|
case "space":
|
|
@@ -4076,7 +4101,7 @@ function Pt(s) {
|
|
|
4076
4101
|
return -1;
|
|
4077
4102
|
}
|
|
4078
4103
|
function $s(s) {
|
|
4079
|
-
switch (s
|
|
4104
|
+
switch (s == null ? void 0 : s.type) {
|
|
4080
4105
|
case "alias":
|
|
4081
4106
|
case "scalar":
|
|
4082
4107
|
case "single-quoted-scalar":
|
|
@@ -4103,6 +4128,7 @@ function Ce(s) {
|
|
|
4103
4128
|
}
|
|
4104
4129
|
}
|
|
4105
4130
|
function ne(s) {
|
|
4131
|
+
var t;
|
|
4106
4132
|
if (s.length === 0)
|
|
4107
4133
|
return [];
|
|
4108
4134
|
let e = s.length;
|
|
@@ -4115,7 +4141,7 @@ function ne(s) {
|
|
|
4115
4141
|
case "newline":
|
|
4116
4142
|
break e;
|
|
4117
4143
|
}
|
|
4118
|
-
for (; s[++e]
|
|
4144
|
+
for (; ((t = s[++e]) == null ? void 0 : t.type) === "space"; )
|
|
4119
4145
|
;
|
|
4120
4146
|
return s.splice(e, s.length);
|
|
4121
4147
|
}
|
|
@@ -4279,7 +4305,7 @@ class Tt {
|
|
|
4279
4305
|
}
|
|
4280
4306
|
if ((n.type === "document" || n.type === "block-map" || n.type === "block-seq") && (t.type === "block-map" || t.type === "block-seq")) {
|
|
4281
4307
|
const i = t.items[t.items.length - 1];
|
|
4282
|
-
i && !i.sep && !i.value && i.start.length > 0 &&
|
|
4308
|
+
i && !i.sep && !i.value && i.start.length > 0 && jt(i.start) === -1 && (t.indent === 0 || i.start.every((r) => r.type !== "comment" || r.indent < t.indent)) && (n.type === "document" ? n.end = i.start : n.items.push({ start: i.start }), t.items.splice(-1, 1));
|
|
4283
4309
|
}
|
|
4284
4310
|
}
|
|
4285
4311
|
}
|
|
@@ -4317,7 +4343,7 @@ class Tt {
|
|
|
4317
4343
|
return yield* this.lineEnd(e);
|
|
4318
4344
|
switch (this.type) {
|
|
4319
4345
|
case "doc-start": {
|
|
4320
|
-
|
|
4346
|
+
jt(e.start) !== -1 ? (yield* this.pop(), yield* this.step()) : e.start.push(this.sourceToken);
|
|
4321
4347
|
return;
|
|
4322
4348
|
}
|
|
4323
4349
|
case "anchor":
|
|
@@ -4374,12 +4400,13 @@ class Tt {
|
|
|
4374
4400
|
}
|
|
4375
4401
|
}
|
|
4376
4402
|
*blockMap(e) {
|
|
4403
|
+
var n;
|
|
4377
4404
|
const t = e.items[e.items.length - 1];
|
|
4378
4405
|
switch (this.type) {
|
|
4379
4406
|
case "newline":
|
|
4380
4407
|
if (this.onKeyLine = !1, t.value) {
|
|
4381
|
-
const
|
|
4382
|
-
(
|
|
4408
|
+
const i = "end" in t.value ? t.value.end : void 0, r = Array.isArray(i) ? i[i.length - 1] : void 0;
|
|
4409
|
+
(r == null ? void 0 : r.type) === "comment" ? i == null || i.push(this.sourceToken) : e.items.push({ start: [this.sourceToken] });
|
|
4383
4410
|
} else t.sep ? t.sep.push(this.sourceToken) : t.start.push(this.sourceToken);
|
|
4384
4411
|
return;
|
|
4385
4412
|
case "space":
|
|
@@ -4390,9 +4417,9 @@ class Tt {
|
|
|
4390
4417
|
t.sep.push(this.sourceToken);
|
|
4391
4418
|
else {
|
|
4392
4419
|
if (this.atIndentedComment(t.start, e.indent)) {
|
|
4393
|
-
const i = e.items[e.items.length - 2]
|
|
4394
|
-
if (Array.isArray(
|
|
4395
|
-
Array.prototype.push.apply(
|
|
4420
|
+
const i = e.items[e.items.length - 2], r = (n = i == null ? void 0 : i.value) == null ? void 0 : n.end;
|
|
4421
|
+
if (Array.isArray(r)) {
|
|
4422
|
+
Array.prototype.push.apply(r, t.start), r.push(this.sourceToken), e.items.pop();
|
|
4396
4423
|
return;
|
|
4397
4424
|
}
|
|
4398
4425
|
}
|
|
@@ -4401,34 +4428,34 @@ class Tt {
|
|
|
4401
4428
|
return;
|
|
4402
4429
|
}
|
|
4403
4430
|
if (this.indent >= e.indent) {
|
|
4404
|
-
const
|
|
4405
|
-
let
|
|
4406
|
-
if (
|
|
4407
|
-
const
|
|
4408
|
-
for (let
|
|
4409
|
-
const
|
|
4410
|
-
switch (
|
|
4431
|
+
const i = !this.onKeyLine && this.indent === e.indent, r = i && (t.sep || t.explicitKey) && this.type !== "seq-item-ind";
|
|
4432
|
+
let o = [];
|
|
4433
|
+
if (r && t.sep && !t.value) {
|
|
4434
|
+
const l = [];
|
|
4435
|
+
for (let a = 0; a < t.sep.length; ++a) {
|
|
4436
|
+
const c = t.sep[a];
|
|
4437
|
+
switch (c.type) {
|
|
4411
4438
|
case "newline":
|
|
4412
|
-
|
|
4439
|
+
l.push(a);
|
|
4413
4440
|
break;
|
|
4414
4441
|
case "space":
|
|
4415
4442
|
break;
|
|
4416
4443
|
case "comment":
|
|
4417
|
-
|
|
4444
|
+
c.indent > e.indent && (l.length = 0);
|
|
4418
4445
|
break;
|
|
4419
4446
|
default:
|
|
4420
|
-
|
|
4447
|
+
l.length = 0;
|
|
4421
4448
|
}
|
|
4422
4449
|
}
|
|
4423
|
-
|
|
4450
|
+
l.length >= 2 && (o = t.sep.splice(l[1]));
|
|
4424
4451
|
}
|
|
4425
4452
|
switch (this.type) {
|
|
4426
4453
|
case "anchor":
|
|
4427
4454
|
case "tag":
|
|
4428
|
-
|
|
4455
|
+
r || t.value ? (o.push(this.sourceToken), e.items.push({ start: o }), this.onKeyLine = !0) : t.sep ? t.sep.push(this.sourceToken) : t.start.push(this.sourceToken);
|
|
4429
4456
|
return;
|
|
4430
4457
|
case "explicit-key-ind":
|
|
4431
|
-
!t.sep && !t.explicitKey ? (t.start.push(this.sourceToken), t.explicitKey = !0) :
|
|
4458
|
+
!t.sep && !t.explicitKey ? (t.start.push(this.sourceToken), t.explicitKey = !0) : r || t.value ? (o.push(this.sourceToken), e.items.push({ start: o, explicitKey: !0 })) : this.stack.push({
|
|
4432
4459
|
type: "block-map",
|
|
4433
4460
|
offset: this.offset,
|
|
4434
4461
|
indent: this.indent,
|
|
@@ -4445,30 +4472,30 @@ class Tt {
|
|
|
4445
4472
|
type: "block-map",
|
|
4446
4473
|
offset: this.offset,
|
|
4447
4474
|
indent: this.indent,
|
|
4448
|
-
items: [{ start:
|
|
4475
|
+
items: [{ start: o, key: null, sep: [this.sourceToken] }]
|
|
4449
4476
|
});
|
|
4450
4477
|
else if ($s(t.key) && !Y(t.sep, "newline")) {
|
|
4451
|
-
const
|
|
4452
|
-
|
|
4478
|
+
const l = ne(t.start), a = t.key, c = t.sep;
|
|
4479
|
+
c.push(this.sourceToken), delete t.key, delete t.sep, this.stack.push({
|
|
4453
4480
|
type: "block-map",
|
|
4454
4481
|
offset: this.offset,
|
|
4455
4482
|
indent: this.indent,
|
|
4456
|
-
items: [{ start:
|
|
4483
|
+
items: [{ start: l, key: a, sep: c }]
|
|
4457
4484
|
});
|
|
4458
|
-
} else
|
|
4485
|
+
} else o.length > 0 ? t.sep = t.sep.concat(o, this.sourceToken) : t.sep.push(this.sourceToken);
|
|
4459
4486
|
else if (Y(t.start, "newline"))
|
|
4460
4487
|
Object.assign(t, { key: null, sep: [this.sourceToken] });
|
|
4461
4488
|
else {
|
|
4462
|
-
const
|
|
4489
|
+
const l = ne(t.start);
|
|
4463
4490
|
this.stack.push({
|
|
4464
4491
|
type: "block-map",
|
|
4465
4492
|
offset: this.offset,
|
|
4466
4493
|
indent: this.indent,
|
|
4467
|
-
items: [{ start:
|
|
4494
|
+
items: [{ start: l, key: null, sep: [this.sourceToken] }]
|
|
4468
4495
|
});
|
|
4469
4496
|
}
|
|
4470
4497
|
else
|
|
4471
|
-
t.sep ? t.value ||
|
|
4498
|
+
t.sep ? t.value || r ? e.items.push({ start: o, key: null, sep: [this.sourceToken] }) : Y(t.sep, "map-value-ind") ? this.stack.push({
|
|
4472
4499
|
type: "block-map",
|
|
4473
4500
|
offset: this.offset,
|
|
4474
4501
|
indent: this.indent,
|
|
@@ -4480,14 +4507,14 @@ class Tt {
|
|
|
4480
4507
|
case "scalar":
|
|
4481
4508
|
case "single-quoted-scalar":
|
|
4482
4509
|
case "double-quoted-scalar": {
|
|
4483
|
-
const
|
|
4484
|
-
|
|
4510
|
+
const l = this.flowScalar(this.type);
|
|
4511
|
+
r || t.value ? (e.items.push({ start: o, key: l, sep: [] }), this.onKeyLine = !0) : t.sep ? this.stack.push(l) : (Object.assign(t, { key: l, sep: [] }), this.onKeyLine = !0);
|
|
4485
4512
|
return;
|
|
4486
4513
|
}
|
|
4487
4514
|
default: {
|
|
4488
|
-
const
|
|
4489
|
-
if (
|
|
4490
|
-
if (
|
|
4515
|
+
const l = this.startBlockValue(e);
|
|
4516
|
+
if (l) {
|
|
4517
|
+
if (l.type === "block-seq") {
|
|
4491
4518
|
if (!t.explicitKey && t.sep && !Y(t.sep, "newline")) {
|
|
4492
4519
|
yield* this.pop({
|
|
4493
4520
|
type: "error",
|
|
@@ -4497,8 +4524,8 @@ class Tt {
|
|
|
4497
4524
|
});
|
|
4498
4525
|
return;
|
|
4499
4526
|
}
|
|
4500
|
-
} else
|
|
4501
|
-
this.stack.push(
|
|
4527
|
+
} else i && e.items.push({ start: o });
|
|
4528
|
+
this.stack.push(l);
|
|
4502
4529
|
return;
|
|
4503
4530
|
}
|
|
4504
4531
|
}
|
|
@@ -4507,12 +4534,13 @@ class Tt {
|
|
|
4507
4534
|
yield* this.pop(), yield* this.step();
|
|
4508
4535
|
}
|
|
4509
4536
|
*blockSequence(e) {
|
|
4537
|
+
var n;
|
|
4510
4538
|
const t = e.items[e.items.length - 1];
|
|
4511
4539
|
switch (this.type) {
|
|
4512
4540
|
case "newline":
|
|
4513
4541
|
if (t.value) {
|
|
4514
|
-
const
|
|
4515
|
-
(
|
|
4542
|
+
const i = "end" in t.value ? t.value.end : void 0, r = Array.isArray(i) ? i[i.length - 1] : void 0;
|
|
4543
|
+
(r == null ? void 0 : r.type) === "comment" ? i == null || i.push(this.sourceToken) : e.items.push({ start: [this.sourceToken] });
|
|
4516
4544
|
} else
|
|
4517
4545
|
t.start.push(this.sourceToken);
|
|
4518
4546
|
return;
|
|
@@ -4522,9 +4550,9 @@ class Tt {
|
|
|
4522
4550
|
e.items.push({ start: [this.sourceToken] });
|
|
4523
4551
|
else {
|
|
4524
4552
|
if (this.atIndentedComment(t.start, e.indent)) {
|
|
4525
|
-
const i = e.items[e.items.length - 2]
|
|
4526
|
-
if (Array.isArray(
|
|
4527
|
-
Array.prototype.push.apply(
|
|
4553
|
+
const i = e.items[e.items.length - 2], r = (n = i == null ? void 0 : i.value) == null ? void 0 : n.end;
|
|
4554
|
+
if (Array.isArray(r)) {
|
|
4555
|
+
Array.prototype.push.apply(r, t.start), r.push(this.sourceToken), e.items.pop();
|
|
4528
4556
|
return;
|
|
4529
4557
|
}
|
|
4530
4558
|
}
|
|
@@ -4544,9 +4572,9 @@ class Tt {
|
|
|
4544
4572
|
return;
|
|
4545
4573
|
}
|
|
4546
4574
|
if (this.indent > e.indent) {
|
|
4547
|
-
const
|
|
4548
|
-
if (
|
|
4549
|
-
this.stack.push(
|
|
4575
|
+
const i = this.startBlockValue(e);
|
|
4576
|
+
if (i) {
|
|
4577
|
+
this.stack.push(i);
|
|
4550
4578
|
return;
|
|
4551
4579
|
}
|
|
4552
4580
|
}
|
|
@@ -4711,14 +4739,14 @@ function _s(s) {
|
|
|
4711
4739
|
return { lineCounter: s.lineCounter || e && new Ls() || null, prettyErrors: e };
|
|
4712
4740
|
}
|
|
4713
4741
|
function qn(s, e = {}) {
|
|
4714
|
-
const { lineCounter: t, prettyErrors: n } = _s(e), i = new Tt(t
|
|
4742
|
+
const { lineCounter: t, prettyErrors: n } = _s(e), i = new Tt(t == null ? void 0 : t.addNewLine), r = new It(e), o = Array.from(r.compose(i.parse(s)));
|
|
4715
4743
|
if (n && t)
|
|
4716
4744
|
for (const l of o)
|
|
4717
4745
|
l.errors.forEach(De(s, t)), l.warnings.forEach(De(s, t));
|
|
4718
4746
|
return o.length > 0 ? o : Object.assign([], { empty: !0 }, r.streamInfo());
|
|
4719
4747
|
}
|
|
4720
4748
|
function Cs(s, e = {}) {
|
|
4721
|
-
const { lineCounter: t, prettyErrors: n } = _s(e), i = new Tt(t
|
|
4749
|
+
const { lineCounter: t, prettyErrors: n } = _s(e), i = new Tt(t == null ? void 0 : t.addNewLine), r = new It(e);
|
|
4722
4750
|
let o = null;
|
|
4723
4751
|
for (const l of r.compose(i.parse(s), !0, s.length))
|
|
4724
4752
|
if (!o)
|
|
@@ -4758,21 +4786,21 @@ function Rn(s, e, t) {
|
|
|
4758
4786
|
const Un = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4759
4787
|
__proto__: null,
|
|
4760
4788
|
Alias: Re,
|
|
4761
|
-
CST:
|
|
4789
|
+
CST: Pn,
|
|
4762
4790
|
Composer: It,
|
|
4763
4791
|
Document: ge,
|
|
4764
4792
|
Lexer: Ts,
|
|
4765
4793
|
LineCounter: Ls,
|
|
4766
4794
|
Pair: v,
|
|
4767
4795
|
Parser: Tt,
|
|
4768
|
-
Scalar:
|
|
4796
|
+
Scalar: A,
|
|
4769
4797
|
Schema: Xe,
|
|
4770
4798
|
YAMLError: At,
|
|
4771
4799
|
YAMLMap: K,
|
|
4772
4800
|
YAMLParseError: z,
|
|
4773
4801
|
YAMLSeq: W,
|
|
4774
4802
|
YAMLWarning: ys,
|
|
4775
|
-
isAlias:
|
|
4803
|
+
isAlias: x,
|
|
4776
4804
|
isCollection: L,
|
|
4777
4805
|
isDocument: ee,
|
|
4778
4806
|
isMap: de,
|
|
@@ -4789,14 +4817,14 @@ const Un = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
4789
4817
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4790
4818
|
export {
|
|
4791
4819
|
Re as Alias,
|
|
4792
|
-
|
|
4820
|
+
Pn as CST,
|
|
4793
4821
|
It as Composer,
|
|
4794
4822
|
ge as Document,
|
|
4795
4823
|
Ts as Lexer,
|
|
4796
4824
|
Ls as LineCounter,
|
|
4797
4825
|
v as Pair,
|
|
4798
4826
|
Tt as Parser,
|
|
4799
|
-
|
|
4827
|
+
A as Scalar,
|
|
4800
4828
|
Xe as Schema,
|
|
4801
4829
|
At as YAMLError,
|
|
4802
4830
|
K as YAMLMap,
|
|
@@ -4804,7 +4832,7 @@ export {
|
|
|
4804
4832
|
W as YAMLSeq,
|
|
4805
4833
|
ys as YAMLWarning,
|
|
4806
4834
|
Un as default,
|
|
4807
|
-
|
|
4835
|
+
x as isAlias,
|
|
4808
4836
|
L as isCollection,
|
|
4809
4837
|
ee as isDocument,
|
|
4810
4838
|
de as isMap,
|
|
@@ -4819,4 +4847,4 @@ export {
|
|
|
4819
4847
|
Q as visit,
|
|
4820
4848
|
Fe as visitAsync
|
|
4821
4849
|
};
|
|
4822
|
-
//# sourceMappingURL=index-
|
|
4850
|
+
//# sourceMappingURL=index-DcHeSvkE.js.map
|