zudoku 0.0.0-eb4182d → 0.0.0-eeace45
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/README.md +121 -0
- package/cli.js +2 -2
- package/client.d.ts +7 -0
- package/dist/app/demo.js +1 -3
- package/dist/app/demo.js.map +1 -1
- package/dist/app/entry.client.d.ts +1 -0
- package/dist/app/entry.client.js +16 -3
- package/dist/app/entry.client.js.map +1 -1
- package/dist/app/entry.server.d.ts +1 -0
- package/dist/app/entry.server.js +11 -8
- package/dist/app/entry.server.js.map +1 -1
- package/dist/app/main.d.ts +3 -2
- package/dist/app/main.js +16 -32
- package/dist/app/main.js.map +1 -1
- package/dist/app/sentry.d.ts +3 -0
- package/dist/app/sentry.js +19 -0
- package/dist/app/sentry.js.map +1 -0
- package/dist/app/standalone.js +1 -3
- package/dist/app/standalone.js.map +1 -1
- package/dist/app/tailwind.d.ts +2 -1
- package/dist/app/tailwind.js +64 -52
- package/dist/app/tailwind.js.map +1 -1
- package/dist/cli/cli.js +1 -4
- package/dist/cli/cli.js.map +1 -1
- package/dist/cli/cmds/build.js +1 -0
- package/dist/cli/cmds/build.js.map +1 -1
- package/dist/cli/cmds/dev.js +5 -0
- package/dist/cli/cmds/dev.js.map +1 -1
- package/dist/cli/common/logger.js +9 -0
- package/dist/cli/common/logger.js.map +1 -1
- package/dist/cli/common/machine-id/lib.js.map +1 -1
- package/dist/cli/common/outdated.js +2 -1
- package/dist/cli/common/outdated.js.map +1 -1
- package/dist/cli/common/utils/box.js.map +1 -1
- package/dist/cli/dev/handler.d.ts +1 -0
- package/dist/cli/dev/handler.js +3 -3
- package/dist/cli/dev/handler.js.map +1 -1
- package/dist/codegen.d.ts +3 -0
- package/dist/codegen.js +45 -0
- package/dist/codegen.js.map +1 -0
- package/dist/config/common.d.ts +8 -0
- package/dist/config/common.js +2 -0
- package/dist/config/common.js.map +1 -0
- package/dist/config/config.d.ts +3 -2
- package/dist/config/loader.d.ts +20 -0
- package/dist/config/loader.js +154 -0
- package/dist/config/loader.js.map +1 -0
- package/dist/config/validators/InputSidebarSchema.d.ts +35 -19
- package/dist/config/validators/InputSidebarSchema.js +7 -28
- package/dist/config/validators/InputSidebarSchema.js.map +1 -1
- package/dist/config/validators/SidebarSchema.d.ts +24 -1
- package/dist/config/validators/SidebarSchema.js +80 -44
- package/dist/config/validators/SidebarSchema.js.map +1 -1
- package/dist/config/validators/common.d.ts +4945 -0
- package/dist/config/validators/common.js +280 -0
- package/dist/config/validators/common.js.map +1 -0
- package/dist/config/validators/icon-types.d.ts +1 -0
- package/dist/config/validators/icon-types.js +2 -0
- package/dist/config/validators/icon-types.js.map +1 -0
- package/dist/config/validators/validate.d.ts +888 -453
- package/dist/config/validators/validate.js +14 -213
- package/dist/config/validators/validate.js.map +1 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/lib/authentication/AuthenticationPlugin.d.ts +4 -2
- package/dist/lib/authentication/AuthenticationPlugin.js +3 -0
- package/dist/lib/authentication/AuthenticationPlugin.js.map +1 -1
- package/dist/lib/authentication/authentication.d.ts +3 -3
- package/dist/lib/authentication/components/CallbackHandler.js +21 -31
- package/dist/lib/authentication/components/CallbackHandler.js.map +1 -1
- package/dist/lib/authentication/components/SignIn.js +1 -1
- package/dist/lib/authentication/components/SignIn.js.map +1 -1
- package/dist/lib/authentication/components/SignOut.js +1 -1
- package/dist/lib/authentication/components/SignOut.js.map +1 -1
- package/dist/lib/authentication/hook.d.ts +5 -4
- package/dist/lib/authentication/hook.js +1 -3
- package/dist/lib/authentication/hook.js.map +1 -1
- package/dist/lib/authentication/providers/auth0.js +12 -11
- package/dist/lib/authentication/providers/auth0.js.map +1 -1
- package/dist/lib/authentication/providers/openid.d.ts +7 -1
- package/dist/lib/authentication/providers/openid.js +18 -27
- package/dist/lib/authentication/providers/openid.js.map +1 -1
- package/dist/lib/authentication/state.d.ts +25 -4
- package/dist/lib/authentication/state.js +28 -3
- package/dist/lib/authentication/state.js.map +1 -1
- package/dist/lib/authentication/use-broadcast/shared.d.ts +48 -0
- package/dist/lib/authentication/use-broadcast/shared.js +243 -0
- package/dist/lib/authentication/use-broadcast/shared.js.map +1 -0
- package/dist/lib/authentication/use-broadcast/useBroadcast.d.ts +24 -0
- package/dist/lib/authentication/use-broadcast/useBroadcast.js +106 -0
- package/dist/lib/authentication/use-broadcast/useBroadcast.js.map +1 -0
- package/dist/lib/components/AnchorLink.d.ts +1 -1
- package/dist/lib/components/AnchorLink.js +1 -1
- package/dist/lib/components/AnchorLink.js.map +1 -1
- package/dist/lib/components/Banner.js +7 -1
- package/dist/lib/components/Banner.js.map +1 -1
- package/dist/lib/components/Bootstrap.d.ts +4 -3
- package/dist/lib/components/Bootstrap.js +12 -6
- package/dist/lib/components/Bootstrap.js.map +1 -1
- package/dist/lib/components/ClientOnly.d.ts +4 -2
- package/dist/lib/components/ClientOnly.js +1 -1
- package/dist/lib/components/ClientOnly.js.map +1 -1
- package/dist/lib/components/DeveloperHint.js +2 -1
- package/dist/lib/components/DeveloperHint.js.map +1 -1
- package/dist/lib/components/ErrorPage.js +1 -2
- package/dist/lib/components/ErrorPage.js.map +1 -1
- package/dist/lib/components/Header.js +21 -10
- package/dist/lib/components/Header.js.map +1 -1
- package/dist/lib/components/Heading.d.ts +4 -4
- package/dist/lib/components/Heading.js +1 -1
- package/dist/lib/components/Heading.js.map +1 -1
- package/dist/lib/components/Layout.js +14 -5
- package/dist/lib/components/Layout.js.map +1 -1
- package/dist/lib/components/Markdown.js +1 -1
- package/dist/lib/components/Markdown.js.map +1 -1
- package/dist/lib/components/MobileTopNavigation.js +9 -6
- package/dist/lib/components/MobileTopNavigation.js.map +1 -1
- package/dist/lib/components/NotFoundPage.js +1 -1
- package/dist/lib/components/NotFoundPage.js.map +1 -1
- package/dist/lib/components/ReactMarkdown.d.ts +29 -0
- package/dist/lib/components/ReactMarkdown.js +182 -0
- package/dist/lib/components/ReactMarkdown.js.map +1 -0
- package/dist/lib/components/Search.d.ts +3 -1
- package/dist/lib/components/Search.js +3 -3
- package/dist/lib/components/Search.js.map +1 -1
- package/dist/lib/components/SlotletProvider.d.ts +11 -3
- package/dist/lib/components/SlotletProvider.js +4 -2
- package/dist/lib/components/SlotletProvider.js.map +1 -1
- package/dist/lib/components/SyntaxHighlight.js +19 -16
- package/dist/lib/components/SyntaxHighlight.js.map +1 -1
- package/dist/lib/components/ThemeSwitch.d.ts +1 -0
- package/dist/lib/components/ThemeSwitch.js +13 -0
- package/dist/lib/components/ThemeSwitch.js.map +1 -0
- package/dist/lib/components/TopNavigation.d.ts +5 -0
- package/dist/lib/components/TopNavigation.js +44 -5
- package/dist/lib/components/TopNavigation.js.map +1 -1
- package/dist/lib/components/{DevPortal.d.ts → Zudoku.d.ts} +3 -3
- package/dist/lib/components/{DevPortal.js → Zudoku.js} +14 -15
- package/dist/lib/components/Zudoku.js.map +1 -0
- package/dist/lib/components/context/ZudokuContext.d.ts +10 -14
- package/dist/lib/components/context/ZudokuContext.js +27 -26
- package/dist/lib/components/context/ZudokuContext.js.map +1 -1
- package/dist/lib/components/context/ZudokuProvider.d.ts +2 -2
- package/dist/lib/components/context/ZudokuProvider.js.map +1 -1
- package/dist/lib/components/index.d.ts +38 -16
- package/dist/lib/components/index.js +16 -6
- package/dist/lib/components/index.js.map +1 -1
- package/dist/lib/components/navigation/Sidebar.d.ts +3 -1
- package/dist/lib/components/navigation/Sidebar.js +4 -4
- package/dist/lib/components/navigation/Sidebar.js.map +1 -1
- package/dist/lib/components/navigation/SidebarBadge.d.ts +0 -9
- package/dist/lib/components/navigation/SidebarBadge.js +0 -9
- package/dist/lib/components/navigation/SidebarBadge.js.map +1 -1
- package/dist/lib/components/navigation/SidebarCategory.d.ts +2 -2
- package/dist/lib/components/navigation/SidebarCategory.js +18 -10
- package/dist/lib/components/navigation/SidebarCategory.js.map +1 -1
- package/dist/lib/components/navigation/SidebarItem.d.ts +2 -4
- package/dist/lib/components/navigation/SidebarItem.js +12 -12
- package/dist/lib/components/navigation/SidebarItem.js.map +1 -1
- package/dist/lib/components/navigation/SidebarWrapper.js +1 -1
- package/dist/lib/components/navigation/SidebarWrapper.js.map +1 -1
- package/dist/lib/components/navigation/utils.js +11 -15
- package/dist/lib/components/navigation/utils.js.map +1 -1
- package/dist/lib/core/{DevPortalContext.d.ts → ZudokuContext.d.ts} +7 -14
- package/dist/lib/core/{DevPortalContext.js → ZudokuContext.js} +2 -7
- package/dist/lib/core/ZudokuContext.js.map +1 -0
- package/dist/lib/core/plugins.d.ts +18 -13
- package/dist/lib/core/plugins.js.map +1 -1
- package/dist/lib/errors/ErrorAlert.d.ts +1 -1
- package/dist/lib/errors/ErrorAlert.js +8 -3
- package/dist/lib/errors/ErrorAlert.js.map +1 -1
- package/dist/lib/errors/RouterError.js +1 -1
- package/dist/lib/errors/RouterError.js.map +1 -1
- package/dist/lib/oas/graphql/index.js +10 -11
- package/dist/lib/oas/graphql/index.js.map +1 -1
- package/dist/lib/oas/parser/upgrade/index.d.ts +2 -2
- package/dist/lib/oas/parser/upgrade/index.js +2 -17
- package/dist/lib/oas/parser/upgrade/index.js.map +1 -1
- package/dist/lib/plugins/api-catalog/Catalog.d.ts +2 -0
- package/dist/lib/plugins/api-catalog/Catalog.js +36 -0
- package/dist/lib/plugins/api-catalog/Catalog.js.map +1 -0
- package/dist/lib/plugins/api-catalog/index.d.ts +30 -0
- package/dist/lib/plugins/api-catalog/index.js +15 -0
- package/dist/lib/plugins/api-catalog/index.js.map +1 -0
- package/dist/lib/plugins/api-keys/CreateApiKey.js +2 -2
- package/dist/lib/plugins/api-keys/CreateApiKey.js.map +1 -1
- package/dist/lib/plugins/api-keys/ProtectedRoute.js +1 -1
- package/dist/lib/plugins/api-keys/ProtectedRoute.js.map +1 -1
- package/dist/lib/plugins/api-keys/SettingsApiKeys.js +1 -1
- package/dist/lib/plugins/api-keys/SettingsApiKeys.js.map +1 -1
- package/dist/lib/plugins/api-keys/index.d.ts +9 -9
- package/dist/lib/plugins/api-keys/index.js +3 -0
- package/dist/lib/plugins/api-keys/index.js.map +1 -1
- package/dist/lib/plugins/custom-pages/CustomPage.d.ts +2 -0
- package/dist/lib/plugins/custom-pages/CustomPage.js +11 -0
- package/dist/lib/plugins/custom-pages/CustomPage.js.map +1 -0
- package/dist/lib/plugins/custom-pages/index.d.ts +10 -0
- package/dist/lib/plugins/custom-pages/index.js +11 -0
- package/dist/lib/plugins/custom-pages/index.js.map +1 -0
- package/dist/lib/plugins/markdown/MdxPage.d.ts +9 -1
- package/dist/lib/plugins/markdown/MdxPage.js +16 -3
- package/dist/lib/plugins/markdown/MdxPage.js.map +1 -1
- package/dist/lib/plugins/markdown/index.d.ts +8 -7
- package/dist/lib/plugins/markdown/index.js +31 -3
- package/dist/lib/plugins/markdown/index.js.map +1 -1
- package/dist/lib/plugins/markdown/resolver.d.ts +38 -0
- package/dist/lib/plugins/markdown/resolver.js +75 -0
- package/dist/lib/plugins/markdown/resolver.js.map +1 -0
- package/dist/lib/plugins/openapi/CollapsibleCode.d.ts +5 -0
- package/dist/lib/plugins/openapi/CollapsibleCode.js +24 -0
- package/dist/lib/plugins/openapi/CollapsibleCode.js.map +1 -0
- package/dist/lib/plugins/openapi/ColorizedParam.js +13 -9
- package/dist/lib/plugins/openapi/ColorizedParam.js.map +1 -1
- package/dist/lib/plugins/openapi/Endpoint.d.ts +1 -1
- package/dist/lib/plugins/openapi/Endpoint.js +5 -9
- package/dist/lib/plugins/openapi/Endpoint.js.map +1 -1
- package/dist/lib/plugins/openapi/OperationList.d.ts +2 -2
- package/dist/lib/plugins/openapi/OperationList.js +43 -23
- package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
- package/dist/lib/plugins/openapi/OperationListItem.d.ts +2 -1
- package/dist/lib/plugins/openapi/OperationListItem.js +14 -4
- package/dist/lib/plugins/openapi/OperationListItem.js.map +1 -1
- package/dist/lib/plugins/openapi/ParameterListItem.js +6 -1
- package/dist/lib/plugins/openapi/ParameterListItem.js.map +1 -1
- package/dist/lib/plugins/openapi/RequestBodySidecarBox.js +7 -3
- package/dist/lib/plugins/openapi/RequestBodySidecarBox.js.map +1 -1
- package/dist/lib/plugins/openapi/ResponsesSidecarBox.js +9 -2
- package/dist/lib/plugins/openapi/ResponsesSidecarBox.js.map +1 -1
- package/dist/lib/plugins/openapi/Route.d.ts +7 -5
- package/dist/lib/plugins/openapi/Route.js +23 -5
- package/dist/lib/plugins/openapi/Route.js.map +1 -1
- package/dist/lib/plugins/openapi/Sidecar.d.ts +1 -1
- package/dist/lib/plugins/openapi/Sidecar.js +38 -46
- package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
- package/dist/lib/plugins/openapi/client/GraphQLClient.d.ts +8 -0
- package/dist/lib/plugins/openapi/client/GraphQLClient.js +114 -0
- package/dist/lib/plugins/openapi/client/GraphQLClient.js.map +1 -0
- package/dist/lib/plugins/openapi/client/GraphQLContext.d.ts +7 -0
- package/dist/lib/plugins/openapi/client/GraphQLContext.js +5 -0
- package/dist/lib/plugins/openapi/client/GraphQLContext.js.map +1 -0
- package/dist/lib/plugins/openapi/client/createServer.d.ts +1 -0
- package/dist/lib/plugins/openapi/client/useCreateQuery.d.ts +5 -0
- package/dist/lib/plugins/openapi/client/useCreateQuery.js +24 -0
- package/dist/lib/plugins/openapi/client/useCreateQuery.js.map +1 -0
- package/dist/lib/plugins/openapi/client/worker.d.ts +4 -1
- package/dist/lib/plugins/openapi/client/worker.js +23 -14
- package/dist/lib/plugins/openapi/client/worker.js.map +1 -1
- package/dist/lib/plugins/openapi/context.d.ts +3 -3
- package/dist/lib/plugins/openapi/graphql/fragment-masking.d.ts +3 -3
- package/dist/lib/plugins/openapi/graphql/fragment-masking.js +3 -4
- package/dist/lib/plugins/openapi/graphql/fragment-masking.js.map +1 -1
- package/dist/lib/plugins/openapi/graphql/gql.d.ts +5 -51
- package/dist/lib/plugins/openapi/graphql/gql.js +5 -3
- package/dist/lib/plugins/openapi/graphql/gql.js.map +1 -1
- package/dist/lib/plugins/openapi/graphql/graphql.d.ts +34 -8
- package/dist/lib/plugins/openapi/graphql/graphql.js +195 -662
- package/dist/lib/plugins/openapi/graphql/graphql.js.map +1 -1
- package/dist/lib/plugins/openapi/index.d.ts +2 -2
- package/dist/lib/plugins/openapi/index.js +56 -68
- package/dist/lib/plugins/openapi/index.js.map +1 -1
- package/dist/lib/plugins/openapi/interfaces.d.ts +20 -1
- package/dist/lib/plugins/openapi/playground/PathParams.js +1 -1
- package/dist/lib/plugins/openapi/playground/PathParams.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/Playground.js +3 -2
- package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/PlaygroundDialog.js +1 -1
- package/dist/lib/plugins/openapi/playground/PlaygroundDialog.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/ResponseTab.js +1 -1
- package/dist/lib/plugins/openapi/playground/ResponseTab.js.map +1 -1
- package/dist/lib/plugins/openapi/post-processors/removeExtensions.d.ts +6 -0
- package/dist/lib/plugins/openapi/post-processors/removeExtensions.js +14 -0
- package/dist/lib/plugins/openapi/post-processors/removeExtensions.js.map +1 -0
- package/dist/lib/plugins/openapi/post-processors/removeExtensions.test.d.ts +1 -0
- package/dist/lib/plugins/openapi/post-processors/removeExtensions.test.js +125 -0
- package/dist/lib/plugins/openapi/post-processors/removeExtensions.test.js.map +1 -0
- package/dist/lib/plugins/openapi/post-processors/removePaths.d.ts +11 -0
- package/dist/lib/plugins/openapi/post-processors/removePaths.js +33 -0
- package/dist/lib/plugins/openapi/post-processors/removePaths.js.map +1 -0
- package/dist/lib/plugins/openapi/post-processors/removePaths.test.d.ts +1 -0
- package/dist/lib/plugins/openapi/post-processors/removePaths.test.js +104 -0
- package/dist/lib/plugins/openapi/post-processors/removePaths.test.js.map +1 -0
- package/dist/lib/plugins/openapi/post-processors/traverse.d.ts +1 -0
- package/dist/lib/plugins/openapi/post-processors/traverse.js +2 -0
- package/dist/lib/plugins/openapi/post-processors/traverse.js.map +1 -0
- package/dist/lib/plugins/openapi/schema/SchemaView.js +2 -1
- package/dist/lib/plugins/openapi/schema/SchemaView.js.map +1 -1
- package/dist/lib/plugins/openapi/util/generateSchemaExample.d.ts +0 -1
- package/dist/lib/plugins/openapi/util/generateSchemaExample.js +25 -36
- package/dist/lib/plugins/openapi/util/generateSchemaExample.js.map +1 -1
- package/dist/lib/plugins/openapi/util/methodToColor.d.ts +20 -0
- package/dist/lib/plugins/openapi/util/methodToColor.js +24 -0
- package/dist/lib/plugins/openapi/util/methodToColor.js.map +1 -0
- package/dist/lib/plugins/openapi/util/sanitizeMarkdownForMetatag.d.ts +1 -0
- package/dist/lib/plugins/openapi/util/sanitizeMarkdownForMetatag.js +27 -0
- package/dist/lib/plugins/openapi/util/sanitizeMarkdownForMetatag.js.map +1 -0
- package/dist/lib/plugins/openapi-worker.d.ts +1 -1
- package/dist/lib/plugins/openapi-worker.js +7 -1
- package/dist/lib/plugins/openapi-worker.js.map +1 -1
- package/dist/lib/plugins/redirect/index.d.ts +4 -7
- package/dist/lib/plugins/redirect/index.js +2 -2
- package/dist/lib/plugins/redirect/index.js.map +1 -1
- package/dist/lib/plugins/search-inkeep/index.d.ts +24 -5
- package/dist/lib/plugins/search-inkeep/index.js +41 -5
- package/dist/lib/plugins/search-inkeep/index.js.map +1 -1
- package/dist/lib/plugins/search-inkeep/inkeep.d.ts +3 -4
- package/dist/lib/plugins/search-inkeep/inkeep.js.map +1 -1
- package/dist/lib/ui/Accordion.d.ts +7 -0
- package/dist/lib/ui/Accordion.js +14 -0
- package/dist/lib/ui/Accordion.js.map +1 -0
- package/dist/lib/ui/ActionButton.d.ts +4 -0
- package/dist/lib/ui/ActionButton.js +10 -0
- package/dist/lib/ui/ActionButton.js.map +1 -0
- package/dist/lib/ui/Alert.d.ts +8 -0
- package/dist/lib/ui/Alert.js +23 -0
- package/dist/lib/ui/Alert.js.map +1 -0
- package/dist/lib/ui/AlertDialog.d.ts +20 -0
- package/dist/lib/ui/AlertDialog.js +27 -0
- package/dist/lib/ui/AlertDialog.js.map +1 -0
- package/dist/lib/ui/AspectRatio.d.ts +3 -0
- package/dist/lib/ui/AspectRatio.js +4 -0
- package/dist/lib/ui/AspectRatio.js.map +1 -0
- package/dist/lib/ui/Badge.d.ts +9 -0
- package/dist/lib/ui/Badge.js +21 -0
- package/dist/lib/ui/Badge.js.map +1 -0
- package/dist/lib/ui/Breadcrumb.d.ts +19 -0
- package/dist/lib/ui/Breadcrumb.js +24 -0
- package/dist/lib/ui/Breadcrumb.js.map +1 -0
- package/dist/lib/ui/Button.d.ts +2 -3
- package/dist/lib/ui/Button.js +1 -1
- package/dist/lib/ui/Button.js.map +1 -1
- package/dist/lib/ui/Callout.d.ts +36 -35
- package/dist/lib/ui/Callout.js.map +1 -1
- package/dist/lib/ui/Carousel.d.ts +18 -0
- package/dist/lib/ui/Carousel.js +99 -0
- package/dist/lib/ui/Carousel.js.map +1 -0
- package/dist/lib/ui/Checkbox.d.ts +4 -0
- package/dist/lib/ui/Checkbox.js +9 -0
- package/dist/lib/ui/Checkbox.js.map +1 -0
- package/dist/lib/ui/Collapsible.d.ts +5 -0
- package/dist/lib/ui/Collapsible.js +6 -0
- package/dist/lib/ui/Collapsible.js.map +1 -0
- package/dist/lib/ui/Command.d.ts +80 -0
- package/dist/lib/ui/Command.js +31 -0
- package/dist/lib/ui/Command.js.map +1 -0
- package/dist/lib/{components → ui}/Dialog.js +2 -2
- package/dist/lib/ui/Dialog.js.map +1 -0
- package/dist/lib/ui/Drawer.d.ts +8 -10
- package/dist/lib/ui/Drawer.js.map +1 -1
- package/dist/lib/ui/Form.d.ts +23 -0
- package/dist/lib/ui/Form.js +63 -0
- package/dist/lib/ui/Form.js.map +1 -0
- package/dist/lib/ui/HoverCard.d.ts +6 -0
- package/dist/lib/ui/HoverCard.js +10 -0
- package/dist/lib/ui/HoverCard.js.map +1 -0
- package/dist/lib/ui/Label.d.ts +5 -0
- package/dist/lib/ui/Label.js +10 -0
- package/dist/lib/ui/Label.js.map +1 -0
- package/dist/lib/ui/Pagination.d.ts +28 -0
- package/dist/lib/ui/Pagination.js +24 -0
- package/dist/lib/ui/Pagination.js.map +1 -0
- package/dist/lib/ui/Popover.d.ts +6 -0
- package/dist/lib/ui/Popover.js +10 -0
- package/dist/lib/ui/Popover.js.map +1 -0
- package/dist/lib/ui/Progress.d.ts +4 -0
- package/dist/lib/ui/Progress.js +8 -0
- package/dist/lib/ui/Progress.js.map +1 -0
- package/dist/lib/ui/RadioGroup.d.ts +5 -0
- package/dist/lib/ui/RadioGroup.js +15 -0
- package/dist/lib/ui/RadioGroup.js.map +1 -0
- package/dist/lib/ui/ScrollArea.d.ts +5 -0
- package/dist/lib/ui/ScrollArea.js +12 -0
- package/dist/lib/ui/ScrollArea.js.map +1 -0
- package/dist/lib/ui/Select.js.map +1 -0
- package/dist/lib/ui/Skeleton.d.ts +2 -0
- package/dist/lib/ui/Skeleton.js +7 -0
- package/dist/lib/ui/Skeleton.js.map +1 -0
- package/dist/lib/ui/Slider.d.ts +4 -0
- package/dist/lib/ui/Slider.js +8 -0
- package/dist/lib/ui/Slider.js.map +1 -0
- package/dist/lib/ui/Switch.d.ts +4 -0
- package/dist/lib/ui/Switch.js +8 -0
- package/dist/lib/ui/Switch.js.map +1 -0
- package/dist/lib/ui/Textarea.d.ts +4 -0
- package/dist/lib/ui/Textarea.js +9 -0
- package/dist/lib/ui/Textarea.js.map +1 -0
- package/dist/lib/ui/Toggle.d.ts +12 -0
- package/dist/lib/ui/Toggle.js +26 -0
- package/dist/lib/ui/Toggle.js.map +1 -0
- package/dist/lib/ui/ToggleGroup.d.ts +12 -0
- package/dist/lib/ui/ToggleGroup.js +21 -0
- package/dist/lib/ui/ToggleGroup.js.map +1 -0
- package/dist/lib/ui/Tooltip.d.ts +7 -0
- package/dist/lib/ui/Tooltip.js +11 -0
- package/dist/lib/ui/Tooltip.js.map +1 -0
- package/dist/lib/util/MdxComponents.d.ts +19 -20
- package/dist/lib/util/MdxComponents.js +1 -3
- package/dist/lib/util/MdxComponents.js.map +1 -1
- package/dist/lib/util/createVariantComponent.d.ts +2 -2
- package/dist/lib/util/invariant.d.ts +9 -0
- package/dist/lib/util/invariant.js +7 -3
- package/dist/lib/util/invariant.js.map +1 -1
- package/dist/lib/util/traverse.d.ts +2 -0
- package/dist/lib/util/traverse.js +18 -0
- package/dist/lib/util/traverse.js.map +1 -0
- package/dist/lib/util/useExposedProps.d.ts +2 -0
- package/dist/lib/util/useExposedProps.js +9 -0
- package/dist/lib/util/useExposedProps.js.map +1 -0
- package/dist/lib/util/useIsomorphicLayoutEffect.d.ts +3 -0
- package/dist/lib/util/useIsomorphicLayoutEffect.js +4 -0
- package/dist/lib/util/useIsomorphicLayoutEffect.js.map +1 -0
- package/dist/lib/util/useOnScreen.d.ts +4 -0
- package/dist/lib/util/useOnScreen.js +19 -0
- package/dist/lib/util/useOnScreen.js.map +1 -0
- package/dist/lib/util/useScrollToAnchor.js +1 -1
- package/dist/lib/util/useScrollToAnchor.js.map +1 -1
- package/dist/lib/util/useScrollToTop.js +1 -1
- package/dist/lib/util/useScrollToTop.js.map +1 -1
- package/dist/vite/build.js +26 -5
- package/dist/vite/build.js.map +1 -1
- package/dist/vite/config.d.ts +6 -10
- package/dist/vite/config.js +91 -78
- package/dist/vite/config.js.map +1 -1
- package/dist/vite/config.test.js +7 -5
- package/dist/vite/config.test.js.map +1 -1
- package/dist/vite/css/collect.d.ts +2 -0
- package/dist/vite/css/collect.js +27 -0
- package/dist/vite/css/collect.js.map +1 -0
- package/dist/vite/css/plugin.d.ts +5 -0
- package/dist/vite/css/plugin.js +79 -0
- package/dist/vite/css/plugin.js.map +1 -0
- package/dist/vite/debug.d.ts +1 -0
- package/dist/vite/debug.js +10 -0
- package/dist/vite/debug.js.map +1 -0
- package/dist/vite/dev-server.d.ts +7 -1
- package/dist/vite/dev-server.js +35 -8
- package/dist/vite/dev-server.js.map +1 -1
- package/dist/vite/html.js +0 -2
- package/dist/vite/html.js.map +1 -1
- package/dist/vite/output.d.ts +101 -0
- package/dist/vite/output.js +62 -0
- package/dist/vite/output.js.map +1 -0
- package/dist/vite/plugin-api.js +100 -20
- package/dist/vite/plugin-api.js.map +1 -1
- package/dist/vite/plugin-component.js +17 -12
- package/dist/vite/plugin-component.js.map +1 -1
- package/dist/vite/plugin-config-reload.d.ts +1 -2
- package/dist/vite/plugin-config-reload.js +0 -2
- package/dist/vite/plugin-config-reload.js.map +1 -1
- package/dist/vite/plugin-config.d.ts +2 -3
- package/dist/vite/plugin-config.js +22 -3
- package/dist/vite/plugin-config.js.map +1 -1
- package/dist/vite/plugin-custom-pages.d.ts +4 -0
- package/dist/vite/plugin-custom-pages.js +30 -0
- package/dist/vite/plugin-custom-pages.js.map +1 -0
- package/dist/vite/plugin-docs.js +37 -26
- package/dist/vite/plugin-docs.js.map +1 -1
- package/dist/vite/plugin-docs.test.js +15 -23
- package/dist/vite/plugin-docs.test.js.map +1 -1
- package/dist/vite/plugin-frontmatter.d.ts +2 -1
- package/dist/vite/plugin-frontmatter.js +27 -24
- package/dist/vite/plugin-frontmatter.js.map +1 -1
- package/dist/vite/plugin-mdx.d.ts +0 -6
- package/dist/vite/plugin-mdx.js +80 -6
- package/dist/vite/plugin-mdx.js.map +1 -1
- package/dist/vite/plugin-search.d.ts +3 -0
- package/dist/vite/plugin-search.js +26 -0
- package/dist/vite/plugin-search.js.map +1 -0
- package/dist/vite/plugin-sidebar.js +7 -6
- package/dist/vite/plugin-sidebar.js.map +1 -1
- package/dist/vite/{plugin-custom-css.d.ts → plugin-theme-css.d.ts} +2 -2
- package/dist/vite/plugin-theme-css.js +114 -0
- package/dist/vite/plugin-theme-css.js.map +1 -0
- package/dist/vite/plugin.d.ts +1 -2
- package/dist/vite/plugin.js +12 -6
- package/dist/vite/plugin.js.map +1 -1
- package/dist/vite/prerender.d.ts +6 -1
- package/dist/vite/prerender.js +7 -5
- package/dist/vite/prerender.js.map +1 -1
- package/dist/vite/remarkStaticGeneration.d.ts +3 -0
- package/dist/vite/remarkStaticGeneration.js +125 -0
- package/dist/vite/remarkStaticGeneration.js.map +1 -0
- package/dist/vite/sitemap.d.ts +1 -1
- package/dist/zuplo/env.d.ts +6 -0
- package/dist/zuplo/env.js +9 -0
- package/dist/zuplo/env.js.map +1 -0
- package/dist/zuplo/with-zuplo.d.ts +3 -0
- package/dist/zuplo/with-zuplo.js +28 -0
- package/dist/zuplo/with-zuplo.js.map +1 -0
- package/lib/AnchorLink-DFZZbmvr.js +34 -0
- package/lib/AnchorLink-DFZZbmvr.js.map +1 -0
- package/lib/{AuthenticationPlugin-Bx9FK124.js → AuthenticationPlugin-DVLEc6cm.js} +23 -20
- package/lib/AuthenticationPlugin-DVLEc6cm.js.map +1 -0
- package/lib/Button-DeAoTouo.js +48 -0
- package/lib/Button-DeAoTouo.js.map +1 -0
- package/lib/CategoryHeading-CBconmtI.js +10 -0
- package/lib/{CategoryHeading-ovR-zHRq.js.map → CategoryHeading-CBconmtI.js.map} +1 -1
- package/lib/ClientOnly-E7hGysn1.js +11 -0
- package/lib/ClientOnly-E7hGysn1.js.map +1 -0
- package/lib/Dialog-Bxv1yEIg.js +67 -0
- package/lib/Dialog-Bxv1yEIg.js.map +1 -0
- package/lib/Markdown-CZDLNOFc.js +15202 -0
- package/lib/Markdown-CZDLNOFc.js.map +1 -0
- package/lib/MdxPage-DKMbBROv.js +188 -0
- package/lib/MdxPage-DKMbBROv.js.map +1 -0
- package/lib/OperationList-BKHUKlAL.js +5062 -0
- package/lib/OperationList-BKHUKlAL.js.map +1 -0
- package/lib/Route-DYwKZ_c_.js +35 -0
- package/lib/Route-DYwKZ_c_.js.map +1 -0
- package/lib/Select-B_IxRUUC.js +223 -0
- package/lib/Select-B_IxRUUC.js.map +1 -0
- package/lib/SlotletProvider-pfc9oejW.js +221 -0
- package/lib/SlotletProvider-pfc9oejW.js.map +1 -0
- package/lib/{Spinner-3cQDBVGr.js → Spinner-DuxJLLNE.js} +2 -2
- package/lib/{Spinner-3cQDBVGr.js.map → Spinner-DuxJLLNE.js.map} +1 -1
- package/lib/StaggeredRender-DgsamH_G.js +17 -0
- package/lib/StaggeredRender-DgsamH_G.js.map +1 -0
- package/lib/SyntaxHighlight-Bz-lOJtH.js +2979 -0
- package/lib/SyntaxHighlight-Bz-lOJtH.js.map +1 -0
- package/lib/ZudokuContext-hmLMUdf2.js +1217 -0
- package/lib/ZudokuContext-hmLMUdf2.js.map +1 -0
- package/lib/__vite-browser-external-BYRIRx8p.js +9 -0
- package/lib/__vite-browser-external-BYRIRx8p.js.map +1 -0
- package/lib/{index-CLd8ycZz.js → assets/index-C7jnHK4b.js} +1008 -957
- package/lib/assets/index-C7jnHK4b.js.map +1 -0
- package/lib/assets/{worker-Bcj4NA2p.js → worker-D2kRl-cG.js} +6035 -5375
- package/lib/assets/worker-D2kRl-cG.js.map +1 -0
- package/lib/chunk-D52XG6IA-Dl7HLe6j.js +1823 -0
- package/lib/chunk-D52XG6IA-Dl7HLe6j.js.map +1 -0
- package/lib/cn-qaFjX9_3.js +2279 -0
- package/lib/cn-qaFjX9_3.js.map +1 -0
- package/lib/context-h_UkBLvr.js +22 -0
- package/lib/context-h_UkBLvr.js.map +1 -0
- package/lib/createServer-69sLlmQA.js +15679 -0
- package/lib/createServer-69sLlmQA.js.map +1 -0
- package/lib/hook-CHq7pFyz.js +227 -0
- package/lib/hook-CHq7pFyz.js.map +1 -0
- package/lib/{assets/index-B9EWVYfo.js → index-CBXSgjaE.js} +1034 -983
- package/lib/index-CBXSgjaE.js.map +1 -0
- package/lib/index-CPNSgwSb.js +36 -0
- package/lib/index-CPNSgwSb.js.map +1 -0
- package/lib/index-CbrnMIak.js +1282 -0
- package/lib/index-CbrnMIak.js.map +1 -0
- package/lib/index-LNp6rxyU.js.map +1 -1
- package/lib/index.esm-BSV1C092.js +692 -0
- package/lib/index.esm-BSV1C092.js.map +1 -0
- package/lib/index.esm-BnnBRKJX.js +1214 -0
- package/lib/index.esm-BnnBRKJX.js.map +1 -0
- package/lib/invariant-Caa8-XvF.js +26 -0
- package/lib/invariant-Caa8-XvF.js.map +1 -0
- package/lib/jsx-runtime-Dx-03ztt.js +446 -0
- package/lib/jsx-runtime-Dx-03ztt.js.map +1 -0
- package/lib/object_hash-BNWPnMN9.js +787 -0
- package/lib/object_hash-BNWPnMN9.js.map +1 -0
- package/lib/post-processors/removeExtensions.js +11 -0
- package/lib/post-processors/removeExtensions.js.map +1 -0
- package/lib/post-processors/removePaths.js +28 -0
- package/lib/post-processors/removePaths.js.map +1 -0
- package/lib/post-processors/traverse.js +12 -0
- package/lib/post-processors/traverse.js.map +1 -0
- package/lib/prism-csharp.min-DUwvItt4.js +63 -0
- package/lib/{prism-csharp.min-Yizuc34Y.js.map → prism-csharp.min-DUwvItt4.js.map} +1 -1
- package/lib/prism-java.min-BtgBR4yd.js +35 -0
- package/lib/{prism-java.min-d5iT_mOd.js.map → prism-java.min-BtgBR4yd.js.map} +1 -1
- package/lib/prism-markup-BNGj0Tvm.js.map +1 -1
- package/lib/prism-ruby.min-DeDXCp1r.js +38 -0
- package/lib/{prism-ruby.min-C7LwcKyz.js.map → prism-ruby.min-DeDXCp1r.js.map} +1 -1
- package/lib/prism-typescript.min-CD7H2IYQ.js +34 -0
- package/lib/{prism-typescript.min-oSVeWCAd.js.map → prism-typescript.min-CD7H2IYQ.js.map} +1 -1
- package/lib/state-CFQsUZUP.js +202 -0
- package/lib/state-CFQsUZUP.js.map +1 -0
- package/lib/ui/Accordion.js +47 -0
- package/lib/ui/Accordion.js.map +1 -0
- package/lib/ui/ActionButton.js +25 -0
- package/lib/ui/ActionButton.js.map +1 -0
- package/lib/ui/Alert.js +51 -0
- package/lib/ui/Alert.js.map +1 -0
- package/lib/ui/AlertDialog.js +114 -0
- package/lib/ui/AlertDialog.js.map +1 -0
- package/lib/ui/AspectRatio.js +6 -0
- package/lib/ui/AspectRatio.js.map +1 -0
- package/lib/ui/Badge.js +27 -0
- package/lib/ui/Badge.js.map +1 -0
- package/lib/ui/Breadcrumb.js +94 -0
- package/lib/ui/Breadcrumb.js.map +1 -0
- package/lib/ui/Button.js +49 -0
- package/lib/ui/Button.js.map +1 -0
- package/lib/ui/Callout.js +77 -0
- package/lib/ui/Callout.js.map +1 -0
- package/lib/ui/Card.js +62 -0
- package/lib/ui/Card.js.map +1 -0
- package/lib/ui/Carousel.js +1416 -0
- package/lib/ui/Carousel.js.map +1 -0
- package/lib/ui/Checkbox.js +28 -0
- package/lib/ui/Checkbox.js.map +1 -0
- package/lib/ui/Collapsible.js +8 -0
- package/lib/ui/Collapsible.js.map +1 -0
- package/lib/ui/Command.js +553 -0
- package/lib/ui/Command.js.map +1 -0
- package/lib/ui/Dialog.js +101 -0
- package/lib/ui/Dialog.js.map +1 -0
- package/lib/ui/Drawer.js +1153 -0
- package/lib/ui/Drawer.js.map +1 -0
- package/lib/ui/DropdownMenu.js +145 -0
- package/lib/ui/DropdownMenu.js.map +1 -0
- package/lib/ui/Form.js +95 -0
- package/lib/ui/Form.js.map +1 -0
- package/lib/ui/HoverCard.js +24 -0
- package/lib/ui/HoverCard.js.map +1 -0
- package/lib/ui/Input.js +22 -0
- package/lib/ui/Input.js.map +1 -0
- package/lib/ui/Label.js +20 -0
- package/lib/ui/Label.js.map +1 -0
- package/lib/ui/Pagination.js +106 -0
- package/lib/ui/Pagination.js.map +1 -0
- package/lib/ui/Popover.js +24 -0
- package/lib/ui/Popover.js.map +1 -0
- package/lib/ui/Progress.js +27 -0
- package/lib/ui/Progress.js.map +1 -0
- package/lib/ui/RadioGroup.js +32 -0
- package/lib/ui/RadioGroup.js.map +1 -0
- package/lib/ui/ScrollArea.js +39 -0
- package/lib/ui/ScrollArea.js.map +1 -0
- package/lib/ui/Select.js +122 -0
- package/lib/ui/Select.js.map +1 -0
- package/lib/ui/Skeleton.js +18 -0
- package/lib/ui/Skeleton.js.map +1 -0
- package/lib/ui/Slider.js +24 -0
- package/lib/ui/Slider.js.map +1 -0
- package/lib/ui/Switch.js +28 -0
- package/lib/ui/Switch.js.map +1 -0
- package/lib/ui/Tabs.js +47 -0
- package/lib/ui/Tabs.js.map +1 -0
- package/lib/ui/Textarea.js +21 -0
- package/lib/ui/Textarea.js.map +1 -0
- package/lib/ui/Toggle.js +38 -0
- package/lib/ui/Toggle.js.map +1 -0
- package/lib/ui/ToggleGroup.js +42 -0
- package/lib/ui/ToggleGroup.js.map +1 -0
- package/lib/ui/Tooltip.js +24 -0
- package/lib/ui/Tooltip.js.map +1 -0
- package/lib/useExposedProps-DE9lR6MF.js +9 -0
- package/lib/useExposedProps-DE9lR6MF.js.map +1 -0
- package/lib/zudoku.auth-auth0.js +24 -18
- package/lib/zudoku.auth-auth0.js.map +1 -1
- package/lib/zudoku.auth-clerk.js +2 -2
- package/lib/zudoku.auth-clerk.js.map +1 -1
- package/lib/zudoku.auth-openid.js +620 -619
- package/lib/zudoku.auth-openid.js.map +1 -1
- package/lib/zudoku.components.js +1064 -3006
- package/lib/zudoku.components.js.map +1 -1
- package/lib/zudoku.openapi-worker.js +10 -16056
- package/lib/zudoku.openapi-worker.js.map +1 -1
- package/lib/zudoku.plugin-api-catalog.js +123 -0
- package/lib/zudoku.plugin-api-catalog.js.map +1 -0
- package/lib/zudoku.plugin-api-keys.js +72 -78
- package/lib/zudoku.plugin-api-keys.js.map +1 -1
- package/lib/zudoku.plugin-custom-pages.js +22 -0
- package/lib/zudoku.plugin-custom-pages.js.map +1 -0
- package/lib/zudoku.plugin-markdown.js +94 -27
- package/lib/zudoku.plugin-markdown.js.map +1 -1
- package/lib/zudoku.plugin-openapi.js +7 -12
- package/lib/zudoku.plugin-openapi.js.map +1 -1
- package/lib/zudoku.plugin-redirect.js +2 -2
- package/lib/zudoku.plugin-redirect.js.map +1 -1
- package/lib/zudoku.plugin-search-inkeep.js +53 -28
- package/lib/zudoku.plugin-search-inkeep.js.map +1 -1
- package/package.json +135 -87
- package/src/app/demo.tsx +1 -4
- package/src/app/entry.client.tsx +20 -3
- package/src/app/entry.server.tsx +63 -52
- package/src/app/main.css +5 -2
- package/src/app/main.tsx +24 -38
- package/src/app/sentry.ts +24 -0
- package/src/app/standalone.tsx +2 -5
- package/src/app/tailwind.ts +67 -52
- package/src/lib/authentication/AuthenticationPlugin.tsx +4 -1
- package/src/lib/authentication/authentication.ts +3 -3
- package/src/lib/authentication/components/CallbackHandler.tsx +20 -51
- package/src/lib/authentication/components/SignIn.tsx +1 -1
- package/src/lib/authentication/components/SignOut.tsx +1 -1
- package/src/lib/authentication/hook.ts +1 -3
- package/src/lib/authentication/providers/auth0.tsx +17 -11
- package/src/lib/authentication/providers/openid.tsx +22 -33
- package/src/lib/authentication/state.ts +50 -9
- package/{LICENSE.md → src/lib/authentication/use-broadcast/LICENSE.md} +2 -2
- package/src/lib/authentication/use-broadcast/shared.ts +372 -0
- package/src/lib/authentication/use-broadcast/useBroadcast.ts +146 -0
- package/src/lib/components/AnchorLink.tsx +1 -1
- package/src/lib/components/Banner.tsx +12 -2
- package/src/lib/components/Bootstrap.tsx +36 -16
- package/src/lib/components/ClientOnly.tsx +6 -3
- package/src/lib/components/DeveloperHint.tsx +6 -1
- package/src/lib/components/ErrorPage.tsx +0 -2
- package/src/lib/components/Header.tsx +91 -46
- package/src/lib/components/Heading.tsx +13 -13
- package/src/lib/components/Layout.tsx +56 -38
- package/src/lib/components/Markdown.tsx +1 -1
- package/src/lib/components/MobileTopNavigation.tsx +31 -26
- package/src/lib/components/NotFoundPage.tsx +1 -1
- package/src/lib/components/ReactMarkdown.license.txt +21 -0
- package/src/lib/components/ReactMarkdown.tsx +264 -0
- package/src/lib/components/Search.tsx +4 -4
- package/src/lib/components/SlotletProvider.tsx +29 -4
- package/src/lib/components/SyntaxHighlight.tsx +85 -50
- package/src/lib/components/ThemeSwitch.tsx +26 -0
- package/src/lib/components/TopNavigation.tsx +78 -23
- package/src/lib/components/Zudoku.tsx +108 -0
- package/src/lib/components/context/ZudokuContext.ts +33 -30
- package/src/lib/components/context/ZudokuProvider.tsx +2 -2
- package/src/lib/components/index.ts +19 -7
- package/src/lib/components/navigation/Sidebar.tsx +22 -12
- package/src/lib/components/navigation/SidebarBadge.tsx +0 -10
- package/src/lib/components/navigation/SidebarCategory.tsx +39 -32
- package/src/lib/components/navigation/SidebarItem.tsx +24 -30
- package/src/lib/components/navigation/SidebarWrapper.tsx +1 -1
- package/src/lib/components/navigation/utils.ts +12 -17
- package/src/lib/core/{DevPortalContext.ts → ZudokuContext.ts} +7 -14
- package/src/lib/core/plugins.ts +19 -17
- package/src/lib/errors/ErrorAlert.tsx +20 -6
- package/src/lib/errors/RouterError.tsx +1 -1
- package/src/lib/oas/graphql/index.ts +11 -16
- package/src/lib/oas/parser/upgrade/index.ts +3 -24
- package/src/lib/plugins/api-catalog/Catalog.tsx +123 -0
- package/src/lib/plugins/api-catalog/index.tsx +64 -0
- package/src/lib/plugins/api-keys/CreateApiKey.tsx +3 -3
- package/src/lib/plugins/api-keys/ProtectedRoute.tsx +1 -1
- package/src/lib/plugins/api-keys/SettingsApiKeys.tsx +1 -1
- package/src/lib/plugins/api-keys/index.tsx +13 -10
- package/src/lib/plugins/custom-pages/CustomPage.tsx +18 -0
- package/src/lib/plugins/custom-pages/index.tsx +24 -0
- package/src/lib/plugins/markdown/MdxPage.tsx +38 -10
- package/src/lib/plugins/markdown/index.tsx +53 -13
- package/src/lib/plugins/markdown/resolver.ts +90 -0
- package/src/lib/plugins/openapi/CollapsibleCode.tsx +80 -0
- package/src/lib/plugins/openapi/ColorizedParam.tsx +23 -14
- package/src/lib/plugins/openapi/Endpoint.tsx +7 -12
- package/src/lib/plugins/openapi/OperationList.tsx +81 -45
- package/src/lib/plugins/openapi/OperationListItem.tsx +31 -2
- package/src/lib/plugins/openapi/ParameterListItem.tsx +37 -31
- package/src/lib/plugins/openapi/RequestBodySidecarBox.tsx +18 -13
- package/src/lib/plugins/openapi/ResponsesSidecarBox.tsx +17 -12
- package/src/lib/plugins/openapi/Route.tsx +42 -12
- package/src/lib/plugins/openapi/Sidecar.tsx +75 -75
- package/src/lib/plugins/openapi/client/GraphQLClient.tsx +157 -0
- package/src/lib/plugins/openapi/client/GraphQLContext.tsx +16 -0
- package/src/lib/plugins/openapi/client/createServer.ts +2 -0
- package/src/lib/plugins/openapi/client/useCreateQuery.ts +33 -0
- package/src/lib/plugins/openapi/client/worker.ts +38 -24
- package/src/lib/plugins/openapi/context.tsx +2 -2
- package/src/lib/plugins/openapi/graphql/fragment-masking.ts +11 -18
- package/src/lib/plugins/openapi/graphql/gql.ts +12 -29
- package/src/lib/plugins/openapi/graphql/graphql.ts +236 -665
- package/src/lib/plugins/openapi/index.tsx +77 -97
- package/src/lib/plugins/openapi/interfaces.ts +22 -1
- package/src/lib/plugins/openapi/playground/PathParams.tsx +1 -0
- package/src/lib/plugins/openapi/playground/Playground.tsx +5 -4
- package/src/lib/plugins/openapi/playground/PlaygroundDialog.tsx +1 -1
- package/src/lib/plugins/openapi/playground/ResponseTab.tsx +0 -1
- package/src/lib/plugins/openapi/post-processors/removeExtensions.test.ts +144 -0
- package/src/lib/plugins/openapi/post-processors/removeExtensions.ts +24 -0
- package/src/lib/plugins/openapi/post-processors/removePaths.test.ts +126 -0
- package/src/lib/plugins/openapi/post-processors/removePaths.ts +55 -0
- package/src/lib/plugins/openapi/post-processors/traverse.ts +1 -0
- package/src/lib/plugins/openapi/schema/SchemaView.tsx +5 -2
- package/src/lib/plugins/openapi/util/generateSchemaExample.ts +28 -42
- package/src/lib/plugins/openapi/util/methodToColor.ts +27 -0
- package/src/lib/plugins/openapi/util/sanitizeMarkdownForMetatag.tsx +32 -0
- package/src/lib/plugins/openapi-worker.ts +11 -1
- package/src/lib/plugins/redirect/index.tsx +6 -10
- package/src/lib/plugins/search-inkeep/index.tsx +80 -25
- package/src/lib/plugins/search-inkeep/inkeep.ts +3 -9
- package/src/lib/ui/Accordion.tsx +56 -0
- package/src/lib/ui/ActionButton.tsx +28 -0
- package/src/lib/ui/{Note.tsx → Alert.tsx} +11 -10
- package/src/lib/ui/AlertDialog.tsx +139 -0
- package/src/lib/ui/AspectRatio.tsx +5 -0
- package/src/lib/ui/Badge.tsx +36 -0
- package/src/lib/ui/Breadcrumb.tsx +115 -0
- package/src/lib/ui/Button.tsx +1 -1
- package/src/lib/ui/Callout.tsx +7 -6
- package/src/lib/ui/Carousel.tsx +260 -0
- package/src/lib/ui/Checkbox.tsx +28 -0
- package/src/lib/ui/Collapsible.tsx +9 -0
- package/src/lib/ui/Command.tsx +151 -0
- package/src/lib/{components → ui}/Dialog.tsx +4 -3
- package/src/lib/ui/Drawer.tsx +38 -36
- package/src/lib/ui/Form.tsx +177 -0
- package/src/lib/ui/HoverCard.tsx +27 -0
- package/src/lib/ui/Label.tsx +24 -0
- package/src/lib/ui/Pagination.tsx +117 -0
- package/src/lib/ui/Popover.tsx +29 -0
- package/src/lib/ui/Progress.tsx +26 -0
- package/src/lib/ui/RadioGroup.tsx +42 -0
- package/src/lib/ui/ScrollArea.tsx +46 -0
- package/src/lib/ui/Skeleton.tsx +15 -0
- package/src/lib/ui/Slider.tsx +26 -0
- package/src/lib/ui/Switch.tsx +27 -0
- package/src/lib/ui/Textarea.tsx +23 -0
- package/src/lib/ui/Toggle.tsx +43 -0
- package/src/lib/ui/ToggleGroup.tsx +59 -0
- package/src/lib/ui/Tooltip.tsx +28 -0
- package/src/lib/util/MdxComponents.tsx +3 -9
- package/src/lib/util/createVariantComponent.tsx +2 -2
- package/src/lib/util/invariant.ts +15 -3
- package/src/lib/util/traverse.ts +25 -0
- package/src/lib/util/useExposedProps.tsx +16 -0
- package/src/lib/util/useIsomorphicLayoutEffect.ts +5 -0
- package/src/lib/util/useOnScreen.ts +32 -0
- package/src/lib/util/useScrollToAnchor.ts +2 -2
- package/src/lib/util/useScrollToTop.ts +1 -1
- package/dist/internal.d.ts +0 -1
- package/dist/internal.js +0 -2
- package/dist/internal.js.map +0 -1
- package/dist/lib/components/DevPortal.js.map +0 -1
- package/dist/lib/components/Dialog.js.map +0 -1
- package/dist/lib/components/Select.js.map +0 -1
- package/dist/lib/components/context/ThemeContext.d.ts +0 -2
- package/dist/lib/components/context/ThemeContext.js +0 -7
- package/dist/lib/components/context/ThemeContext.js.map +0 -1
- package/dist/lib/components/context/ThemeProvider.d.ts +0 -4
- package/dist/lib/components/context/ThemeProvider.js +0 -23
- package/dist/lib/components/context/ThemeProvider.js.map +0 -1
- package/dist/lib/core/DevPortalContext.js.map +0 -1
- package/dist/lib/plugins/custom-page/index.d.ts +0 -8
- package/dist/lib/plugins/custom-page/index.js +0 -12
- package/dist/lib/plugins/custom-page/index.js.map +0 -1
- package/dist/lib/plugins/markdown/generateRoutes.d.ts +0 -3
- package/dist/lib/plugins/markdown/generateRoutes.js +0 -21
- package/dist/lib/plugins/markdown/generateRoutes.js.map +0 -1
- package/dist/lib/plugins/openapi/client/createMemoryClient.d.ts +0 -12
- package/dist/lib/plugins/openapi/client/createMemoryClient.js +0 -46
- package/dist/lib/plugins/openapi/client/createMemoryClient.js.map +0 -1
- package/dist/lib/plugins/openapi/client/createWorkerClient.d.ts +0 -10
- package/dist/lib/plugins/openapi/client/createWorkerClient.js +0 -61
- package/dist/lib/plugins/openapi/client/createWorkerClient.js.map +0 -1
- package/dist/lib/plugins/openapi/client/interfaces.d.ts +0 -4
- package/dist/lib/plugins/openapi/client/interfaces.js +0 -2
- package/dist/lib/plugins/openapi/client/interfaces.js.map +0 -1
- package/dist/lib/plugins/openapi/playground/Editor.d.ts +0 -1
- package/dist/lib/plugins/openapi/playground/Editor.js +0 -5
- package/dist/lib/plugins/openapi/playground/Editor.js.map +0 -1
- package/dist/lib/plugins/openapi/util/urql.d.ts +0 -7
- package/dist/lib/plugins/openapi/util/urql.js +0 -8
- package/dist/lib/plugins/openapi/util/urql.js.map +0 -1
- package/dist/lib/plugins/search-inkeep/InkeepCustomTrigger.d.ts +0 -2
- package/dist/lib/plugins/search-inkeep/InkeepCustomTrigger.js +0 -3
- package/dist/lib/plugins/search-inkeep/InkeepCustomTrigger.js.map +0 -1
- package/dist/lib/themeToggle.d.ts +0 -1
- package/dist/lib/themeToggle.js +0 -7
- package/dist/lib/themeToggle.js.map +0 -1
- package/dist/lib/ui/Note.d.ts +0 -8
- package/dist/lib/ui/Note.js +0 -23
- package/dist/lib/ui/Note.js.map +0 -1
- package/dist/lib/util/createWaitForNotify.d.ts +0 -1
- package/dist/lib/util/createWaitForNotify.js +0 -15
- package/dist/lib/util/createWaitForNotify.js.map +0 -1
- package/dist/vite/plugin-custom-css.js +0 -55
- package/dist/vite/plugin-custom-css.js.map +0 -1
- package/dist/vite/plugin-html-transform.d.ts +0 -2
- package/dist/vite/plugin-html-transform.js +0 -15
- package/dist/vite/plugin-html-transform.js.map +0 -1
- package/lib/AuthenticationPlugin-Bx9FK124.js.map +0 -1
- package/lib/CategoryHeading-ovR-zHRq.js +0 -10
- package/lib/DeveloperHint-YeWHKvyr.js +0 -16
- package/lib/DeveloperHint-YeWHKvyr.js.map +0 -1
- package/lib/ErrorPage-Dri5_2lr.js +0 -18
- package/lib/ErrorPage-Dri5_2lr.js.map +0 -1
- package/lib/InkeepCustomTrigger-CE5-K5ex.js +0 -6
- package/lib/InkeepCustomTrigger-CE5-K5ex.js.map +0 -1
- package/lib/Input-CtVUl3eT.js +0 -2198
- package/lib/Input-CtVUl3eT.js.map +0 -1
- package/lib/Markdown-DapSf3wG.js +0 -20281
- package/lib/Markdown-DapSf3wG.js.map +0 -1
- package/lib/MdxPage-BqBWsXZ1.js +0 -172
- package/lib/MdxPage-BqBWsXZ1.js.map +0 -1
- package/lib/OperationList-JAQF5-tn.js +0 -602
- package/lib/OperationList-JAQF5-tn.js.map +0 -1
- package/lib/Route-DSANUy5e.js +0 -14
- package/lib/Route-DSANUy5e.js.map +0 -1
- package/lib/SidebarBadge-Dx7jtnoA.js +0 -498
- package/lib/SidebarBadge-Dx7jtnoA.js.map +0 -1
- package/lib/SlotletProvider-D3UD5Go3.js +0 -238
- package/lib/SlotletProvider-D3UD5Go3.js.map +0 -1
- package/lib/ZudokuContext-cr-pTRY1.js +0 -1084
- package/lib/ZudokuContext-cr-pTRY1.js.map +0 -1
- package/lib/assets/index-B9EWVYfo.js.map +0 -1
- package/lib/assets/worker-Bcj4NA2p.js.map +0 -1
- package/lib/index-BG0g4WW0.js +0 -1771
- package/lib/index-BG0g4WW0.js.map +0 -1
- package/lib/index-BngPzhKn.js +0 -124
- package/lib/index-BngPzhKn.js.map +0 -1
- package/lib/index-CLd8ycZz.js.map +0 -1
- package/lib/index-Dolisrci.js +0 -2814
- package/lib/index-Dolisrci.js.map +0 -1
- package/lib/index-DyJyULzS.js +0 -5816
- package/lib/index-DyJyULzS.js.map +0 -1
- package/lib/joinPath-B7kNnUX4.js +0 -8
- package/lib/joinPath-B7kNnUX4.js.map +0 -1
- package/lib/jsx-runtime-B6kdoens.js +0 -635
- package/lib/jsx-runtime-B6kdoens.js.map +0 -1
- package/lib/prism-csharp.min-Yizuc34Y.js +0 -35
- package/lib/prism-java.min-d5iT_mOd.js +0 -7
- package/lib/prism-markup-templating-DZrrEs0A.js +0 -62
- package/lib/prism-markup-templating-DZrrEs0A.js.map +0 -1
- package/lib/prism-php.min-o7FpoMP_.js +0 -11
- package/lib/prism-php.min-o7FpoMP_.js.map +0 -1
- package/lib/prism-ruby.min-C7LwcKyz.js +0 -10
- package/lib/prism-typescript.min-oSVeWCAd.js +0 -6
- package/lib/router-D2p7Olpn.js +0 -2971
- package/lib/router-D2p7Olpn.js.map +0 -1
- package/lib/state-hNe1dw4B.js +0 -548
- package/lib/state-hNe1dw4B.js.map +0 -1
- package/lib/urql-YhcsXYy8.js +0 -1591
- package/lib/urql-YhcsXYy8.js.map +0 -1
- package/lib/utils-ByIc_KIM.js +0 -749
- package/lib/utils-ByIc_KIM.js.map +0 -1
- package/lib/zudoku.plugin-custom-page.js +0 -13
- package/lib/zudoku.plugin-custom-page.js.map +0 -1
- package/src/lib/components/DevPortal.tsx +0 -111
- package/src/lib/components/context/ThemeContext.tsx +0 -8
- package/src/lib/components/context/ThemeProvider.tsx +0 -27
- package/src/lib/plugins/custom-page/index.tsx +0 -22
- package/src/lib/plugins/markdown/generateRoutes.tsx +0 -38
- package/src/lib/plugins/openapi/client/createMemoryClient.ts +0 -56
- package/src/lib/plugins/openapi/client/createWorkerClient.ts +0 -80
- package/src/lib/plugins/openapi/client/interfaces.ts +0 -5
- package/src/lib/plugins/openapi/playground/Editor.tsx +0 -4
- package/src/lib/plugins/openapi/util/urql.ts +0 -8
- package/src/lib/plugins/search-inkeep/InkeepCustomTrigger.tsx +0 -3
- package/src/lib/themeToggle.ts +0 -7
- package/src/lib/util/createWaitForNotify.ts +0 -18
- /package/dist/lib/{components → ui}/Dialog.d.ts +0 -0
- /package/dist/lib/{components → ui}/Select.d.ts +0 -0
- /package/dist/lib/{components → ui}/Select.js +0 -0
- /package/src/lib/{components → ui}/Select.tsx +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
const
|
|
1
|
+
const dt = Symbol.for("yaml.alias"), lt = Symbol.for("yaml.document"), Y = 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] === Y, 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
4
|
switch (s[j]) {
|
|
5
|
-
case
|
|
6
|
-
case
|
|
5
|
+
case Y:
|
|
6
|
+
case he:
|
|
7
7
|
return !0;
|
|
8
8
|
}
|
|
9
9
|
return !1;
|
|
@@ -11,92 +11,92 @@ function L(s) {
|
|
|
11
11
|
function $(s) {
|
|
12
12
|
if (s && typeof s == "object")
|
|
13
13
|
switch (s[j]) {
|
|
14
|
-
case
|
|
15
|
-
case
|
|
14
|
+
case dt:
|
|
15
|
+
case Y:
|
|
16
16
|
case R:
|
|
17
|
-
case
|
|
17
|
+
case he:
|
|
18
18
|
return !0;
|
|
19
19
|
}
|
|
20
20
|
return !1;
|
|
21
21
|
}
|
|
22
|
-
const
|
|
23
|
-
function
|
|
24
|
-
const t =
|
|
25
|
-
|
|
22
|
+
const vs = (s) => (E(s) || L(s)) && !!s.anchor, M = Symbol("break visit"), Ft = Symbol("skip children"), F = Symbol("remove node");
|
|
23
|
+
function G(s, e) {
|
|
24
|
+
const t = Rt(e);
|
|
25
|
+
ee(s) ? ie(null, s.contents, t, Object.freeze([s])) === F && (s.contents = null) : ie(null, s, t, Object.freeze([]));
|
|
26
26
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
function
|
|
27
|
+
G.BREAK = M;
|
|
28
|
+
G.SKIP = Ft;
|
|
29
|
+
G.REMOVE = F;
|
|
30
|
+
function ie(s, e, t, n) {
|
|
31
31
|
const i = Ut(s, e, t, n);
|
|
32
|
-
if ($(i) ||
|
|
33
|
-
return
|
|
32
|
+
if ($(i) || T(i))
|
|
33
|
+
return Vt(s, n, i), ie(s, i, t, n);
|
|
34
34
|
if (typeof i != "symbol") {
|
|
35
35
|
if (L(e)) {
|
|
36
36
|
n = Object.freeze(n.concat(e));
|
|
37
37
|
for (let r = 0; r < e.items.length; ++r) {
|
|
38
|
-
const o =
|
|
38
|
+
const o = ie(r, e.items[r], t, n);
|
|
39
39
|
if (typeof o == "number")
|
|
40
40
|
r = o - 1;
|
|
41
41
|
else {
|
|
42
42
|
if (o === M)
|
|
43
43
|
return M;
|
|
44
|
-
o ===
|
|
44
|
+
o === F && (e.items.splice(r, 1), r -= 1);
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
|
-
} else if (
|
|
47
|
+
} else if (T(e)) {
|
|
48
48
|
n = Object.freeze(n.concat(e));
|
|
49
|
-
const r =
|
|
49
|
+
const r = ie("key", e.key, t, n);
|
|
50
50
|
if (r === M)
|
|
51
51
|
return M;
|
|
52
|
-
r ===
|
|
53
|
-
const o =
|
|
52
|
+
r === F && (e.key = null);
|
|
53
|
+
const o = ie("value", e.value, t, n);
|
|
54
54
|
if (o === M)
|
|
55
55
|
return M;
|
|
56
|
-
o ===
|
|
56
|
+
o === F && (e.value = null);
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
return i;
|
|
60
60
|
}
|
|
61
|
-
async function
|
|
62
|
-
const t =
|
|
63
|
-
|
|
61
|
+
async function Fe(s, e) {
|
|
62
|
+
const t = Rt(e);
|
|
63
|
+
ee(s) ? await re(null, s.contents, t, Object.freeze([s])) === F && (s.contents = null) : await re(null, s, t, Object.freeze([]));
|
|
64
64
|
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
async function
|
|
65
|
+
Fe.BREAK = M;
|
|
66
|
+
Fe.SKIP = Ft;
|
|
67
|
+
Fe.REMOVE = F;
|
|
68
|
+
async function re(s, e, t, n) {
|
|
69
69
|
const i = await Ut(s, e, t, n);
|
|
70
|
-
if ($(i) ||
|
|
71
|
-
return
|
|
70
|
+
if ($(i) || T(i))
|
|
71
|
+
return Vt(s, n, i), re(s, i, t, n);
|
|
72
72
|
if (typeof i != "symbol") {
|
|
73
73
|
if (L(e)) {
|
|
74
74
|
n = Object.freeze(n.concat(e));
|
|
75
75
|
for (let r = 0; r < e.items.length; ++r) {
|
|
76
|
-
const o = await
|
|
76
|
+
const o = await re(r, e.items[r], t, n);
|
|
77
77
|
if (typeof o == "number")
|
|
78
78
|
r = o - 1;
|
|
79
79
|
else {
|
|
80
80
|
if (o === M)
|
|
81
81
|
return M;
|
|
82
|
-
o ===
|
|
82
|
+
o === F && (e.items.splice(r, 1), r -= 1);
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
|
-
} else if (
|
|
85
|
+
} else if (T(e)) {
|
|
86
86
|
n = Object.freeze(n.concat(e));
|
|
87
|
-
const r = await
|
|
87
|
+
const r = await re("key", e.key, t, n);
|
|
88
88
|
if (r === M)
|
|
89
89
|
return M;
|
|
90
|
-
r ===
|
|
91
|
-
const o = await
|
|
90
|
+
r === F && (e.key = null);
|
|
91
|
+
const o = await re("value", e.value, t, n);
|
|
92
92
|
if (o === M)
|
|
93
93
|
return M;
|
|
94
|
-
o ===
|
|
94
|
+
o === F && (e.value = null);
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
97
|
return i;
|
|
98
98
|
}
|
|
99
|
-
function
|
|
99
|
+
function Rt(s) {
|
|
100
100
|
return typeof s == "object" && (s.Collection || s.Node || s.Value) ? Object.assign({
|
|
101
101
|
Alias: s.Node,
|
|
102
102
|
Map: s.Node,
|
|
@@ -115,38 +115,38 @@ function Ut(s, e, t, n) {
|
|
|
115
115
|
var i, r, o, l, a;
|
|
116
116
|
if (typeof t == "function")
|
|
117
117
|
return t(s, e, n);
|
|
118
|
-
if (he(e))
|
|
119
|
-
return (i = t.Map) == null ? void 0 : i.call(t, s, e, n);
|
|
120
118
|
if (de(e))
|
|
119
|
+
return (i = t.Map) == null ? void 0 : i.call(t, s, e, n);
|
|
120
|
+
if (pe(e))
|
|
121
121
|
return (r = t.Seq) == null ? void 0 : r.call(t, s, e, n);
|
|
122
|
-
if (
|
|
122
|
+
if (T(e))
|
|
123
123
|
return (o = t.Pair) == null ? void 0 : o.call(t, s, e, n);
|
|
124
124
|
if (E(e))
|
|
125
125
|
return (l = t.Scalar) == null ? void 0 : l.call(t, s, e, n);
|
|
126
|
-
if (
|
|
126
|
+
if (x(e))
|
|
127
127
|
return (a = t.Alias) == null ? void 0 : a.call(t, s, e, n);
|
|
128
128
|
}
|
|
129
|
-
function
|
|
129
|
+
function Vt(s, e, t) {
|
|
130
130
|
const n = e[e.length - 1];
|
|
131
131
|
if (L(n))
|
|
132
132
|
n.items[s] = t;
|
|
133
|
-
else if (
|
|
133
|
+
else if (T(n))
|
|
134
134
|
s === "key" ? n.key = t : n.value = t;
|
|
135
|
-
else if (
|
|
135
|
+
else if (ee(n))
|
|
136
136
|
n.contents = t;
|
|
137
137
|
else {
|
|
138
|
-
const i =
|
|
138
|
+
const i = x(n) ? "alias" : "scalar";
|
|
139
139
|
throw new Error(`Cannot replace node with ${i} parent`);
|
|
140
140
|
}
|
|
141
141
|
}
|
|
142
|
-
const
|
|
142
|
+
const Bs = {
|
|
143
143
|
"!": "%21",
|
|
144
144
|
",": "%2C",
|
|
145
145
|
"[": "%5B",
|
|
146
146
|
"]": "%5D",
|
|
147
147
|
"{": "%7B",
|
|
148
148
|
"}": "%7D"
|
|
149
|
-
},
|
|
149
|
+
}, Ms = (s) => s.replace(/[!,[\]{}]/g, (e) => Bs[e]);
|
|
150
150
|
class B {
|
|
151
151
|
constructor(e, t) {
|
|
152
152
|
this.docStart = null, this.docEnd = !1, this.yaml = Object.assign({}, B.defaultYaml, e), this.tags = Object.assign({}, B.defaultTags, t);
|
|
@@ -236,7 +236,7 @@ class B {
|
|
|
236
236
|
tagString(e) {
|
|
237
237
|
for (const [t, n] of Object.entries(this.tags))
|
|
238
238
|
if (e.startsWith(n))
|
|
239
|
-
return t +
|
|
239
|
+
return t + Ms(e.substring(n.length));
|
|
240
240
|
return e[0] === "!" ? e : `!<${e}>`;
|
|
241
241
|
}
|
|
242
242
|
toString(e) {
|
|
@@ -244,7 +244,7 @@ class B {
|
|
|
244
244
|
let i;
|
|
245
245
|
if (e && n.length > 0 && $(e.contents)) {
|
|
246
246
|
const r = {};
|
|
247
|
-
|
|
247
|
+
G(e.contents, (o, l) => {
|
|
248
248
|
$(l) && l.tag && (r[l.tag] = !0);
|
|
249
249
|
}), i = Object.keys(r);
|
|
250
250
|
} else
|
|
@@ -257,35 +257,35 @@ class B {
|
|
|
257
257
|
}
|
|
258
258
|
B.defaultYaml = { explicit: !1, version: "1.2" };
|
|
259
259
|
B.defaultTags = { "!!": "tag:yaml.org,2002:" };
|
|
260
|
-
function
|
|
260
|
+
function Jt(s) {
|
|
261
261
|
if (/[\x00-\x19\s,[\]{}]/.test(s)) {
|
|
262
262
|
const t = `Anchor must not contain whitespace or control characters: ${JSON.stringify(s)}`;
|
|
263
263
|
throw new Error(t);
|
|
264
264
|
}
|
|
265
265
|
return !0;
|
|
266
266
|
}
|
|
267
|
-
function
|
|
267
|
+
function Yt(s) {
|
|
268
268
|
const e = /* @__PURE__ */ new Set();
|
|
269
|
-
return
|
|
269
|
+
return G(s, {
|
|
270
270
|
Value(t, n) {
|
|
271
271
|
n.anchor && e.add(n.anchor);
|
|
272
272
|
}
|
|
273
273
|
}), e;
|
|
274
274
|
}
|
|
275
|
-
function
|
|
275
|
+
function Gt(s, e) {
|
|
276
276
|
for (let t = 1; ; ++t) {
|
|
277
277
|
const n = `${s}${t}`;
|
|
278
278
|
if (!e.has(n))
|
|
279
279
|
return n;
|
|
280
280
|
}
|
|
281
281
|
}
|
|
282
|
-
function
|
|
282
|
+
function Ks(s, e) {
|
|
283
283
|
const t = [], n = /* @__PURE__ */ new Map();
|
|
284
284
|
let i = null;
|
|
285
285
|
return {
|
|
286
286
|
onAnchor: (r) => {
|
|
287
|
-
t.push(r), i || (i =
|
|
288
|
-
const o =
|
|
287
|
+
t.push(r), i || (i = Yt(s));
|
|
288
|
+
const o = Gt(e, i);
|
|
289
289
|
return i.add(o), o;
|
|
290
290
|
},
|
|
291
291
|
/**
|
|
@@ -307,35 +307,35 @@ function vs(s, e) {
|
|
|
307
307
|
sourceObjects: n
|
|
308
308
|
};
|
|
309
309
|
}
|
|
310
|
-
function
|
|
310
|
+
function oe(s, e, t, n) {
|
|
311
311
|
if (n && typeof n == "object")
|
|
312
312
|
if (Array.isArray(n))
|
|
313
313
|
for (let i = 0, r = n.length; i < r; ++i) {
|
|
314
|
-
const o = n[i], l =
|
|
314
|
+
const o = n[i], l = oe(s, n, String(i), o);
|
|
315
315
|
l === void 0 ? delete n[i] : l !== o && (n[i] = l);
|
|
316
316
|
}
|
|
317
317
|
else if (n instanceof Map)
|
|
318
318
|
for (const i of Array.from(n.keys())) {
|
|
319
|
-
const r = n.get(i), o =
|
|
319
|
+
const r = n.get(i), o = oe(s, n, i, r);
|
|
320
320
|
o === void 0 ? n.delete(i) : o !== r && n.set(i, o);
|
|
321
321
|
}
|
|
322
322
|
else if (n instanceof Set)
|
|
323
323
|
for (const i of Array.from(n)) {
|
|
324
|
-
const r =
|
|
324
|
+
const r = oe(s, n, i, i);
|
|
325
325
|
r === void 0 ? n.delete(i) : r !== i && (n.delete(i), n.add(r));
|
|
326
326
|
}
|
|
327
327
|
else
|
|
328
328
|
for (const [i, r] of Object.entries(n)) {
|
|
329
|
-
const o =
|
|
329
|
+
const o = oe(s, n, i, r);
|
|
330
330
|
o === void 0 ? delete n[i] : o !== r && (n[i] = o);
|
|
331
331
|
}
|
|
332
332
|
return s.call(e, t, n);
|
|
333
333
|
}
|
|
334
|
-
function
|
|
334
|
+
function P(s, e, t) {
|
|
335
335
|
if (Array.isArray(s))
|
|
336
|
-
return s.map((n, i) =>
|
|
336
|
+
return s.map((n, i) => P(n, String(i), t));
|
|
337
337
|
if (s && typeof s.toJSON == "function") {
|
|
338
|
-
if (!t ||
|
|
338
|
+
if (!t || !vs(s))
|
|
339
339
|
return s.toJSON(e, t);
|
|
340
340
|
const n = { aliasCount: 0, count: 1, res: void 0 };
|
|
341
341
|
t.anchors.set(s, n), t.onCreate = (r) => {
|
|
@@ -346,7 +346,7 @@ function D(s, e, t) {
|
|
|
346
346
|
}
|
|
347
347
|
return typeof s == "bigint" && !(t != null && t.keep) ? Number(s) : s;
|
|
348
348
|
}
|
|
349
|
-
class
|
|
349
|
+
class pt {
|
|
350
350
|
constructor(e) {
|
|
351
351
|
Object.defineProperty(this, j, { value: e });
|
|
352
352
|
}
|
|
@@ -357,7 +357,7 @@ class ht {
|
|
|
357
357
|
}
|
|
358
358
|
/** A plain JavaScript representation of this node. */
|
|
359
359
|
toJS(e, { mapAsMap: t, maxAliasCount: n, onAnchor: i, reviver: r } = {}) {
|
|
360
|
-
if (!
|
|
360
|
+
if (!ee(e))
|
|
361
361
|
throw new TypeError("A document argument is required");
|
|
362
362
|
const o = {
|
|
363
363
|
anchors: /* @__PURE__ */ new Map(),
|
|
@@ -366,16 +366,16 @@ class ht {
|
|
|
366
366
|
mapAsMap: t === !0,
|
|
367
367
|
mapKeyWarned: !1,
|
|
368
368
|
maxAliasCount: typeof n == "number" ? n : 100
|
|
369
|
-
}, l =
|
|
369
|
+
}, l = P(this, "", o);
|
|
370
370
|
if (typeof i == "function")
|
|
371
371
|
for (const { count: a, res: c } of o.anchors.values())
|
|
372
372
|
i(c, a);
|
|
373
|
-
return typeof r == "function" ?
|
|
373
|
+
return typeof r == "function" ? oe(r, { "": l }, "", l) : l;
|
|
374
374
|
}
|
|
375
375
|
}
|
|
376
|
-
class
|
|
376
|
+
class Re extends pt {
|
|
377
377
|
constructor(e) {
|
|
378
|
-
super(
|
|
378
|
+
super(dt), this.source = e, Object.defineProperty(this, "tag", {
|
|
379
379
|
set() {
|
|
380
380
|
throw new Error("Alias nodes cannot have tags");
|
|
381
381
|
}
|
|
@@ -387,10 +387,10 @@ class qe extends ht {
|
|
|
387
387
|
*/
|
|
388
388
|
resolve(e) {
|
|
389
389
|
let t;
|
|
390
|
-
return
|
|
390
|
+
return G(e, {
|
|
391
391
|
Node: (n, i) => {
|
|
392
392
|
if (i === this)
|
|
393
|
-
return
|
|
393
|
+
return G.BREAK;
|
|
394
394
|
i.anchor === this.source && (t = i);
|
|
395
395
|
}
|
|
396
396
|
}), t;
|
|
@@ -404,11 +404,11 @@ class qe extends ht {
|
|
|
404
404
|
throw new ReferenceError(a);
|
|
405
405
|
}
|
|
406
406
|
let l = n.get(o);
|
|
407
|
-
if (l || (
|
|
407
|
+
if (l || (P(o, null, t), l = n.get(o)), !l || l.res === void 0) {
|
|
408
408
|
const a = "This should not happen: Alias anchor was not resolved?";
|
|
409
409
|
throw new ReferenceError(a);
|
|
410
410
|
}
|
|
411
|
-
if (r >= 0 && (l.count += 1, l.aliasCount === 0 && (l.aliasCount =
|
|
411
|
+
if (r >= 0 && (l.count += 1, l.aliasCount === 0 && (l.aliasCount = ve(i, o, n)), l.count * l.aliasCount > r)) {
|
|
412
412
|
const a = "Excessive alias count indicates a resource exhaustion attack";
|
|
413
413
|
throw new ReferenceError(a);
|
|
414
414
|
}
|
|
@@ -417,7 +417,7 @@ class qe extends ht {
|
|
|
417
417
|
toString(e, t, n) {
|
|
418
418
|
const i = `*${this.source}`;
|
|
419
419
|
if (e) {
|
|
420
|
-
if (
|
|
420
|
+
if (Jt(this.source), e.options.verifyAliasOrder && !e.anchors.has(this.source)) {
|
|
421
421
|
const r = `Unresolved alias (the anchor must be set before the alias): ${this.source}`;
|
|
422
422
|
throw new Error(r);
|
|
423
423
|
}
|
|
@@ -427,42 +427,42 @@ class qe extends ht {
|
|
|
427
427
|
return i;
|
|
428
428
|
}
|
|
429
429
|
}
|
|
430
|
-
function
|
|
431
|
-
if (
|
|
430
|
+
function ve(s, e, t) {
|
|
431
|
+
if (x(e)) {
|
|
432
432
|
const n = e.resolve(s), i = t && n && t.get(n);
|
|
433
433
|
return i ? i.count * i.aliasCount : 0;
|
|
434
434
|
} else if (L(e)) {
|
|
435
435
|
let n = 0;
|
|
436
436
|
for (const i of e.items) {
|
|
437
|
-
const r =
|
|
437
|
+
const r = ve(s, i, t);
|
|
438
438
|
r > n && (n = r);
|
|
439
439
|
}
|
|
440
440
|
return n;
|
|
441
|
-
} else if (
|
|
442
|
-
const n =
|
|
441
|
+
} else if (T(e)) {
|
|
442
|
+
const n = ve(s, e.key, t), i = ve(s, e.value, t);
|
|
443
443
|
return Math.max(n, i);
|
|
444
444
|
}
|
|
445
445
|
return 1;
|
|
446
446
|
}
|
|
447
|
-
const
|
|
448
|
-
class
|
|
447
|
+
const Qt = (s) => !s || typeof s != "function" && typeof s != "object";
|
|
448
|
+
class A extends pt {
|
|
449
449
|
constructor(e) {
|
|
450
450
|
super(R), this.value = e;
|
|
451
451
|
}
|
|
452
452
|
toJSON(e, t) {
|
|
453
|
-
return t != null && t.keep ? this.value :
|
|
453
|
+
return t != null && t.keep ? this.value : P(this.value, e, t);
|
|
454
454
|
}
|
|
455
455
|
toString() {
|
|
456
456
|
return String(this.value);
|
|
457
457
|
}
|
|
458
458
|
}
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
const
|
|
465
|
-
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) {
|
|
466
466
|
if (e) {
|
|
467
467
|
const n = t.filter((r) => r.tag === e), i = n.find((r) => !r.format) ?? n[0];
|
|
468
468
|
if (!i)
|
|
@@ -474,12 +474,12 @@ function Ms(s, e, t) {
|
|
|
474
474
|
return ((i = n.identify) == null ? void 0 : i.call(n, s)) && !n.format;
|
|
475
475
|
});
|
|
476
476
|
}
|
|
477
|
-
function
|
|
477
|
+
function ke(s, e, t) {
|
|
478
478
|
var f, d, h;
|
|
479
|
-
if (
|
|
479
|
+
if (ee(s) && (s = s.contents), $(s))
|
|
480
480
|
return s;
|
|
481
|
-
if (
|
|
482
|
-
const y = (d = (f = t.schema[
|
|
481
|
+
if (T(s)) {
|
|
482
|
+
const y = (d = (f = t.schema[Y]).createNode) == null ? void 0 : d.call(f, t.schema, null, t);
|
|
483
483
|
return y.items.push(s), y;
|
|
484
484
|
}
|
|
485
485
|
(s instanceof String || s instanceof Number || s instanceof Boolean || typeof BigInt < "u" && s instanceof BigInt) && (s = s.valueOf());
|
|
@@ -487,23 +487,23 @@ function Se(s, e, t) {
|
|
|
487
487
|
let a;
|
|
488
488
|
if (n && s && typeof s == "object") {
|
|
489
489
|
if (a = l.get(s), a)
|
|
490
|
-
return a.anchor || (a.anchor = i(s)), new
|
|
490
|
+
return a.anchor || (a.anchor = i(s)), new Re(a.anchor);
|
|
491
491
|
a = { anchor: null, node: null }, l.set(s, a);
|
|
492
492
|
}
|
|
493
|
-
e != null && e.startsWith("!!") && (e =
|
|
494
|
-
let c =
|
|
493
|
+
e != null && e.startsWith("!!") && (e = Ps + e.slice(2));
|
|
494
|
+
let c = js(s, e, o.tags);
|
|
495
495
|
if (!c) {
|
|
496
496
|
if (s && typeof s.toJSON == "function" && (s = s.toJSON()), !s || typeof s != "object") {
|
|
497
|
-
const y = new
|
|
497
|
+
const y = new A(s);
|
|
498
498
|
return a && (a.node = y), y;
|
|
499
499
|
}
|
|
500
|
-
c = s instanceof Map ? o[
|
|
500
|
+
c = s instanceof Map ? o[Y] : Symbol.iterator in Object(s) ? o[he] : o[Y];
|
|
501
501
|
}
|
|
502
502
|
r && (r(c), delete t.onTagObj);
|
|
503
|
-
const
|
|
504
|
-
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;
|
|
505
505
|
}
|
|
506
|
-
function
|
|
506
|
+
function Pe(s, e, t) {
|
|
507
507
|
let n = t;
|
|
508
508
|
for (let i = e.length - 1; i >= 0; --i) {
|
|
509
509
|
const r = e[i];
|
|
@@ -513,7 +513,7 @@ function Me(s, e, t) {
|
|
|
513
513
|
} else
|
|
514
514
|
n = /* @__PURE__ */ new Map([[r, n]]);
|
|
515
515
|
}
|
|
516
|
-
return
|
|
516
|
+
return ke(n, void 0, {
|
|
517
517
|
aliasDuplicateObjects: !1,
|
|
518
518
|
keepUndefined: !1,
|
|
519
519
|
onAnchor: () => {
|
|
@@ -523,8 +523,8 @@ function Me(s, e, t) {
|
|
|
523
523
|
sourceObjects: /* @__PURE__ */ new Map()
|
|
524
524
|
});
|
|
525
525
|
}
|
|
526
|
-
const
|
|
527
|
-
class
|
|
526
|
+
const we = (s) => s == null || typeof s == "object" && !!s[Symbol.iterator]().next().done;
|
|
527
|
+
class Wt extends pt {
|
|
528
528
|
constructor(e, t) {
|
|
529
529
|
super(e), Object.defineProperty(this, "schema", {
|
|
530
530
|
value: t,
|
|
@@ -540,7 +540,7 @@ class Gt extends ht {
|
|
|
540
540
|
*/
|
|
541
541
|
clone(e) {
|
|
542
542
|
const t = Object.create(Object.getPrototypeOf(this), Object.getOwnPropertyDescriptors(this));
|
|
543
|
-
return e && (t.schema = e), t.items = t.items.map((n) => $(n) ||
|
|
543
|
+
return e && (t.schema = e), t.items = t.items.map((n) => $(n) || T(n) ? n.clone(e) : n), this.range && (t.range = this.range.slice()), t;
|
|
544
544
|
}
|
|
545
545
|
/**
|
|
546
546
|
* Adds a value to the collection. For `!!map` and `!!omap` the value must
|
|
@@ -548,14 +548,14 @@ class Gt extends ht {
|
|
|
548
548
|
* that already exists in the map.
|
|
549
549
|
*/
|
|
550
550
|
addIn(e, t) {
|
|
551
|
-
if (
|
|
551
|
+
if (we(e))
|
|
552
552
|
this.add(t);
|
|
553
553
|
else {
|
|
554
554
|
const [n, ...i] = e, r = this.get(n, !0);
|
|
555
555
|
if (L(r))
|
|
556
556
|
r.addIn(i, t);
|
|
557
557
|
else if (r === void 0 && this.schema)
|
|
558
|
-
this.set(n,
|
|
558
|
+
this.set(n, Pe(this.schema, i, t));
|
|
559
559
|
else
|
|
560
560
|
throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`);
|
|
561
561
|
}
|
|
@@ -584,7 +584,7 @@ class Gt extends ht {
|
|
|
584
584
|
}
|
|
585
585
|
hasAllNullValues(e) {
|
|
586
586
|
return this.items.every((t) => {
|
|
587
|
-
if (!
|
|
587
|
+
if (!T(t))
|
|
588
588
|
return !1;
|
|
589
589
|
const n = t.value;
|
|
590
590
|
return n == null || e && E(n) && n.value == null && !n.commentBefore && !n.comment && !n.tag;
|
|
@@ -613,20 +613,20 @@ class Gt extends ht {
|
|
|
613
613
|
if (L(r))
|
|
614
614
|
r.setIn(i, t);
|
|
615
615
|
else if (r === void 0 && this.schema)
|
|
616
|
-
this.set(n,
|
|
616
|
+
this.set(n, Pe(this.schema, i, t));
|
|
617
617
|
else
|
|
618
618
|
throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`);
|
|
619
619
|
}
|
|
620
620
|
}
|
|
621
621
|
}
|
|
622
|
-
const
|
|
623
|
-
function
|
|
622
|
+
const Ds = (s) => s.replace(/^(?!$)(?: $)?/gm, "#");
|
|
623
|
+
function U(s, e) {
|
|
624
624
|
return /^\n+$/.test(s) ? s.substring(1) : e ? s.replace(/^(?! *$)/gm, e) : s;
|
|
625
625
|
}
|
|
626
|
-
const
|
|
627
|
-
`) ?
|
|
626
|
+
const H = (s, e, t) => s.endsWith(`
|
|
627
|
+
`) ? U(t, e) : t.includes(`
|
|
628
628
|
`) ? `
|
|
629
|
-
` +
|
|
629
|
+
` + U(t, e) : (s.endsWith(" ") ? "" : " ") + t, Ht = "flow", at = "block", Be = "quoted";
|
|
630
630
|
function Ue(s, e, t = "flow", { indentAtStart: n, lineWidth: i = 80, minContentWidth: r = 20, onFold: o, onOverflow: l } = {}) {
|
|
631
631
|
if (!i || i < 0)
|
|
632
632
|
return s;
|
|
@@ -634,14 +634,14 @@ function Ue(s, e, t = "flow", { indentAtStart: n, lineWidth: i = 80, minContentW
|
|
|
634
634
|
const a = Math.max(1 + r, 1 + i - e.length);
|
|
635
635
|
if (s.length <= a)
|
|
636
636
|
return s;
|
|
637
|
-
const c = [],
|
|
637
|
+
const c = [], p = {};
|
|
638
638
|
let f = i - e.length;
|
|
639
639
|
typeof n == "number" && (n > i - Math.max(2, r) ? c.push(0) : f = i - n);
|
|
640
|
-
let d, h, y = !1, u = -1,
|
|
641
|
-
t ===
|
|
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
642
|
for (let N; N = s[u += 1]; ) {
|
|
643
|
-
if (t ===
|
|
644
|
-
switch (
|
|
643
|
+
if (t === Be && N === "\\") {
|
|
644
|
+
switch (m = u, s[u + 1]) {
|
|
645
645
|
case "x":
|
|
646
646
|
u += 3;
|
|
647
647
|
break;
|
|
@@ -654,11 +654,11 @@ function Ue(s, e, t = "flow", { indentAtStart: n, lineWidth: i = 80, minContentW
|
|
|
654
654
|
default:
|
|
655
655
|
u += 1;
|
|
656
656
|
}
|
|
657
|
-
|
|
657
|
+
b = u;
|
|
658
658
|
}
|
|
659
659
|
if (N === `
|
|
660
660
|
`)
|
|
661
|
-
t ===
|
|
661
|
+
t === at && (u = $t(s, u, e.length)), f = u + e.length + a, d = void 0;
|
|
662
662
|
else {
|
|
663
663
|
if (N === " " && h && h !== " " && h !== `
|
|
664
664
|
` && h !== " ") {
|
|
@@ -669,13 +669,13 @@ function Ue(s, e, t = "flow", { indentAtStart: n, lineWidth: i = 80, minContentW
|
|
|
669
669
|
if (u >= f)
|
|
670
670
|
if (d)
|
|
671
671
|
c.push(d), f = d + a, d = void 0;
|
|
672
|
-
else if (t ===
|
|
672
|
+
else if (t === Be) {
|
|
673
673
|
for (; h === " " || h === " "; )
|
|
674
674
|
h = N, N = s[u += 1], y = !0;
|
|
675
|
-
const S = u >
|
|
676
|
-
if (
|
|
675
|
+
const S = u > b + 1 ? u - 2 : m - 1;
|
|
676
|
+
if (p[S])
|
|
677
677
|
return s;
|
|
678
|
-
c.push(S),
|
|
678
|
+
c.push(S), p[S] = !0, f = S + a, d = void 0;
|
|
679
679
|
} else
|
|
680
680
|
y = !0;
|
|
681
681
|
}
|
|
@@ -686,14 +686,14 @@ function Ue(s, e, t = "flow", { indentAtStart: n, lineWidth: i = 80, minContentW
|
|
|
686
686
|
o && o();
|
|
687
687
|
let w = s.slice(0, c[0]);
|
|
688
688
|
for (let N = 0; N < c.length; ++N) {
|
|
689
|
-
const S = c[N],
|
|
689
|
+
const S = c[N], k = c[N + 1] || s.length;
|
|
690
690
|
S === 0 ? w = `
|
|
691
|
-
${e}${s.slice(0,
|
|
692
|
-
${e}${s.slice(S + 1,
|
|
691
|
+
${e}${s.slice(0, k)}` : (t === Be && p[S] && (w += `${s[S]}\\`), w += `
|
|
692
|
+
${e}${s.slice(S + 1, k)}`);
|
|
693
693
|
}
|
|
694
694
|
return w;
|
|
695
695
|
}
|
|
696
|
-
function
|
|
696
|
+
function $t(s, e, t) {
|
|
697
697
|
let n = e, i = e + 1, r = s[i];
|
|
698
698
|
for (; r === " " || r === " "; )
|
|
699
699
|
if (e < i + t)
|
|
@@ -707,12 +707,12 @@ function It(s, e, t) {
|
|
|
707
707
|
}
|
|
708
708
|
return n;
|
|
709
709
|
}
|
|
710
|
-
const
|
|
710
|
+
const Ve = (s, e) => ({
|
|
711
711
|
indentAtStart: e ? s.indent.length : s.indentAtStart,
|
|
712
712
|
lineWidth: s.options.lineWidth,
|
|
713
713
|
minContentWidth: s.options.minContentWidth
|
|
714
|
-
}),
|
|
715
|
-
function
|
|
714
|
+
}), Je = (s) => /^(%|---|\.\.\.)/m.test(s);
|
|
715
|
+
function qs(s, e, t) {
|
|
716
716
|
if (!e || e < 0)
|
|
717
717
|
return !1;
|
|
718
718
|
const n = e - t, i = s.length;
|
|
@@ -728,11 +728,11 @@ function Ds(s, e, t) {
|
|
|
728
728
|
}
|
|
729
729
|
return !0;
|
|
730
730
|
}
|
|
731
|
-
function
|
|
731
|
+
function Se(s, e) {
|
|
732
732
|
const t = JSON.stringify(s);
|
|
733
733
|
if (e.options.doubleQuotedAsJSON)
|
|
734
734
|
return t;
|
|
735
|
-
const { implicitKey: n } = e, i = e.options.doubleQuotedMinMultiLineLength, r = e.indent || (
|
|
735
|
+
const { implicitKey: n } = e, i = e.options.doubleQuotedMinMultiLineLength, r = e.indent || (Je(s) ? " " : "");
|
|
736
736
|
let o = "", l = 0;
|
|
737
737
|
for (let a = 0, c = t[a]; c; c = t[++a])
|
|
738
738
|
if (c === " " && t[a + 1] === "\\" && t[a + 2] === "n" && (o += t.slice(l, a) + "\\ ", a += 1, l = a, c = "\\"), c === "\\")
|
|
@@ -740,8 +740,8 @@ function we(s, e) {
|
|
|
740
740
|
case "u":
|
|
741
741
|
{
|
|
742
742
|
o += t.slice(l, a);
|
|
743
|
-
const
|
|
744
|
-
switch (
|
|
743
|
+
const p = t.substr(a + 2, 4);
|
|
744
|
+
switch (p) {
|
|
745
745
|
case "0000":
|
|
746
746
|
o += "\\0";
|
|
747
747
|
break;
|
|
@@ -767,7 +767,7 @@ function we(s, e) {
|
|
|
767
767
|
o += "\\P";
|
|
768
768
|
break;
|
|
769
769
|
default:
|
|
770
|
-
|
|
770
|
+
p.substr(0, 2) === "00" ? o += "\\x" + p.substr(2) : o += t.substr(a, 6);
|
|
771
771
|
}
|
|
772
772
|
a += 5, l = a + 1;
|
|
773
773
|
}
|
|
@@ -787,43 +787,43 @@ function we(s, e) {
|
|
|
787
787
|
default:
|
|
788
788
|
a += 1;
|
|
789
789
|
}
|
|
790
|
-
return o = l ? o + t.slice(l) : t, n ? o : Ue(o, r,
|
|
790
|
+
return o = l ? o + t.slice(l) : t, n ? o : Ue(o, r, Be, Ve(e, !1));
|
|
791
791
|
}
|
|
792
|
-
function
|
|
792
|
+
function ct(s, e) {
|
|
793
793
|
if (e.options.singleQuote === !1 || e.implicitKey && s.includes(`
|
|
794
794
|
`) || /[ \t]\n|\n[ \t]/.test(s))
|
|
795
|
-
return
|
|
796
|
-
const t = e.indent || (
|
|
795
|
+
return Se(s, e);
|
|
796
|
+
const t = e.indent || (Je(s) ? " " : ""), n = "'" + s.replace(/'/g, "''").replace(/\n+/g, `$&
|
|
797
797
|
${t}`) + "'";
|
|
798
|
-
return e.implicitKey ? n : Ue(n, t,
|
|
798
|
+
return e.implicitKey ? n : Ue(n, t, Ht, Ve(e, !1));
|
|
799
799
|
}
|
|
800
|
-
function
|
|
800
|
+
function le(s, e) {
|
|
801
801
|
const { singleQuote: t } = e.options;
|
|
802
802
|
let n;
|
|
803
803
|
if (t === !1)
|
|
804
|
-
n =
|
|
804
|
+
n = Se;
|
|
805
805
|
else {
|
|
806
806
|
const i = s.includes('"'), r = s.includes("'");
|
|
807
|
-
i && !r ? n =
|
|
807
|
+
i && !r ? n = ct : r && !i ? n = Se : n = t ? ct : Se;
|
|
808
808
|
}
|
|
809
809
|
return n(s, e);
|
|
810
810
|
}
|
|
811
|
-
let
|
|
811
|
+
let ft;
|
|
812
812
|
try {
|
|
813
|
-
|
|
813
|
+
ft = new RegExp(`(^|(?<!
|
|
814
814
|
))
|
|
815
815
|
+(?!
|
|
816
816
|
|$)`, "g");
|
|
817
817
|
} catch {
|
|
818
|
-
|
|
818
|
+
ft = /\n+(?!\n|$)/g;
|
|
819
819
|
}
|
|
820
|
-
function
|
|
820
|
+
function Me({ comment: s, type: e, value: t }, n, i, r) {
|
|
821
821
|
const { blockQuote: o, commentString: l, lineWidth: a } = n.options;
|
|
822
822
|
if (!o || /\n[\t ]+$/.test(t) || /^\s*$/.test(t))
|
|
823
|
-
return
|
|
824
|
-
const c = n.indent || (n.forceBlockIndent ||
|
|
823
|
+
return le(t, n);
|
|
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);
|
|
825
825
|
if (!t)
|
|
826
|
-
return
|
|
826
|
+
return p ? `|
|
|
827
827
|
` : `>
|
|
828
828
|
`;
|
|
829
829
|
let f, d;
|
|
@@ -837,90 +837,97 @@ function ve({ comment: s, type: e, value: t }, n, i, r) {
|
|
|
837
837
|
const y = h.indexOf(`
|
|
838
838
|
`);
|
|
839
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(
|
|
841
|
-
let u = !1,
|
|
842
|
-
for (
|
|
843
|
-
const k = t[
|
|
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
844
|
if (k === " ")
|
|
845
845
|
u = !0;
|
|
846
846
|
else if (k === `
|
|
847
847
|
`)
|
|
848
|
-
|
|
848
|
+
b = m;
|
|
849
849
|
else
|
|
850
850
|
break;
|
|
851
851
|
}
|
|
852
|
-
let w = t.substring(0,
|
|
852
|
+
let w = t.substring(0, b < m ? b + 1 : m);
|
|
853
853
|
w && (t = t.substring(w.length), w = w.replace(/\n+/g, `$&${c}`));
|
|
854
|
-
let S = (
|
|
855
|
-
if (s && (S += " " + l(s.replace(/ ?[\r\n]+/g, " ")), i && i()),
|
|
856
|
-
|
|
857
|
-
${c}${w}${t}${h}`;
|
|
858
|
-
t = t.replace(/\n+/g, `
|
|
854
|
+
let S = (u ? c ? "2" : "1" : "") + f;
|
|
855
|
+
if (s && (S += " " + l(s.replace(/ ?[\r\n]+/g, " ")), i && i()), !p) {
|
|
856
|
+
const k = t.replace(/\n+/g, `
|
|
859
857
|
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g, "$1$2").replace(/\n+/g, `$&${c}`);
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
858
|
+
let O = !1;
|
|
859
|
+
const I = Ve(n, !0);
|
|
860
|
+
o !== "folded" && e !== A.BLOCK_FOLDED && (I.onOverflow = () => {
|
|
861
|
+
O = !0;
|
|
862
|
+
});
|
|
863
|
+
const g = Ue(`${w}${k}${h}`, c, at, I);
|
|
864
|
+
if (!O)
|
|
865
|
+
return `>${S}
|
|
866
|
+
${c}${g}`;
|
|
867
|
+
}
|
|
868
|
+
return t = t.replace(/\n+/g, `$&${c}`), `|${S}
|
|
869
|
+
${c}${w}${t}${h}`;
|
|
863
870
|
}
|
|
864
|
-
function
|
|
865
|
-
const { type: i, value: r } = s, { actualString: o, implicitKey: l, indent: a, indentStep: c, inFlow:
|
|
871
|
+
function Fs(s, e, t, n) {
|
|
872
|
+
const { type: i, value: r } = s, { actualString: o, implicitKey: l, indent: a, indentStep: c, inFlow: p } = e;
|
|
866
873
|
if (l && r.includes(`
|
|
867
|
-
`) ||
|
|
868
|
-
return
|
|
874
|
+
`) || p && /[[\]{},]/.test(r))
|
|
875
|
+
return le(r, e);
|
|
869
876
|
if (!r || /^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(r))
|
|
870
|
-
return l ||
|
|
871
|
-
`) ?
|
|
872
|
-
if (!l && !
|
|
877
|
+
return l || p || !r.includes(`
|
|
878
|
+
`) ? le(r, e) : Me(s, e, t, n);
|
|
879
|
+
if (!l && !p && i !== A.PLAIN && r.includes(`
|
|
873
880
|
`))
|
|
874
|
-
return
|
|
875
|
-
if (
|
|
881
|
+
return Me(s, e, t, n);
|
|
882
|
+
if (Je(r)) {
|
|
876
883
|
if (a === "")
|
|
877
|
-
return e.forceBlockIndent = !0,
|
|
884
|
+
return e.forceBlockIndent = !0, Me(s, e, t, n);
|
|
878
885
|
if (l && a === c)
|
|
879
|
-
return
|
|
886
|
+
return le(r, e);
|
|
880
887
|
}
|
|
881
888
|
const f = r.replace(/\n+/g, `$&
|
|
882
889
|
${a}`);
|
|
883
890
|
if (o) {
|
|
884
891
|
const d = (u) => {
|
|
885
|
-
var
|
|
886
|
-
return u.default && u.tag !== "tag:yaml.org,2002:str" && ((
|
|
892
|
+
var m;
|
|
893
|
+
return u.default && u.tag !== "tag:yaml.org,2002:str" && ((m = u.test) == null ? void 0 : m.test(f));
|
|
887
894
|
}, { compat: h, tags: y } = e.doc.schema;
|
|
888
895
|
if (y.some(d) || h != null && h.some(d))
|
|
889
|
-
return
|
|
896
|
+
return le(r, e);
|
|
890
897
|
}
|
|
891
|
-
return l ? f : Ue(f, a,
|
|
898
|
+
return l ? f : Ue(f, a, Ht, Ve(e, !1));
|
|
892
899
|
}
|
|
893
|
-
function
|
|
900
|
+
function Ae(s, e, t, n) {
|
|
894
901
|
const { implicitKey: i, inFlow: r } = e, o = typeof s.value == "string" ? s : Object.assign({}, s, { value: String(s.value) });
|
|
895
902
|
let { type: l } = s;
|
|
896
|
-
l !==
|
|
897
|
-
const a = (
|
|
898
|
-
switch (
|
|
899
|
-
case
|
|
900
|
-
case
|
|
901
|
-
return i || r ?
|
|
902
|
-
case
|
|
903
|
-
return
|
|
904
|
-
case
|
|
905
|
-
return
|
|
906
|
-
case
|
|
907
|
-
return
|
|
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:
|
|
908
|
+
return i || r ? le(o.value, e) : Me(o, e, t, n);
|
|
909
|
+
case A.QUOTE_DOUBLE:
|
|
910
|
+
return Se(o.value, e);
|
|
911
|
+
case A.QUOTE_SINGLE:
|
|
912
|
+
return ct(o.value, e);
|
|
913
|
+
case A.PLAIN:
|
|
914
|
+
return Fs(o, e, t, n);
|
|
908
915
|
default:
|
|
909
916
|
return null;
|
|
910
917
|
}
|
|
911
918
|
};
|
|
912
919
|
let c = a(l);
|
|
913
920
|
if (c === null) {
|
|
914
|
-
const { defaultKeyType:
|
|
921
|
+
const { defaultKeyType: p, defaultStringType: f } = e.options, d = i && p || f;
|
|
915
922
|
if (c = a(d), c === null)
|
|
916
923
|
throw new Error(`Unsupported default string type ${d}`);
|
|
917
924
|
}
|
|
918
925
|
return c;
|
|
919
926
|
}
|
|
920
|
-
function
|
|
927
|
+
function Xt(s, e) {
|
|
921
928
|
const t = Object.assign({
|
|
922
929
|
blockQuote: !0,
|
|
923
|
-
commentString:
|
|
930
|
+
commentString: Ds,
|
|
924
931
|
defaultKeyType: null,
|
|
925
932
|
defaultStringType: "PLAIN",
|
|
926
933
|
directives: null,
|
|
@@ -958,7 +965,7 @@ function Wt(s, e) {
|
|
|
958
965
|
options: t
|
|
959
966
|
};
|
|
960
967
|
}
|
|
961
|
-
function
|
|
968
|
+
function Rs(s, e) {
|
|
962
969
|
var i;
|
|
963
970
|
if (e.tag) {
|
|
964
971
|
const r = s.filter((o) => o.tag === e.tag);
|
|
@@ -968,10 +975,14 @@ function Ks(s, e) {
|
|
|
968
975
|
let t, n;
|
|
969
976
|
if (E(e)) {
|
|
970
977
|
n = e.value;
|
|
971
|
-
|
|
978
|
+
let r = s.filter((o) => {
|
|
972
979
|
var l;
|
|
973
980
|
return (l = o.identify) == null ? void 0 : l.call(o, n);
|
|
974
981
|
});
|
|
982
|
+
if (r.length > 1) {
|
|
983
|
+
const o = r.filter((l) => l.test);
|
|
984
|
+
o.length > 0 && (r = o);
|
|
985
|
+
}
|
|
975
986
|
t = r.find((o) => o.format === e.format) ?? r.find((o) => !o.format);
|
|
976
987
|
} else
|
|
977
988
|
n = e, t = s.find((r) => r.nodeClass && n instanceof r.nodeClass);
|
|
@@ -981,19 +992,19 @@ function Ks(s, e) {
|
|
|
981
992
|
}
|
|
982
993
|
return t;
|
|
983
994
|
}
|
|
984
|
-
function
|
|
995
|
+
function Us(s, e, { anchors: t, doc: n }) {
|
|
985
996
|
if (!n.directives)
|
|
986
997
|
return "";
|
|
987
998
|
const i = [], r = (E(s) || L(s)) && s.anchor;
|
|
988
|
-
r &&
|
|
999
|
+
r && Jt(r) && (t.add(r), i.push(`&${r}`));
|
|
989
1000
|
const o = s.tag ? s.tag : e.default ? null : e.tag;
|
|
990
1001
|
return o && i.push(n.directives.tagString(o)), i.join(" ");
|
|
991
1002
|
}
|
|
992
|
-
function
|
|
1003
|
+
function fe(s, e, t, n) {
|
|
993
1004
|
var a;
|
|
994
|
-
if (
|
|
1005
|
+
if (T(s))
|
|
995
1006
|
return s.toString(e, t, n);
|
|
996
|
-
if (
|
|
1007
|
+
if (x(s)) {
|
|
997
1008
|
if (e.doc.directives)
|
|
998
1009
|
return s.toString(e);
|
|
999
1010
|
if ((a = e.resolvedAliases) != null && a.has(s))
|
|
@@ -1002,98 +1013,126 @@ function ae(s, e, t, n) {
|
|
|
1002
1013
|
}
|
|
1003
1014
|
let i;
|
|
1004
1015
|
const r = $(s) ? s : e.doc.createNode(s, { onTagObj: (c) => i = c });
|
|
1005
|
-
i || (i =
|
|
1006
|
-
const o =
|
|
1016
|
+
i || (i = Rs(e.doc.schema.tags, r));
|
|
1017
|
+
const o = Us(r, i, e);
|
|
1007
1018
|
o.length > 0 && (e.indentAtStart = (e.indentAtStart ?? 0) + o.length + 1);
|
|
1008
|
-
const l = typeof i.stringify == "function" ? i.stringify(r, e, t, n) : E(r) ?
|
|
1019
|
+
const l = typeof i.stringify == "function" ? i.stringify(r, e, t, n) : E(r) ? Ae(r, e, t, n) : r.toString(e, t, n);
|
|
1009
1020
|
return o ? E(r) || l[0] === "{" || l[0] === "[" ? `${o} ${l}` : `${o}
|
|
1010
1021
|
${e.indent}${l}` : l;
|
|
1011
1022
|
}
|
|
1012
|
-
function
|
|
1013
|
-
const { allNullValues: r, doc: o, indent: l, indentStep: a, options: { commentString: c, indentSeq:
|
|
1023
|
+
function Vs({ key: s, value: e }, t, n, i) {
|
|
1024
|
+
const { allNullValues: r, doc: o, indent: l, indentStep: a, options: { commentString: c, indentSeq: p, simpleKeys: f } } = t;
|
|
1014
1025
|
let d = $(s) && s.comment || null;
|
|
1015
1026
|
if (f) {
|
|
1016
1027
|
if (d)
|
|
1017
1028
|
throw new Error("With simple keys, key nodes cannot have comments");
|
|
1018
1029
|
if (L(s) || !$(s) && typeof s == "object") {
|
|
1019
|
-
const
|
|
1020
|
-
throw new Error(
|
|
1030
|
+
const I = "With simple keys, collection cannot be used as a key value";
|
|
1031
|
+
throw new Error(I);
|
|
1021
1032
|
}
|
|
1022
1033
|
}
|
|
1023
|
-
let h = !f && (!s || d && e == null && !t.inFlow || L(s) || (E(s) ? s.type ===
|
|
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"));
|
|
1024
1035
|
t = Object.assign({}, t, {
|
|
1025
1036
|
allNullValues: !1,
|
|
1026
1037
|
implicitKey: !h && (f || !r),
|
|
1027
1038
|
indent: l + a
|
|
1028
1039
|
});
|
|
1029
|
-
let y = !1, u = !1,
|
|
1030
|
-
if (!h && !t.inFlow &&
|
|
1040
|
+
let y = !1, u = !1, m = fe(s, t, () => y = !0, () => u = !0);
|
|
1041
|
+
if (!h && !t.inFlow && m.length > 1024) {
|
|
1031
1042
|
if (f)
|
|
1032
1043
|
throw new Error("With simple keys, single line scalar must not span more than 1024 characters");
|
|
1033
1044
|
h = !0;
|
|
1034
1045
|
}
|
|
1035
1046
|
if (t.inFlow) {
|
|
1036
1047
|
if (r || e == null)
|
|
1037
|
-
return y && n && n(),
|
|
1048
|
+
return y && n && n(), m === "" ? "?" : h ? `? ${m}` : m;
|
|
1038
1049
|
} else if (r && !f || e == null && h)
|
|
1039
|
-
return
|
|
1040
|
-
y && (d = null), h ? (d && (
|
|
1041
|
-
${l}:`) : (
|
|
1042
|
-
let
|
|
1043
|
-
$(e) ? (
|
|
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, w, N;
|
|
1054
|
+
$(e) ? (b = !!e.spaceBefore, w = e.commentBefore, N = e.comment) : (b = !1, w = 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));
|
|
1044
1055
|
let S = !1;
|
|
1045
|
-
const
|
|
1046
|
-
let
|
|
1047
|
-
if (d ||
|
|
1048
|
-
if (
|
|
1056
|
+
const k = fe(e, t, () => S = !0, () => u = !0);
|
|
1057
|
+
let O = " ";
|
|
1058
|
+
if (d || b || w) {
|
|
1059
|
+
if (O = b ? `
|
|
1049
1060
|
` : "", w) {
|
|
1050
|
-
const
|
|
1051
|
-
|
|
1052
|
-
${
|
|
1061
|
+
const I = c(w);
|
|
1062
|
+
O += `
|
|
1063
|
+
${U(I, t.indent)}`;
|
|
1053
1064
|
}
|
|
1054
|
-
|
|
1055
|
-
` && (
|
|
1065
|
+
k === "" && !t.inFlow ? O === `
|
|
1066
|
+
` && (O = `
|
|
1056
1067
|
|
|
1057
|
-
`) :
|
|
1068
|
+
`) : O += `
|
|
1058
1069
|
${t.indent}`;
|
|
1059
1070
|
} else if (!h && L(e)) {
|
|
1060
|
-
const
|
|
1061
|
-
`), _ =
|
|
1062
|
-
if (_ || !
|
|
1063
|
-
let
|
|
1064
|
-
if (_ && (
|
|
1065
|
-
let C =
|
|
1066
|
-
|
|
1071
|
+
const I = k[0], g = k.indexOf(`
|
|
1072
|
+
`), _ = g !== -1, J = t.inFlow ?? e.flow ?? e.items.length === 0;
|
|
1073
|
+
if (_ || !J) {
|
|
1074
|
+
let te = !1;
|
|
1075
|
+
if (_ && (I === "&" || I === "!")) {
|
|
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);
|
|
1067
1078
|
}
|
|
1068
|
-
|
|
1079
|
+
te || (O = `
|
|
1069
1080
|
${t.indent}`);
|
|
1070
1081
|
}
|
|
1071
|
-
} else (
|
|
1072
|
-
`) && (
|
|
1073
|
-
return
|
|
1082
|
+
} else (k === "" || k[0] === `
|
|
1083
|
+
`) && (O = "");
|
|
1084
|
+
return m += O + k, t.inFlow ? S && n && n() : N && !S ? m += H(m, t.indent, c(N)) : u && i && i(), m;
|
|
1074
1085
|
}
|
|
1075
|
-
function
|
|
1086
|
+
function zt(s, e) {
|
|
1076
1087
|
(s === "debug" || s === "warn") && (typeof process < "u" && process.emitWarning ? process.emitWarning(e) : console.warn(e));
|
|
1077
1088
|
}
|
|
1078
|
-
const
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
+
const Te = "<<", V = {
|
|
1090
|
+
identify: (s) => s === Te || typeof s == "symbol" && s.description === Te,
|
|
1091
|
+
default: "key",
|
|
1092
|
+
tag: "tag:yaml.org,2002:merge",
|
|
1093
|
+
test: /^<<$/,
|
|
1094
|
+
resolve: () => Object.assign(new A(Symbol(Te)), {
|
|
1095
|
+
addToJSMap: Zt
|
|
1096
|
+
}),
|
|
1097
|
+
stringify: () => Te
|
|
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))
|
|
1101
|
+
for (const n of t.items)
|
|
1102
|
+
et(s, e, n);
|
|
1103
|
+
else if (Array.isArray(t))
|
|
1104
|
+
for (const n of t)
|
|
1105
|
+
et(s, e, n);
|
|
1106
|
+
else
|
|
1107
|
+
et(s, e, t);
|
|
1108
|
+
}
|
|
1109
|
+
function et(s, e, t) {
|
|
1110
|
+
const n = s && x(t) ? t.resolve(s.doc) : t;
|
|
1111
|
+
if (!de(n))
|
|
1112
|
+
throw new Error("Merge sources must be maps or map aliases");
|
|
1113
|
+
const i = n.toJSON(null, s, Map);
|
|
1114
|
+
for (const [r, o] of i)
|
|
1115
|
+
e instanceof Map ? e.has(r) || e.set(r, o) : e instanceof Set ? e.add(r) : Object.prototype.hasOwnProperty.call(e, r) || Object.defineProperty(e, r, {
|
|
1116
|
+
value: o,
|
|
1117
|
+
writable: !0,
|
|
1118
|
+
enumerable: !0,
|
|
1119
|
+
configurable: !0
|
|
1120
|
+
});
|
|
1121
|
+
return e;
|
|
1122
|
+
}
|
|
1123
|
+
function xt(s, e, { key: t, value: n }) {
|
|
1124
|
+
if ($(t) && t.addToJSMap)
|
|
1125
|
+
t.addToJSMap(s, e, n);
|
|
1126
|
+
else if (Js(s, t))
|
|
1127
|
+
Zt(s, e, n);
|
|
1089
1128
|
else {
|
|
1090
|
-
const i =
|
|
1129
|
+
const i = P(t, "", s);
|
|
1091
1130
|
if (e instanceof Map)
|
|
1092
|
-
e.set(i,
|
|
1131
|
+
e.set(i, P(n, i, s));
|
|
1093
1132
|
else if (e instanceof Set)
|
|
1094
1133
|
e.add(i);
|
|
1095
1134
|
else {
|
|
1096
|
-
const r =
|
|
1135
|
+
const r = Ys(t, i, s), o = P(n, r, s);
|
|
1097
1136
|
r in e ? Object.defineProperty(e, r, {
|
|
1098
1137
|
value: o,
|
|
1099
1138
|
writable: !0,
|
|
@@ -1104,28 +1143,13 @@ function Xt(s, e, { key: t, value: n }) {
|
|
|
1104
1143
|
}
|
|
1105
1144
|
return e;
|
|
1106
1145
|
}
|
|
1107
|
-
|
|
1108
|
-
function Ze(s, e, t) {
|
|
1109
|
-
const n = s && Z(t) ? t.resolve(s.doc) : t;
|
|
1110
|
-
if (!he(n))
|
|
1111
|
-
throw new Error("Merge sources must be maps or map aliases");
|
|
1112
|
-
const i = n.toJSON(null, s, Map);
|
|
1113
|
-
for (const [r, o] of i)
|
|
1114
|
-
e instanceof Map ? e.has(r) || e.set(r, o) : e instanceof Set ? e.add(r) : Object.prototype.hasOwnProperty.call(e, r) || Object.defineProperty(e, r, {
|
|
1115
|
-
value: o,
|
|
1116
|
-
writable: !0,
|
|
1117
|
-
enumerable: !0,
|
|
1118
|
-
configurable: !0
|
|
1119
|
-
});
|
|
1120
|
-
return e;
|
|
1121
|
-
}
|
|
1122
|
-
function Rs(s, e, t) {
|
|
1146
|
+
function Ys(s, e, t) {
|
|
1123
1147
|
if (e === null)
|
|
1124
1148
|
return "";
|
|
1125
1149
|
if (typeof e != "object")
|
|
1126
1150
|
return String(e);
|
|
1127
1151
|
if ($(s) && (t != null && t.doc)) {
|
|
1128
|
-
const n =
|
|
1152
|
+
const n = Xt(t.doc, {});
|
|
1129
1153
|
n.anchors = /* @__PURE__ */ new Set();
|
|
1130
1154
|
for (const r of t.anchors.keys())
|
|
1131
1155
|
n.anchors.add(r.anchor);
|
|
@@ -1133,19 +1157,19 @@ function Rs(s, e, t) {
|
|
|
1133
1157
|
const i = s.toString(n);
|
|
1134
1158
|
if (!t.mapKeyWarned) {
|
|
1135
1159
|
let r = JSON.stringify(i);
|
|
1136
|
-
r.length > 40 && (r = r.substring(0, 36) + '..."'),
|
|
1160
|
+
r.length > 40 && (r = r.substring(0, 36) + '..."'), zt(t.doc.options.logLevel, `Keys with collection values will be stringified due to JS Object restrictions: ${r}. Set mapAsMap: true to use object keys.`), t.mapKeyWarned = !0;
|
|
1137
1161
|
}
|
|
1138
1162
|
return i;
|
|
1139
1163
|
}
|
|
1140
1164
|
return JSON.stringify(e);
|
|
1141
1165
|
}
|
|
1142
|
-
function
|
|
1143
|
-
const n =
|
|
1166
|
+
function mt(s, e, t) {
|
|
1167
|
+
const n = ke(s, void 0, t), i = ke(e, void 0, t);
|
|
1144
1168
|
return new v(n, i);
|
|
1145
1169
|
}
|
|
1146
1170
|
class v {
|
|
1147
1171
|
constructor(e, t = null) {
|
|
1148
|
-
Object.defineProperty(this, j, { value:
|
|
1172
|
+
Object.defineProperty(this, j, { value: qt }), this.key = e, this.value = t;
|
|
1149
1173
|
}
|
|
1150
1174
|
clone(e) {
|
|
1151
1175
|
let { key: t, value: n } = this;
|
|
@@ -1153,31 +1177,31 @@ class v {
|
|
|
1153
1177
|
}
|
|
1154
1178
|
toJSON(e, t) {
|
|
1155
1179
|
const n = t != null && t.mapAsMap ? /* @__PURE__ */ new Map() : {};
|
|
1156
|
-
return
|
|
1180
|
+
return xt(t, n, this);
|
|
1157
1181
|
}
|
|
1158
1182
|
toString(e, t, n) {
|
|
1159
|
-
return e != null && e.doc ?
|
|
1183
|
+
return e != null && e.doc ? Vs(this, e, t, n) : JSON.stringify(this);
|
|
1160
1184
|
}
|
|
1161
1185
|
}
|
|
1162
|
-
function
|
|
1163
|
-
return (e.inFlow ?? s.flow ?
|
|
1186
|
+
function es(s, e, t) {
|
|
1187
|
+
return (e.inFlow ?? s.flow ? Qs : Gs)(s, e, t);
|
|
1164
1188
|
}
|
|
1165
|
-
function
|
|
1166
|
-
const { indent: a, options: { commentString: c } } = t,
|
|
1189
|
+
function Gs({ comment: s, items: e }, t, { blockItemPrefix: n, flowChars: i, itemIndent: r, onChompKeep: o, onComment: l }) {
|
|
1190
|
+
const { indent: a, options: { commentString: c } } = t, p = Object.assign({}, t, { indent: r, type: null });
|
|
1167
1191
|
let f = !1;
|
|
1168
1192
|
const d = [];
|
|
1169
1193
|
for (let y = 0; y < e.length; ++y) {
|
|
1170
1194
|
const u = e[y];
|
|
1171
|
-
let
|
|
1195
|
+
let m = null;
|
|
1172
1196
|
if ($(u))
|
|
1173
|
-
!f && u.spaceBefore && d.push(""),
|
|
1174
|
-
else if (
|
|
1197
|
+
!f && u.spaceBefore && d.push(""), je(t, d, u.commentBefore, f), u.comment && (m = u.comment);
|
|
1198
|
+
else if (T(u)) {
|
|
1175
1199
|
const w = $(u.key) ? u.key : null;
|
|
1176
|
-
w && (!f && w.spaceBefore && d.push(""),
|
|
1200
|
+
w && (!f && w.spaceBefore && d.push(""), je(t, d, w.commentBefore, f));
|
|
1177
1201
|
}
|
|
1178
1202
|
f = !1;
|
|
1179
|
-
let
|
|
1180
|
-
|
|
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);
|
|
1181
1205
|
}
|
|
1182
1206
|
let h;
|
|
1183
1207
|
if (d.length === 0)
|
|
@@ -1192,9 +1216,9 @@ ${a}${u}` : `
|
|
|
1192
1216
|
}
|
|
1193
1217
|
}
|
|
1194
1218
|
return s ? (h += `
|
|
1195
|
-
` +
|
|
1219
|
+
` + U(c(s), a), l && l()) : f && o && o(), h;
|
|
1196
1220
|
}
|
|
1197
|
-
function
|
|
1221
|
+
function Qs({ items: s }, e, { flowChars: t, itemIndent: n }) {
|
|
1198
1222
|
const { indent: i, indentStep: r, flowCollectionPadding: o, options: { commentString: l } } = e;
|
|
1199
1223
|
n += r;
|
|
1200
1224
|
const a = Object.assign({}, e, {
|
|
@@ -1202,29 +1226,29 @@ function Ys({ items: s }, e, { flowChars: t, itemIndent: n }) {
|
|
|
1202
1226
|
inFlow: !0,
|
|
1203
1227
|
type: null
|
|
1204
1228
|
});
|
|
1205
|
-
let c = !1,
|
|
1229
|
+
let c = !1, p = 0;
|
|
1206
1230
|
const f = [];
|
|
1207
1231
|
for (let y = 0; y < s.length; ++y) {
|
|
1208
1232
|
const u = s[y];
|
|
1209
|
-
let
|
|
1233
|
+
let m = null;
|
|
1210
1234
|
if ($(u))
|
|
1211
|
-
u.spaceBefore && f.push(""),
|
|
1212
|
-
else if (
|
|
1235
|
+
u.spaceBefore && f.push(""), je(e, f, u.commentBefore, !1), u.comment && (m = u.comment);
|
|
1236
|
+
else if (T(u)) {
|
|
1213
1237
|
const w = $(u.key) ? u.key : null;
|
|
1214
|
-
w && (w.spaceBefore && f.push(""),
|
|
1238
|
+
w && (w.spaceBefore && f.push(""), je(e, f, w.commentBefore, !1), w.comment && (c = !0));
|
|
1215
1239
|
const N = $(u.value) ? u.value : null;
|
|
1216
|
-
N ? (N.comment && (
|
|
1240
|
+
N ? (N.comment && (m = N.comment), N.commentBefore && (c = !0)) : u.value == null && (w != null && w.comment) && (m = w.comment);
|
|
1217
1241
|
}
|
|
1218
|
-
|
|
1219
|
-
let
|
|
1220
|
-
y < s.length - 1 && (
|
|
1221
|
-
`)) && (c = !0), f.push(
|
|
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;
|
|
1222
1246
|
}
|
|
1223
1247
|
const { start: d, end: h } = t;
|
|
1224
1248
|
if (f.length === 0)
|
|
1225
1249
|
return d + h;
|
|
1226
1250
|
if (!c) {
|
|
1227
|
-
const y = f.reduce((u,
|
|
1251
|
+
const y = f.reduce((u, m) => u + m.length + 2, 2);
|
|
1228
1252
|
c = e.options.lineWidth > 0 && y > e.options.lineWidth;
|
|
1229
1253
|
}
|
|
1230
1254
|
if (c) {
|
|
@@ -1238,24 +1262,24 @@ ${i}${h}`;
|
|
|
1238
1262
|
} else
|
|
1239
1263
|
return `${d}${o}${f.join(" ")}${o}${h}`;
|
|
1240
1264
|
}
|
|
1241
|
-
function
|
|
1265
|
+
function je({ indent: s, options: { commentString: e } }, t, n, i) {
|
|
1242
1266
|
if (n && i && (n = n.replace(/^\n+/, "")), n) {
|
|
1243
|
-
const r =
|
|
1267
|
+
const r = U(e(n), s);
|
|
1244
1268
|
t.push(r.trimStart());
|
|
1245
1269
|
}
|
|
1246
1270
|
}
|
|
1247
|
-
function
|
|
1271
|
+
function X(s, e) {
|
|
1248
1272
|
const t = E(e) ? e.value : e;
|
|
1249
1273
|
for (const n of s)
|
|
1250
|
-
if (
|
|
1274
|
+
if (T(n) && (n.key === e || n.key === t || E(n.key) && n.key.value === t))
|
|
1251
1275
|
return n;
|
|
1252
1276
|
}
|
|
1253
|
-
class
|
|
1277
|
+
class K extends Wt {
|
|
1254
1278
|
static get tagName() {
|
|
1255
1279
|
return "tag:yaml.org,2002:map";
|
|
1256
1280
|
}
|
|
1257
1281
|
constructor(e) {
|
|
1258
|
-
super(
|
|
1282
|
+
super(Y, e), this.items = [];
|
|
1259
1283
|
}
|
|
1260
1284
|
/**
|
|
1261
1285
|
* A generic collection parsing method that can be extended
|
|
@@ -1267,7 +1291,7 @@ class P extends Gt {
|
|
|
1267
1291
|
c = r.call(t, a, c);
|
|
1268
1292
|
else if (Array.isArray(r) && !r.includes(a))
|
|
1269
1293
|
return;
|
|
1270
|
-
(c !== void 0 || i) && o.items.push(
|
|
1294
|
+
(c !== void 0 || i) && o.items.push(mt(a, c, n));
|
|
1271
1295
|
};
|
|
1272
1296
|
if (t instanceof Map)
|
|
1273
1297
|
for (const [a, c] of t)
|
|
@@ -1286,12 +1310,12 @@ class P extends Gt {
|
|
|
1286
1310
|
add(e, t) {
|
|
1287
1311
|
var o;
|
|
1288
1312
|
let n;
|
|
1289
|
-
|
|
1290
|
-
const i =
|
|
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;
|
|
1291
1315
|
if (i) {
|
|
1292
1316
|
if (!t)
|
|
1293
1317
|
throw new Error(`Key ${n.key} already set`);
|
|
1294
|
-
E(i.value) &&
|
|
1318
|
+
E(i.value) && Qt(n.value) ? i.value.value = n.value : i.value = n.value;
|
|
1295
1319
|
} else if (r) {
|
|
1296
1320
|
const l = this.items.findIndex((a) => r(n, a) < 0);
|
|
1297
1321
|
l === -1 ? this.items.push(n) : this.items.splice(l, 0, n);
|
|
@@ -1299,15 +1323,15 @@ class P extends Gt {
|
|
|
1299
1323
|
this.items.push(n);
|
|
1300
1324
|
}
|
|
1301
1325
|
delete(e) {
|
|
1302
|
-
const t =
|
|
1326
|
+
const t = X(this.items, e);
|
|
1303
1327
|
return t ? this.items.splice(this.items.indexOf(t), 1).length > 0 : !1;
|
|
1304
1328
|
}
|
|
1305
1329
|
get(e, t) {
|
|
1306
|
-
const n =
|
|
1330
|
+
const n = X(this.items, e), i = n == null ? void 0 : n.value;
|
|
1307
1331
|
return (!t && E(i) ? i.value : i) ?? void 0;
|
|
1308
1332
|
}
|
|
1309
1333
|
has(e) {
|
|
1310
|
-
return !!
|
|
1334
|
+
return !!X(this.items, e);
|
|
1311
1335
|
}
|
|
1312
1336
|
set(e, t) {
|
|
1313
1337
|
this.add(new v(e, t), !0);
|
|
@@ -1321,16 +1345,16 @@ class P extends Gt {
|
|
|
1321
1345
|
const i = n ? new n() : t != null && t.mapAsMap ? /* @__PURE__ */ new Map() : {};
|
|
1322
1346
|
t != null && t.onCreate && t.onCreate(i);
|
|
1323
1347
|
for (const r of this.items)
|
|
1324
|
-
|
|
1348
|
+
xt(t, i, r);
|
|
1325
1349
|
return i;
|
|
1326
1350
|
}
|
|
1327
1351
|
toString(e, t, n) {
|
|
1328
1352
|
if (!e)
|
|
1329
1353
|
return JSON.stringify(this);
|
|
1330
1354
|
for (const i of this.items)
|
|
1331
|
-
if (!
|
|
1355
|
+
if (!T(i))
|
|
1332
1356
|
throw new Error(`Map items must all be pairs; found ${JSON.stringify(i)} instead`);
|
|
1333
|
-
return !e.allNullValues && this.hasAllNullValues(!1) && (e = Object.assign({}, e, { allNullValues: !0 })),
|
|
1357
|
+
return !e.allNullValues && this.hasAllNullValues(!1) && (e = Object.assign({}, e, { allNullValues: !0 })), es(this, e, {
|
|
1334
1358
|
blockItemPrefix: "",
|
|
1335
1359
|
flowChars: { start: "{", end: "}" },
|
|
1336
1360
|
itemIndent: e.indent || "",
|
|
@@ -1339,22 +1363,22 @@ class P extends Gt {
|
|
|
1339
1363
|
});
|
|
1340
1364
|
}
|
|
1341
1365
|
}
|
|
1342
|
-
const
|
|
1366
|
+
const me = {
|
|
1343
1367
|
collection: "map",
|
|
1344
1368
|
default: !0,
|
|
1345
|
-
nodeClass:
|
|
1369
|
+
nodeClass: K,
|
|
1346
1370
|
tag: "tag:yaml.org,2002:map",
|
|
1347
1371
|
resolve(s, e) {
|
|
1348
|
-
return
|
|
1372
|
+
return de(s) || e("Expected a mapping for this tag"), s;
|
|
1349
1373
|
},
|
|
1350
|
-
createNode: (s, e, t) =>
|
|
1374
|
+
createNode: (s, e, t) => K.from(s, e, t)
|
|
1351
1375
|
};
|
|
1352
|
-
class
|
|
1376
|
+
class Q extends Wt {
|
|
1353
1377
|
static get tagName() {
|
|
1354
1378
|
return "tag:yaml.org,2002:seq";
|
|
1355
1379
|
}
|
|
1356
1380
|
constructor(e) {
|
|
1357
|
-
super(
|
|
1381
|
+
super(he, e), this.items = [];
|
|
1358
1382
|
}
|
|
1359
1383
|
add(e) {
|
|
1360
1384
|
this.items.push(e);
|
|
@@ -1368,11 +1392,11 @@ class J extends Gt {
|
|
|
1368
1392
|
* @returns `true` if the item was found and removed.
|
|
1369
1393
|
*/
|
|
1370
1394
|
delete(e) {
|
|
1371
|
-
const t =
|
|
1395
|
+
const t = Le(e);
|
|
1372
1396
|
return typeof t != "number" ? !1 : this.items.splice(t, 1).length > 0;
|
|
1373
1397
|
}
|
|
1374
1398
|
get(e, t) {
|
|
1375
|
-
const n =
|
|
1399
|
+
const n = Le(e);
|
|
1376
1400
|
if (typeof n != "number")
|
|
1377
1401
|
return;
|
|
1378
1402
|
const i = this.items[n];
|
|
@@ -1385,7 +1409,7 @@ class J extends Gt {
|
|
|
1385
1409
|
* It may be wrapped in a `Scalar`.
|
|
1386
1410
|
*/
|
|
1387
1411
|
has(e) {
|
|
1388
|
-
const t =
|
|
1412
|
+
const t = Le(e);
|
|
1389
1413
|
return typeof t == "number" && t < this.items.length;
|
|
1390
1414
|
}
|
|
1391
1415
|
/**
|
|
@@ -1396,22 +1420,22 @@ class J extends Gt {
|
|
|
1396
1420
|
* It may be wrapped in a `Scalar`.
|
|
1397
1421
|
*/
|
|
1398
1422
|
set(e, t) {
|
|
1399
|
-
const n =
|
|
1423
|
+
const n = Le(e);
|
|
1400
1424
|
if (typeof n != "number")
|
|
1401
1425
|
throw new Error(`Expected a valid index, not ${e}.`);
|
|
1402
1426
|
const i = this.items[n];
|
|
1403
|
-
E(i) &&
|
|
1427
|
+
E(i) && Qt(t) ? i.value = t : this.items[n] = t;
|
|
1404
1428
|
}
|
|
1405
1429
|
toJSON(e, t) {
|
|
1406
1430
|
const n = [];
|
|
1407
1431
|
t != null && t.onCreate && t.onCreate(n);
|
|
1408
1432
|
let i = 0;
|
|
1409
1433
|
for (const r of this.items)
|
|
1410
|
-
n.push(
|
|
1434
|
+
n.push(P(r, String(i++), t));
|
|
1411
1435
|
return n;
|
|
1412
1436
|
}
|
|
1413
1437
|
toString(e, t, n) {
|
|
1414
|
-
return e ?
|
|
1438
|
+
return e ? es(this, e, {
|
|
1415
1439
|
blockItemPrefix: "- ",
|
|
1416
1440
|
flowChars: { start: "[", end: "]" },
|
|
1417
1441
|
itemIndent: (e.indent || "") + " ",
|
|
@@ -1428,49 +1452,49 @@ class J extends Gt {
|
|
|
1428
1452
|
const a = t instanceof Set ? l : String(o++);
|
|
1429
1453
|
l = i.call(t, a, l);
|
|
1430
1454
|
}
|
|
1431
|
-
r.items.push(
|
|
1455
|
+
r.items.push(ke(l, void 0, n));
|
|
1432
1456
|
}
|
|
1433
1457
|
}
|
|
1434
1458
|
return r;
|
|
1435
1459
|
}
|
|
1436
1460
|
}
|
|
1437
|
-
function
|
|
1461
|
+
function Le(s) {
|
|
1438
1462
|
let e = E(s) ? s.value : s;
|
|
1439
1463
|
return e && typeof e == "string" && (e = Number(e)), typeof e == "number" && Number.isInteger(e) && e >= 0 ? e : null;
|
|
1440
1464
|
}
|
|
1441
|
-
const
|
|
1465
|
+
const ye = {
|
|
1442
1466
|
collection: "seq",
|
|
1443
1467
|
default: !0,
|
|
1444
|
-
nodeClass:
|
|
1468
|
+
nodeClass: Q,
|
|
1445
1469
|
tag: "tag:yaml.org,2002:seq",
|
|
1446
1470
|
resolve(s, e) {
|
|
1447
|
-
return
|
|
1471
|
+
return pe(s) || e("Expected a sequence for this tag"), s;
|
|
1448
1472
|
},
|
|
1449
|
-
createNode: (s, e, t) =>
|
|
1450
|
-
},
|
|
1473
|
+
createNode: (s, e, t) => Q.from(s, e, t)
|
|
1474
|
+
}, Ye = {
|
|
1451
1475
|
identify: (s) => typeof s == "string",
|
|
1452
1476
|
default: !0,
|
|
1453
1477
|
tag: "tag:yaml.org,2002:str",
|
|
1454
1478
|
resolve: (s) => s,
|
|
1455
1479
|
stringify(s, e, t, n) {
|
|
1456
|
-
return e = Object.assign({ actualString: !0 }, e),
|
|
1480
|
+
return e = Object.assign({ actualString: !0 }, e), Ae(s, e, t, n);
|
|
1457
1481
|
}
|
|
1458
|
-
},
|
|
1482
|
+
}, Ge = {
|
|
1459
1483
|
identify: (s) => s == null,
|
|
1460
|
-
createNode: () => new
|
|
1484
|
+
createNode: () => new A(null),
|
|
1461
1485
|
default: !0,
|
|
1462
1486
|
tag: "tag:yaml.org,2002:null",
|
|
1463
1487
|
test: /^(?:~|[Nn]ull|NULL)?$/,
|
|
1464
|
-
resolve: () => new
|
|
1465
|
-
stringify: ({ source: s }, e) => typeof s == "string" &&
|
|
1466
|
-
},
|
|
1488
|
+
resolve: () => new A(null),
|
|
1489
|
+
stringify: ({ source: s }, e) => typeof s == "string" && Ge.test.test(s) ? s : e.options.nullStr
|
|
1490
|
+
}, yt = {
|
|
1467
1491
|
identify: (s) => typeof s == "boolean",
|
|
1468
1492
|
default: !0,
|
|
1469
1493
|
tag: "tag:yaml.org,2002:bool",
|
|
1470
1494
|
test: /^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,
|
|
1471
|
-
resolve: (s) => new
|
|
1495
|
+
resolve: (s) => new A(s[0] === "t" || s[0] === "T"),
|
|
1472
1496
|
stringify({ source: s, value: e }, t) {
|
|
1473
|
-
if (s &&
|
|
1497
|
+
if (s && yt.test.test(s)) {
|
|
1474
1498
|
const n = s[0] === "t" || s[0] === "T";
|
|
1475
1499
|
if (e === n)
|
|
1476
1500
|
return s;
|
|
@@ -1494,14 +1518,14 @@ function q({ format: s, minFractionDigits: e, tag: t, value: n }) {
|
|
|
1494
1518
|
}
|
|
1495
1519
|
return r;
|
|
1496
1520
|
}
|
|
1497
|
-
const
|
|
1521
|
+
const ts = {
|
|
1498
1522
|
identify: (s) => typeof s == "number",
|
|
1499
1523
|
default: !0,
|
|
1500
1524
|
tag: "tag:yaml.org,2002:float",
|
|
1501
1525
|
test: /^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,
|
|
1502
1526
|
resolve: (s) => s.slice(-3).toLowerCase() === "nan" ? NaN : s[0] === "-" ? Number.NEGATIVE_INFINITY : Number.POSITIVE_INFINITY,
|
|
1503
1527
|
stringify: q
|
|
1504
|
-
},
|
|
1528
|
+
}, ss = {
|
|
1505
1529
|
identify: (s) => typeof s == "number",
|
|
1506
1530
|
default: !0,
|
|
1507
1531
|
tag: "tag:yaml.org,2002:float",
|
|
@@ -1512,92 +1536,92 @@ const Zt = {
|
|
|
1512
1536
|
const e = Number(s.value);
|
|
1513
1537
|
return isFinite(e) ? e.toExponential() : q(s);
|
|
1514
1538
|
}
|
|
1515
|
-
},
|
|
1539
|
+
}, ns = {
|
|
1516
1540
|
identify: (s) => typeof s == "number",
|
|
1517
1541
|
default: !0,
|
|
1518
1542
|
tag: "tag:yaml.org,2002:float",
|
|
1519
1543
|
test: /^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,
|
|
1520
1544
|
resolve(s) {
|
|
1521
|
-
const e = new
|
|
1545
|
+
const e = new A(parseFloat(s)), t = s.indexOf(".");
|
|
1522
1546
|
return t !== -1 && s[s.length - 1] === "0" && (e.minFractionDigits = s.length - t - 1), e;
|
|
1523
1547
|
},
|
|
1524
1548
|
stringify: q
|
|
1525
|
-
},
|
|
1526
|
-
function
|
|
1549
|
+
}, Qe = (s) => typeof s == "bigint" || Number.isInteger(s), gt = (s, e, t, { intAsBigInt: n }) => n ? BigInt(s) : parseInt(s.substring(e), t);
|
|
1550
|
+
function is(s, e, t) {
|
|
1527
1551
|
const { value: n } = s;
|
|
1528
|
-
return
|
|
1552
|
+
return Qe(n) && n >= 0 ? t + n.toString(e) : q(s);
|
|
1529
1553
|
}
|
|
1530
|
-
const
|
|
1531
|
-
identify: (s) =>
|
|
1554
|
+
const rs = {
|
|
1555
|
+
identify: (s) => Qe(s) && s >= 0,
|
|
1532
1556
|
default: !0,
|
|
1533
1557
|
tag: "tag:yaml.org,2002:int",
|
|
1534
1558
|
format: "OCT",
|
|
1535
1559
|
test: /^0o[0-7]+$/,
|
|
1536
|
-
resolve: (s, e, t) =>
|
|
1537
|
-
stringify: (s) =>
|
|
1538
|
-
},
|
|
1539
|
-
identify:
|
|
1560
|
+
resolve: (s, e, t) => gt(s, 2, 8, t),
|
|
1561
|
+
stringify: (s) => is(s, 8, "0o")
|
|
1562
|
+
}, os = {
|
|
1563
|
+
identify: Qe,
|
|
1540
1564
|
default: !0,
|
|
1541
1565
|
tag: "tag:yaml.org,2002:int",
|
|
1542
1566
|
test: /^[-+]?[0-9]+$/,
|
|
1543
|
-
resolve: (s, e, t) =>
|
|
1567
|
+
resolve: (s, e, t) => gt(s, 0, 10, t),
|
|
1544
1568
|
stringify: q
|
|
1545
|
-
},
|
|
1546
|
-
identify: (s) =>
|
|
1569
|
+
}, ls = {
|
|
1570
|
+
identify: (s) => Qe(s) && s >= 0,
|
|
1547
1571
|
default: !0,
|
|
1548
1572
|
tag: "tag:yaml.org,2002:int",
|
|
1549
1573
|
format: "HEX",
|
|
1550
1574
|
test: /^0x[0-9a-fA-F]+$/,
|
|
1551
|
-
resolve: (s, e, t) =>
|
|
1552
|
-
stringify: (s) =>
|
|
1553
|
-
},
|
|
1554
|
-
pe,
|
|
1575
|
+
resolve: (s, e, t) => gt(s, 2, 16, t),
|
|
1576
|
+
stringify: (s) => is(s, 16, "0x")
|
|
1577
|
+
}, Ws = [
|
|
1555
1578
|
me,
|
|
1556
|
-
|
|
1579
|
+
ye,
|
|
1557
1580
|
Ye,
|
|
1558
|
-
|
|
1581
|
+
Ge,
|
|
1582
|
+
yt,
|
|
1583
|
+
rs,
|
|
1584
|
+
os,
|
|
1585
|
+
ls,
|
|
1586
|
+
ts,
|
|
1559
1587
|
ss,
|
|
1560
|
-
ns
|
|
1561
|
-
is,
|
|
1562
|
-
Zt,
|
|
1563
|
-
xt,
|
|
1564
|
-
es
|
|
1588
|
+
ns
|
|
1565
1589
|
];
|
|
1566
|
-
function
|
|
1590
|
+
function _t(s) {
|
|
1567
1591
|
return typeof s == "bigint" || Number.isInteger(s);
|
|
1568
1592
|
}
|
|
1569
|
-
const
|
|
1593
|
+
const $e = ({ value: s }) => JSON.stringify(s), Hs = [
|
|
1570
1594
|
{
|
|
1571
1595
|
identify: (s) => typeof s == "string",
|
|
1572
1596
|
default: !0,
|
|
1573
1597
|
tag: "tag:yaml.org,2002:str",
|
|
1574
1598
|
resolve: (s) => s,
|
|
1575
|
-
stringify:
|
|
1599
|
+
stringify: $e
|
|
1576
1600
|
},
|
|
1577
1601
|
{
|
|
1578
1602
|
identify: (s) => s == null,
|
|
1579
|
-
createNode: () => new
|
|
1603
|
+
createNode: () => new A(null),
|
|
1580
1604
|
default: !0,
|
|
1581
1605
|
tag: "tag:yaml.org,2002:null",
|
|
1582
1606
|
test: /^null$/,
|
|
1583
1607
|
resolve: () => null,
|
|
1584
|
-
stringify:
|
|
1608
|
+
stringify: $e
|
|
1585
1609
|
},
|
|
1586
1610
|
{
|
|
1587
1611
|
identify: (s) => typeof s == "boolean",
|
|
1588
1612
|
default: !0,
|
|
1589
1613
|
tag: "tag:yaml.org,2002:bool",
|
|
1590
|
-
test: /^true
|
|
1614
|
+
test: /^true$|^false$/,
|
|
1591
1615
|
resolve: (s) => s === "true",
|
|
1592
|
-
stringify:
|
|
1616
|
+
stringify: $e
|
|
1593
1617
|
},
|
|
1594
1618
|
{
|
|
1595
|
-
identify:
|
|
1619
|
+
identify: _t,
|
|
1596
1620
|
default: !0,
|
|
1597
1621
|
tag: "tag:yaml.org,2002:int",
|
|
1598
1622
|
test: /^-?(?:0|[1-9][0-9]*)$/,
|
|
1599
1623
|
resolve: (s, e, { intAsBigInt: t }) => t ? BigInt(s) : parseInt(s, 10),
|
|
1600
|
-
stringify: ({ value: s }) =>
|
|
1624
|
+
stringify: ({ value: s }) => _t(s) ? s.toString() : JSON.stringify(s)
|
|
1601
1625
|
},
|
|
1602
1626
|
{
|
|
1603
1627
|
identify: (s) => typeof s == "number",
|
|
@@ -1605,16 +1629,16 @@ const Te = ({ value: s }) => JSON.stringify(s), Gs = [
|
|
|
1605
1629
|
tag: "tag:yaml.org,2002:float",
|
|
1606
1630
|
test: /^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,
|
|
1607
1631
|
resolve: (s) => parseFloat(s),
|
|
1608
|
-
stringify:
|
|
1632
|
+
stringify: $e
|
|
1609
1633
|
}
|
|
1610
|
-
],
|
|
1634
|
+
], Xs = {
|
|
1611
1635
|
default: !0,
|
|
1612
1636
|
tag: "",
|
|
1613
1637
|
test: /^/,
|
|
1614
1638
|
resolve(s, e) {
|
|
1615
1639
|
return e(`Unresolved plain scalar ${JSON.stringify(s)}`), s;
|
|
1616
1640
|
}
|
|
1617
|
-
},
|
|
1641
|
+
}, zs = [me, ye].concat(Hs, Xs), bt = {
|
|
1618
1642
|
identify: (s) => s instanceof Uint8Array,
|
|
1619
1643
|
// Buffer inherits from Uint8Array
|
|
1620
1644
|
default: !1,
|
|
@@ -1650,24 +1674,24 @@ const Te = ({ value: s }) => JSON.stringify(s), Gs = [
|
|
|
1650
1674
|
l = btoa(a);
|
|
1651
1675
|
} else
|
|
1652
1676
|
throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");
|
|
1653
|
-
if (e || (e =
|
|
1654
|
-
const a = Math.max(n.options.lineWidth - n.indent.length, n.options.minContentWidth), c = Math.ceil(l.length / a),
|
|
1677
|
+
if (e || (e = A.BLOCK_LITERAL), e !== A.QUOTE_DOUBLE) {
|
|
1678
|
+
const a = Math.max(n.options.lineWidth - n.indent.length, n.options.minContentWidth), c = Math.ceil(l.length / a), p = new Array(c);
|
|
1655
1679
|
for (let f = 0, d = 0; f < c; ++f, d += a)
|
|
1656
|
-
|
|
1657
|
-
l =
|
|
1680
|
+
p[f] = l.substr(d, a);
|
|
1681
|
+
l = p.join(e === A.BLOCK_LITERAL ? `
|
|
1658
1682
|
` : " ");
|
|
1659
1683
|
}
|
|
1660
|
-
return
|
|
1684
|
+
return Ae({ comment: s, type: e, value: l }, n, i, r);
|
|
1661
1685
|
}
|
|
1662
1686
|
};
|
|
1663
|
-
function
|
|
1664
|
-
if (
|
|
1687
|
+
function as(s, e) {
|
|
1688
|
+
if (pe(s))
|
|
1665
1689
|
for (let t = 0; t < s.items.length; ++t) {
|
|
1666
1690
|
let n = s.items[t];
|
|
1667
|
-
if (!
|
|
1668
|
-
if (
|
|
1691
|
+
if (!T(n)) {
|
|
1692
|
+
if (de(n)) {
|
|
1669
1693
|
n.items.length > 1 && e("Each pair must have its own sequence indicator");
|
|
1670
|
-
const i = n.items[0] || new v(new
|
|
1694
|
+
const i = n.items[0] || new v(new A(null));
|
|
1671
1695
|
if (n.commentBefore && (i.key.commentBefore = i.key.commentBefore ? `${n.commentBefore}
|
|
1672
1696
|
${i.key.commentBefore}` : n.commentBefore), n.comment) {
|
|
1673
1697
|
const r = i.value ?? i.key;
|
|
@@ -1676,15 +1700,15 @@ ${r.comment}` : n.comment;
|
|
|
1676
1700
|
}
|
|
1677
1701
|
n = i;
|
|
1678
1702
|
}
|
|
1679
|
-
s.items[t] =
|
|
1703
|
+
s.items[t] = T(n) ? n : new v(n);
|
|
1680
1704
|
}
|
|
1681
1705
|
}
|
|
1682
1706
|
else
|
|
1683
1707
|
e("Expected a sequence for this tag");
|
|
1684
1708
|
return s;
|
|
1685
1709
|
}
|
|
1686
|
-
function
|
|
1687
|
-
const { replacer: n } = t, i = new
|
|
1710
|
+
function cs(s, e, t) {
|
|
1711
|
+
const { replacer: n } = t, i = new Q(s);
|
|
1688
1712
|
i.tag = "tag:yaml.org,2002:pairs";
|
|
1689
1713
|
let r = 0;
|
|
1690
1714
|
if (e && Symbol.iterator in Object(e))
|
|
@@ -1704,20 +1728,20 @@ function os(s, e, t) {
|
|
|
1704
1728
|
throw new TypeError(`Expected tuple with one key, not ${c.length} keys`);
|
|
1705
1729
|
} else
|
|
1706
1730
|
l = o;
|
|
1707
|
-
i.items.push(
|
|
1731
|
+
i.items.push(mt(l, a, t));
|
|
1708
1732
|
}
|
|
1709
1733
|
return i;
|
|
1710
1734
|
}
|
|
1711
|
-
const
|
|
1735
|
+
const wt = {
|
|
1712
1736
|
collection: "seq",
|
|
1713
1737
|
default: !1,
|
|
1714
1738
|
tag: "tag:yaml.org,2002:pairs",
|
|
1715
|
-
resolve:
|
|
1716
|
-
createNode:
|
|
1739
|
+
resolve: as,
|
|
1740
|
+
createNode: cs
|
|
1717
1741
|
};
|
|
1718
|
-
class
|
|
1742
|
+
class ae extends Q {
|
|
1719
1743
|
constructor() {
|
|
1720
|
-
super(), this.add =
|
|
1744
|
+
super(), this.add = K.prototype.add.bind(this), this.delete = K.prototype.delete.bind(this), this.get = K.prototype.get.bind(this), this.has = K.prototype.has.bind(this), this.set = K.prototype.set.bind(this), this.tag = ae.tag;
|
|
1721
1745
|
}
|
|
1722
1746
|
/**
|
|
1723
1747
|
* If `ctx` is given, the return type is actually `Map<unknown, unknown>`,
|
|
@@ -1730,57 +1754,57 @@ class oe extends J {
|
|
|
1730
1754
|
t != null && t.onCreate && t.onCreate(n);
|
|
1731
1755
|
for (const i of this.items) {
|
|
1732
1756
|
let r, o;
|
|
1733
|
-
if (
|
|
1757
|
+
if (T(i) ? (r = P(i.key, "", t), o = P(i.value, r, t)) : r = P(i, "", t), n.has(r))
|
|
1734
1758
|
throw new Error("Ordered maps must not include duplicate keys");
|
|
1735
1759
|
n.set(r, o);
|
|
1736
1760
|
}
|
|
1737
1761
|
return n;
|
|
1738
1762
|
}
|
|
1739
1763
|
static from(e, t, n) {
|
|
1740
|
-
const i =
|
|
1764
|
+
const i = cs(e, t, n), r = new this();
|
|
1741
1765
|
return r.items = i.items, r;
|
|
1742
1766
|
}
|
|
1743
1767
|
}
|
|
1744
|
-
|
|
1745
|
-
const
|
|
1768
|
+
ae.tag = "tag:yaml.org,2002:omap";
|
|
1769
|
+
const St = {
|
|
1746
1770
|
collection: "seq",
|
|
1747
1771
|
identify: (s) => s instanceof Map,
|
|
1748
|
-
nodeClass:
|
|
1772
|
+
nodeClass: ae,
|
|
1749
1773
|
default: !1,
|
|
1750
1774
|
tag: "tag:yaml.org,2002:omap",
|
|
1751
1775
|
resolve(s, e) {
|
|
1752
|
-
const t =
|
|
1776
|
+
const t = as(s, e), n = [];
|
|
1753
1777
|
for (const { key: i } of t.items)
|
|
1754
1778
|
E(i) && (n.includes(i.value) ? e(`Ordered maps must not include duplicate keys: ${i.value}`) : n.push(i.value));
|
|
1755
|
-
return Object.assign(new
|
|
1779
|
+
return Object.assign(new ae(), t);
|
|
1756
1780
|
},
|
|
1757
|
-
createNode: (s, e, t) =>
|
|
1781
|
+
createNode: (s, e, t) => ae.from(s, e, t)
|
|
1758
1782
|
};
|
|
1759
|
-
function
|
|
1760
|
-
return e && (s ?
|
|
1783
|
+
function fs({ value: s, source: e }, t) {
|
|
1784
|
+
return e && (s ? us : hs).test.test(e) ? e : s ? t.options.trueStr : t.options.falseStr;
|
|
1761
1785
|
}
|
|
1762
|
-
const
|
|
1786
|
+
const us = {
|
|
1763
1787
|
identify: (s) => s === !0,
|
|
1764
1788
|
default: !0,
|
|
1765
1789
|
tag: "tag:yaml.org,2002:bool",
|
|
1766
1790
|
test: /^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,
|
|
1767
|
-
resolve: () => new
|
|
1768
|
-
stringify:
|
|
1769
|
-
},
|
|
1791
|
+
resolve: () => new A(!0),
|
|
1792
|
+
stringify: fs
|
|
1793
|
+
}, hs = {
|
|
1770
1794
|
identify: (s) => s === !1,
|
|
1771
1795
|
default: !0,
|
|
1772
1796
|
tag: "tag:yaml.org,2002:bool",
|
|
1773
1797
|
test: /^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,
|
|
1774
|
-
resolve: () => new
|
|
1775
|
-
stringify:
|
|
1776
|
-
},
|
|
1798
|
+
resolve: () => new A(!1),
|
|
1799
|
+
stringify: fs
|
|
1800
|
+
}, Zs = {
|
|
1777
1801
|
identify: (s) => typeof s == "number",
|
|
1778
1802
|
default: !0,
|
|
1779
1803
|
tag: "tag:yaml.org,2002:float",
|
|
1780
1804
|
test: /^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,
|
|
1781
1805
|
resolve: (s) => s.slice(-3).toLowerCase() === "nan" ? NaN : s[0] === "-" ? Number.NEGATIVE_INFINITY : Number.POSITIVE_INFINITY,
|
|
1782
1806
|
stringify: q
|
|
1783
|
-
},
|
|
1807
|
+
}, xs = {
|
|
1784
1808
|
identify: (s) => typeof s == "number",
|
|
1785
1809
|
default: !0,
|
|
1786
1810
|
tag: "tag:yaml.org,2002:float",
|
|
@@ -1791,13 +1815,13 @@ const as = {
|
|
|
1791
1815
|
const e = Number(s.value);
|
|
1792
1816
|
return isFinite(e) ? e.toExponential() : q(s);
|
|
1793
1817
|
}
|
|
1794
|
-
},
|
|
1818
|
+
}, en = {
|
|
1795
1819
|
identify: (s) => typeof s == "number",
|
|
1796
1820
|
default: !0,
|
|
1797
1821
|
tag: "tag:yaml.org,2002:float",
|
|
1798
1822
|
test: /^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,
|
|
1799
1823
|
resolve(s) {
|
|
1800
|
-
const e = new
|
|
1824
|
+
const e = new A(parseFloat(s.replace(/_/g, ""))), t = s.indexOf(".");
|
|
1801
1825
|
if (t !== -1) {
|
|
1802
1826
|
const n = s.substring(t + 1).replace(/_/g, "");
|
|
1803
1827
|
n[n.length - 1] === "0" && (e.minFractionDigits = n.length);
|
|
@@ -1805,8 +1829,8 @@ const as = {
|
|
|
1805
1829
|
return e;
|
|
1806
1830
|
},
|
|
1807
1831
|
stringify: q
|
|
1808
|
-
},
|
|
1809
|
-
function
|
|
1832
|
+
}, Ee = (s) => typeof s == "bigint" || Number.isInteger(s);
|
|
1833
|
+
function We(s, e, t, { intAsBigInt: n }) {
|
|
1810
1834
|
const i = s[0];
|
|
1811
1835
|
if ((i === "-" || i === "+") && (e += 1), s = s.substring(e).replace(/_/g, ""), n) {
|
|
1812
1836
|
switch (t) {
|
|
@@ -1826,66 +1850,66 @@ function Ge(s, e, t, { intAsBigInt: n }) {
|
|
|
1826
1850
|
const r = parseInt(s, t);
|
|
1827
1851
|
return i === "-" ? -1 * r : r;
|
|
1828
1852
|
}
|
|
1829
|
-
function
|
|
1853
|
+
function kt(s, e, t) {
|
|
1830
1854
|
const { value: n } = s;
|
|
1831
|
-
if (
|
|
1855
|
+
if (Ee(n)) {
|
|
1832
1856
|
const i = n.toString(e);
|
|
1833
1857
|
return n < 0 ? "-" + t + i.substr(1) : t + i;
|
|
1834
1858
|
}
|
|
1835
1859
|
return q(s);
|
|
1836
1860
|
}
|
|
1837
|
-
const
|
|
1838
|
-
identify:
|
|
1861
|
+
const tn = {
|
|
1862
|
+
identify: Ee,
|
|
1839
1863
|
default: !0,
|
|
1840
1864
|
tag: "tag:yaml.org,2002:int",
|
|
1841
1865
|
format: "BIN",
|
|
1842
1866
|
test: /^[-+]?0b[0-1_]+$/,
|
|
1843
|
-
resolve: (s, e, t) =>
|
|
1844
|
-
stringify: (s) =>
|
|
1845
|
-
},
|
|
1846
|
-
identify:
|
|
1867
|
+
resolve: (s, e, t) => We(s, 2, 2, t),
|
|
1868
|
+
stringify: (s) => kt(s, 2, "0b")
|
|
1869
|
+
}, sn = {
|
|
1870
|
+
identify: Ee,
|
|
1847
1871
|
default: !0,
|
|
1848
1872
|
tag: "tag:yaml.org,2002:int",
|
|
1849
1873
|
format: "OCT",
|
|
1850
1874
|
test: /^[-+]?0[0-7_]+$/,
|
|
1851
|
-
resolve: (s, e, t) =>
|
|
1852
|
-
stringify: (s) =>
|
|
1853
|
-
},
|
|
1854
|
-
identify:
|
|
1875
|
+
resolve: (s, e, t) => We(s, 1, 8, t),
|
|
1876
|
+
stringify: (s) => kt(s, 8, "0")
|
|
1877
|
+
}, nn = {
|
|
1878
|
+
identify: Ee,
|
|
1855
1879
|
default: !0,
|
|
1856
1880
|
tag: "tag:yaml.org,2002:int",
|
|
1857
1881
|
test: /^[-+]?[0-9][0-9_]*$/,
|
|
1858
|
-
resolve: (s, e, t) =>
|
|
1882
|
+
resolve: (s, e, t) => We(s, 0, 10, t),
|
|
1859
1883
|
stringify: q
|
|
1860
|
-
},
|
|
1861
|
-
identify:
|
|
1884
|
+
}, rn = {
|
|
1885
|
+
identify: Ee,
|
|
1862
1886
|
default: !0,
|
|
1863
1887
|
tag: "tag:yaml.org,2002:int",
|
|
1864
1888
|
format: "HEX",
|
|
1865
1889
|
test: /^[-+]?0x[0-9a-fA-F_]+$/,
|
|
1866
|
-
resolve: (s, e, t) =>
|
|
1867
|
-
stringify: (s) =>
|
|
1890
|
+
resolve: (s, e, t) => We(s, 2, 16, t),
|
|
1891
|
+
stringify: (s) => kt(s, 16, "0x")
|
|
1868
1892
|
};
|
|
1869
|
-
class
|
|
1893
|
+
class ce extends K {
|
|
1870
1894
|
constructor(e) {
|
|
1871
|
-
super(e), this.tag =
|
|
1895
|
+
super(e), this.tag = ce.tag;
|
|
1872
1896
|
}
|
|
1873
1897
|
add(e) {
|
|
1874
1898
|
let t;
|
|
1875
|
-
|
|
1899
|
+
T(e) ? t = e : e && typeof e == "object" && "key" in e && "value" in e && e.value === null ? t = new v(e.key, null) : t = new v(e, null), X(this.items, t.key) || this.items.push(t);
|
|
1876
1900
|
}
|
|
1877
1901
|
/**
|
|
1878
1902
|
* If `keepPair` is `true`, returns the Pair matching `key`.
|
|
1879
1903
|
* Otherwise, returns the value of that Pair's key.
|
|
1880
1904
|
*/
|
|
1881
1905
|
get(e, t) {
|
|
1882
|
-
const n =
|
|
1883
|
-
return !t &&
|
|
1906
|
+
const n = X(this.items, e);
|
|
1907
|
+
return !t && T(n) ? E(n.key) ? n.key.value : n.key : n;
|
|
1884
1908
|
}
|
|
1885
1909
|
set(e, t) {
|
|
1886
1910
|
if (typeof t != "boolean")
|
|
1887
1911
|
throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);
|
|
1888
|
-
const n =
|
|
1912
|
+
const n = X(this.items, e);
|
|
1889
1913
|
n && !t ? this.items.splice(this.items.indexOf(n), 1) : !n && t && this.items.push(new v(e));
|
|
1890
1914
|
}
|
|
1891
1915
|
toJSON(e, t) {
|
|
@@ -1902,33 +1926,33 @@ class le extends P {
|
|
|
1902
1926
|
const { replacer: i } = n, r = new this(e);
|
|
1903
1927
|
if (t && Symbol.iterator in Object(t))
|
|
1904
1928
|
for (let o of t)
|
|
1905
|
-
typeof i == "function" && (o = i.call(t, o, o)), r.items.push(
|
|
1929
|
+
typeof i == "function" && (o = i.call(t, o, o)), r.items.push(mt(o, null, n));
|
|
1906
1930
|
return r;
|
|
1907
1931
|
}
|
|
1908
1932
|
}
|
|
1909
|
-
|
|
1910
|
-
const
|
|
1933
|
+
ce.tag = "tag:yaml.org,2002:set";
|
|
1934
|
+
const Nt = {
|
|
1911
1935
|
collection: "map",
|
|
1912
1936
|
identify: (s) => s instanceof Set,
|
|
1913
|
-
nodeClass:
|
|
1937
|
+
nodeClass: ce,
|
|
1914
1938
|
default: !1,
|
|
1915
1939
|
tag: "tag:yaml.org,2002:set",
|
|
1916
|
-
createNode: (s, e, t) =>
|
|
1940
|
+
createNode: (s, e, t) => ce.from(s, e, t),
|
|
1917
1941
|
resolve(s, e) {
|
|
1918
|
-
if (
|
|
1942
|
+
if (de(s)) {
|
|
1919
1943
|
if (s.hasAllNullValues(!0))
|
|
1920
|
-
return Object.assign(new
|
|
1944
|
+
return Object.assign(new ce(), s);
|
|
1921
1945
|
e("Set items must all have null values");
|
|
1922
1946
|
} else
|
|
1923
1947
|
e("Expected a mapping for this tag");
|
|
1924
1948
|
return s;
|
|
1925
1949
|
}
|
|
1926
1950
|
};
|
|
1927
|
-
function
|
|
1951
|
+
function Ot(s, e) {
|
|
1928
1952
|
const t = s[0], n = t === "-" || t === "+" ? s.substring(1) : s, i = (o) => e ? BigInt(o) : Number(o), r = n.replace(/_/g, "").split(":").reduce((o, l) => o * i(60) + i(l), i(0));
|
|
1929
1953
|
return t === "-" ? i(-1) * r : r;
|
|
1930
1954
|
}
|
|
1931
|
-
function
|
|
1955
|
+
function ds(s) {
|
|
1932
1956
|
let { value: e } = s, t = (o) => o;
|
|
1933
1957
|
if (typeof e == "bigint")
|
|
1934
1958
|
t = (o) => BigInt(o);
|
|
@@ -1939,23 +1963,23 @@ function fs(s) {
|
|
|
1939
1963
|
const i = t(60), r = [e % i];
|
|
1940
1964
|
return e < 60 ? r.unshift(0) : (e = (e - r[0]) / i, r.unshift(e % i), e >= 60 && (e = (e - r[0]) / i, r.unshift(e))), n + r.map((o) => String(o).padStart(2, "0")).join(":").replace(/000000\d*$/, "");
|
|
1941
1965
|
}
|
|
1942
|
-
const
|
|
1966
|
+
const ps = {
|
|
1943
1967
|
identify: (s) => typeof s == "bigint" || Number.isInteger(s),
|
|
1944
1968
|
default: !0,
|
|
1945
1969
|
tag: "tag:yaml.org,2002:int",
|
|
1946
1970
|
format: "TIME",
|
|
1947
1971
|
test: /^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,
|
|
1948
|
-
resolve: (s, e, { intAsBigInt: t }) =>
|
|
1949
|
-
stringify:
|
|
1950
|
-
},
|
|
1972
|
+
resolve: (s, e, { intAsBigInt: t }) => Ot(s, t),
|
|
1973
|
+
stringify: ds
|
|
1974
|
+
}, ms = {
|
|
1951
1975
|
identify: (s) => typeof s == "number",
|
|
1952
1976
|
default: !0,
|
|
1953
1977
|
tag: "tag:yaml.org,2002:float",
|
|
1954
1978
|
format: "TIME",
|
|
1955
1979
|
test: /^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,
|
|
1956
|
-
resolve: (s) =>
|
|
1957
|
-
stringify:
|
|
1958
|
-
},
|
|
1980
|
+
resolve: (s) => Ot(s, !1),
|
|
1981
|
+
stringify: ds
|
|
1982
|
+
}, He = {
|
|
1959
1983
|
identify: (s) => s instanceof Date,
|
|
1960
1984
|
default: !0,
|
|
1961
1985
|
tag: "tag:yaml.org,2002:timestamp",
|
|
@@ -1964,105 +1988,110 @@ const us = {
|
|
|
1964
1988
|
// assumed to be 00:00:00Z (start of day, UTC).
|
|
1965
1989
|
test: RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),
|
|
1966
1990
|
resolve(s) {
|
|
1967
|
-
const e = s.match(
|
|
1991
|
+
const e = s.match(He.test);
|
|
1968
1992
|
if (!e)
|
|
1969
1993
|
throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");
|
|
1970
1994
|
const [, t, n, i, r, o, l] = e.map(Number), a = e[7] ? Number((e[7] + "00").substr(1, 3)) : 0;
|
|
1971
1995
|
let c = Date.UTC(t, n - 1, i, r || 0, o || 0, l || 0, a);
|
|
1972
|
-
const
|
|
1973
|
-
if (
|
|
1974
|
-
let f =
|
|
1996
|
+
const p = e[8];
|
|
1997
|
+
if (p && p !== "Z") {
|
|
1998
|
+
let f = Ot(p, !1);
|
|
1975
1999
|
Math.abs(f) < 30 && (f *= 60), c -= 6e4 * f;
|
|
1976
2000
|
}
|
|
1977
2001
|
return new Date(c);
|
|
1978
2002
|
},
|
|
1979
|
-
stringify: ({ value: s }) => s.toISOString().replace(/(
|
|
1980
|
-
},
|
|
1981
|
-
pe,
|
|
2003
|
+
stringify: ({ value: s }) => s.toISOString().replace(/(T00:00:00)?\.000Z$/, "")
|
|
2004
|
+
}, Ct = [
|
|
1982
2005
|
me,
|
|
1983
|
-
|
|
2006
|
+
ye,
|
|
1984
2007
|
Ye,
|
|
1985
|
-
|
|
1986
|
-
|
|
2008
|
+
Ge,
|
|
2009
|
+
us,
|
|
2010
|
+
hs,
|
|
2011
|
+
tn,
|
|
2012
|
+
sn,
|
|
2013
|
+
nn,
|
|
2014
|
+
rn,
|
|
1987
2015
|
Zs,
|
|
1988
2016
|
xs,
|
|
1989
2017
|
en,
|
|
1990
|
-
tn,
|
|
1991
|
-
Hs,
|
|
1992
|
-
Xs,
|
|
1993
|
-
zs,
|
|
1994
|
-
yt,
|
|
1995
2018
|
bt,
|
|
1996
|
-
|
|
2019
|
+
V,
|
|
1997
2020
|
St,
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
["
|
|
2005
|
-
["
|
|
2006
|
-
["
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
"tag:yaml.org,2002:
|
|
2030
|
-
"tag:yaml.org,2002:
|
|
2021
|
+
wt,
|
|
2022
|
+
Nt,
|
|
2023
|
+
ps,
|
|
2024
|
+
ms,
|
|
2025
|
+
He
|
|
2026
|
+
], vt = /* @__PURE__ */ new Map([
|
|
2027
|
+
["core", Ws],
|
|
2028
|
+
["failsafe", [me, ye, Ye]],
|
|
2029
|
+
["json", zs],
|
|
2030
|
+
["yaml11", Ct],
|
|
2031
|
+
["yaml-1.1", Ct]
|
|
2032
|
+
]), Bt = {
|
|
2033
|
+
binary: bt,
|
|
2034
|
+
bool: yt,
|
|
2035
|
+
float: ns,
|
|
2036
|
+
floatExp: ss,
|
|
2037
|
+
floatNaN: ts,
|
|
2038
|
+
floatTime: ms,
|
|
2039
|
+
int: os,
|
|
2040
|
+
intHex: ls,
|
|
2041
|
+
intOct: rs,
|
|
2042
|
+
intTime: ps,
|
|
2043
|
+
map: me,
|
|
2044
|
+
merge: V,
|
|
2045
|
+
null: Ge,
|
|
2046
|
+
omap: St,
|
|
2047
|
+
pairs: wt,
|
|
2048
|
+
seq: ye,
|
|
2049
|
+
set: Nt,
|
|
2050
|
+
timestamp: He
|
|
2051
|
+
}, on = {
|
|
2052
|
+
"tag:yaml.org,2002:binary": bt,
|
|
2053
|
+
"tag:yaml.org,2002:merge": V,
|
|
2054
|
+
"tag:yaml.org,2002:omap": St,
|
|
2055
|
+
"tag:yaml.org,2002:pairs": wt,
|
|
2056
|
+
"tag:yaml.org,2002:set": Nt,
|
|
2057
|
+
"tag:yaml.org,2002:timestamp": He
|
|
2031
2058
|
};
|
|
2032
|
-
function
|
|
2033
|
-
|
|
2034
|
-
if (!
|
|
2059
|
+
function tt(s, e, t) {
|
|
2060
|
+
const n = vt.get(e);
|
|
2061
|
+
if (n && !s)
|
|
2062
|
+
return t && !n.includes(V) ? n.concat(V) : n.slice();
|
|
2063
|
+
let i = n;
|
|
2064
|
+
if (!i)
|
|
2035
2065
|
if (Array.isArray(s))
|
|
2036
|
-
|
|
2066
|
+
i = [];
|
|
2037
2067
|
else {
|
|
2038
|
-
const
|
|
2039
|
-
throw new Error(`Unknown schema "${e}"; use one of ${
|
|
2068
|
+
const r = Array.from(vt.keys()).filter((o) => o !== "yaml11").map((o) => JSON.stringify(o)).join(", ");
|
|
2069
|
+
throw new Error(`Unknown schema "${e}"; use one of ${r} or define customTags array`);
|
|
2040
2070
|
}
|
|
2041
2071
|
if (Array.isArray(s))
|
|
2042
|
-
for (const
|
|
2043
|
-
|
|
2044
|
-
else typeof s == "function" && (
|
|
2045
|
-
return t.
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
});
|
|
2072
|
+
for (const r of s)
|
|
2073
|
+
i = i.concat(r);
|
|
2074
|
+
else typeof s == "function" && (i = s(i.slice()));
|
|
2075
|
+
return t && (i = i.concat(V)), i.reduce((r, o) => {
|
|
2076
|
+
const l = typeof o == "string" ? Bt[o] : o;
|
|
2077
|
+
if (!l) {
|
|
2078
|
+
const a = JSON.stringify(o), c = Object.keys(Bt).map((p) => JSON.stringify(p)).join(", ");
|
|
2079
|
+
throw new Error(`Unknown custom tag ${a}; use one of ${c}`);
|
|
2080
|
+
}
|
|
2081
|
+
return r.includes(l) || r.push(l), r;
|
|
2082
|
+
}, []);
|
|
2054
2083
|
}
|
|
2055
|
-
const
|
|
2056
|
-
class
|
|
2084
|
+
const ln = (s, e) => s.key < e.key ? -1 : s.key > e.key ? 1 : 0;
|
|
2085
|
+
class Xe {
|
|
2057
2086
|
constructor({ compat: e, customTags: t, merge: n, resolveKnownTags: i, schema: r, sortMapEntries: o, toStringDefaults: l }) {
|
|
2058
|
-
this.compat = Array.isArray(e) ?
|
|
2087
|
+
this.compat = Array.isArray(e) ? tt(e, "compat") : e ? tt(null, e) : null, this.name = typeof r == "string" && r || "core", this.knownTags = i ? on : {}, this.tags = tt(t, this.name, n), this.toStringOptions = l ?? null, Object.defineProperty(this, Y, { value: me }), Object.defineProperty(this, R, { value: Ye }), Object.defineProperty(this, he, { value: ye }), this.sortMapEntries = typeof o == "function" ? o : o === !0 ? ln : null;
|
|
2059
2088
|
}
|
|
2060
2089
|
clone() {
|
|
2061
|
-
const e = Object.create(
|
|
2090
|
+
const e = Object.create(Xe.prototype, Object.getOwnPropertyDescriptors(this));
|
|
2062
2091
|
return e.tags = this.tags.slice(), e;
|
|
2063
2092
|
}
|
|
2064
2093
|
}
|
|
2065
|
-
function
|
|
2094
|
+
function an(s, e) {
|
|
2066
2095
|
var a;
|
|
2067
2096
|
const t = [];
|
|
2068
2097
|
let n = e.directives === !0;
|
|
@@ -2071,44 +2100,44 @@ function rn(s, e) {
|
|
|
2071
2100
|
c ? (t.push(c), n = !0) : s.directives.docStart && (n = !0);
|
|
2072
2101
|
}
|
|
2073
2102
|
n && t.push("---");
|
|
2074
|
-
const i =
|
|
2103
|
+
const i = Xt(s, e), { commentString: r } = i.options;
|
|
2075
2104
|
if (s.commentBefore) {
|
|
2076
2105
|
t.length !== 1 && t.unshift("");
|
|
2077
2106
|
const c = r(s.commentBefore);
|
|
2078
|
-
t.unshift(
|
|
2107
|
+
t.unshift(U(c, ""));
|
|
2079
2108
|
}
|
|
2080
2109
|
let o = !1, l = null;
|
|
2081
2110
|
if (s.contents) {
|
|
2082
2111
|
if ($(s.contents)) {
|
|
2083
2112
|
if (s.contents.spaceBefore && n && t.push(""), s.contents.commentBefore) {
|
|
2084
2113
|
const f = r(s.contents.commentBefore);
|
|
2085
|
-
t.push(
|
|
2114
|
+
t.push(U(f, ""));
|
|
2086
2115
|
}
|
|
2087
2116
|
i.forceBlockIndent = !!s.comment, l = s.contents.comment;
|
|
2088
2117
|
}
|
|
2089
2118
|
const c = l ? void 0 : () => o = !0;
|
|
2090
|
-
let
|
|
2091
|
-
l && (
|
|
2119
|
+
let p = fe(s.contents, i, () => l = null, c);
|
|
2120
|
+
l && (p += H(p, "", r(l))), (p[0] === "|" || p[0] === ">") && t[t.length - 1] === "---" ? t[t.length - 1] = `--- ${p}` : t.push(p);
|
|
2092
2121
|
} else
|
|
2093
|
-
t.push(
|
|
2122
|
+
t.push(fe(s.contents, i));
|
|
2094
2123
|
if ((a = s.directives) != null && a.docEnd)
|
|
2095
2124
|
if (s.comment) {
|
|
2096
2125
|
const c = r(s.comment);
|
|
2097
2126
|
c.includes(`
|
|
2098
|
-
`) ? (t.push("..."), t.push(
|
|
2127
|
+
`) ? (t.push("..."), t.push(U(c, ""))) : t.push(`... ${c}`);
|
|
2099
2128
|
} else
|
|
2100
2129
|
t.push("...");
|
|
2101
2130
|
else {
|
|
2102
2131
|
let c = s.comment;
|
|
2103
|
-
c && o && (c = c.replace(/^\n+/, "")), c && ((!o || l) && t[t.length - 1] !== "" && t.push(""), t.push(
|
|
2132
|
+
c && o && (c = c.replace(/^\n+/, "")), c && ((!o || l) && t[t.length - 1] !== "" && t.push(""), t.push(U(r(c), "")));
|
|
2104
2133
|
}
|
|
2105
2134
|
return t.join(`
|
|
2106
2135
|
`) + `
|
|
2107
2136
|
`;
|
|
2108
2137
|
}
|
|
2109
|
-
class
|
|
2138
|
+
class ge {
|
|
2110
2139
|
constructor(e, t, n) {
|
|
2111
|
-
this.commentBefore = null, this.comment = null, this.errors = [], this.warnings = [], Object.defineProperty(this, j, { value:
|
|
2140
|
+
this.commentBefore = null, this.comment = null, this.errors = [], this.warnings = [], Object.defineProperty(this, j, { value: lt });
|
|
2112
2141
|
let i = null;
|
|
2113
2142
|
typeof t == "function" || Array.isArray(t) ? i = t : n === void 0 && t && (n = t, t = void 0);
|
|
2114
2143
|
const r = Object.assign({
|
|
@@ -2117,6 +2146,7 @@ class ye {
|
|
|
2117
2146
|
logLevel: "warn",
|
|
2118
2147
|
prettyErrors: !0,
|
|
2119
2148
|
strict: !0,
|
|
2149
|
+
stringKeys: !1,
|
|
2120
2150
|
uniqueKeys: !0,
|
|
2121
2151
|
version: "1.2"
|
|
2122
2152
|
}, n);
|
|
@@ -2130,18 +2160,18 @@ class ye {
|
|
|
2130
2160
|
* Custom Node values that inherit from `Object` still refer to their original instances.
|
|
2131
2161
|
*/
|
|
2132
2162
|
clone() {
|
|
2133
|
-
const e = Object.create(
|
|
2134
|
-
[j]: { value:
|
|
2163
|
+
const e = Object.create(ge.prototype, {
|
|
2164
|
+
[j]: { value: lt }
|
|
2135
2165
|
});
|
|
2136
2166
|
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;
|
|
2137
2167
|
}
|
|
2138
2168
|
/** Adds a value to the document. */
|
|
2139
2169
|
add(e) {
|
|
2140
|
-
|
|
2170
|
+
se(this.contents) && this.contents.add(e);
|
|
2141
2171
|
}
|
|
2142
2172
|
/** Adds a value to the document. */
|
|
2143
2173
|
addIn(e, t) {
|
|
2144
|
-
|
|
2174
|
+
se(this.contents) && this.contents.addIn(e, t);
|
|
2145
2175
|
}
|
|
2146
2176
|
/**
|
|
2147
2177
|
* Create a new `Alias` node, ensuring that the target `node` has the required anchor.
|
|
@@ -2154,21 +2184,21 @@ class ye {
|
|
|
2154
2184
|
*/
|
|
2155
2185
|
createAlias(e, t) {
|
|
2156
2186
|
if (!e.anchor) {
|
|
2157
|
-
const n =
|
|
2187
|
+
const n = Yt(this);
|
|
2158
2188
|
e.anchor = // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
|
|
2159
|
-
!t || n.has(t) ?
|
|
2189
|
+
!t || n.has(t) ? Gt(t || "a", n) : t;
|
|
2160
2190
|
}
|
|
2161
|
-
return new
|
|
2191
|
+
return new Re(e.anchor);
|
|
2162
2192
|
}
|
|
2163
2193
|
createNode(e, t, n) {
|
|
2164
2194
|
let i;
|
|
2165
2195
|
if (typeof t == "function")
|
|
2166
2196
|
e = t.call({ "": e }, "", e), i = t;
|
|
2167
2197
|
else if (Array.isArray(t)) {
|
|
2168
|
-
const
|
|
2169
|
-
|
|
2198
|
+
const m = (w) => typeof w == "number" || w instanceof String || w instanceof Number, b = t.filter(m).map(String);
|
|
2199
|
+
b.length > 0 && (t = t.concat(b)), i = t;
|
|
2170
2200
|
} else n === void 0 && t && (n = t, t = void 0);
|
|
2171
|
-
const { aliasDuplicateObjects: r, anchorPrefix: o, flow: l, keepUndefined: a, onTagObj: c, tag:
|
|
2201
|
+
const { aliasDuplicateObjects: r, anchorPrefix: o, flow: l, keepUndefined: a, onTagObj: c, tag: p } = n ?? {}, { onAnchor: f, setAnchors: d, sourceObjects: h } = Ks(
|
|
2172
2202
|
this,
|
|
2173
2203
|
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
|
|
2174
2204
|
o || "a"
|
|
@@ -2180,7 +2210,7 @@ class ye {
|
|
|
2180
2210
|
replacer: i,
|
|
2181
2211
|
schema: this.schema,
|
|
2182
2212
|
sourceObjects: h
|
|
2183
|
-
}, u =
|
|
2213
|
+
}, u = ke(e, p, y);
|
|
2184
2214
|
return l && L(u) && (u.flow = !0), d(), u;
|
|
2185
2215
|
}
|
|
2186
2216
|
/**
|
|
@@ -2196,14 +2226,14 @@ class ye {
|
|
|
2196
2226
|
* @returns `true` if the item was found and removed.
|
|
2197
2227
|
*/
|
|
2198
2228
|
delete(e) {
|
|
2199
|
-
return
|
|
2229
|
+
return se(this.contents) ? this.contents.delete(e) : !1;
|
|
2200
2230
|
}
|
|
2201
2231
|
/**
|
|
2202
2232
|
* Removes a value from the document.
|
|
2203
2233
|
* @returns `true` if the item was found and removed.
|
|
2204
2234
|
*/
|
|
2205
2235
|
deleteIn(e) {
|
|
2206
|
-
return
|
|
2236
|
+
return we(e) ? this.contents == null ? !1 : (this.contents = null, !0) : se(this.contents) ? this.contents.deleteIn(e) : !1;
|
|
2207
2237
|
}
|
|
2208
2238
|
/**
|
|
2209
2239
|
* Returns item at `key`, or `undefined` if not found. By default unwraps
|
|
@@ -2219,7 +2249,7 @@ class ye {
|
|
|
2219
2249
|
* `true` (collections are always returned intact).
|
|
2220
2250
|
*/
|
|
2221
2251
|
getIn(e, t) {
|
|
2222
|
-
return
|
|
2252
|
+
return we(e) ? !t && E(this.contents) ? this.contents.value : this.contents : L(this.contents) ? this.contents.getIn(e, t) : void 0;
|
|
2223
2253
|
}
|
|
2224
2254
|
/**
|
|
2225
2255
|
* Checks if the document includes a value with the key `key`.
|
|
@@ -2231,21 +2261,21 @@ class ye {
|
|
|
2231
2261
|
* Checks if the document includes a value at `path`.
|
|
2232
2262
|
*/
|
|
2233
2263
|
hasIn(e) {
|
|
2234
|
-
return
|
|
2264
|
+
return we(e) ? this.contents !== void 0 : L(this.contents) ? this.contents.hasIn(e) : !1;
|
|
2235
2265
|
}
|
|
2236
2266
|
/**
|
|
2237
2267
|
* Sets a value in this document. For `!!set`, `value` needs to be a
|
|
2238
2268
|
* boolean to add/remove the item from the set.
|
|
2239
2269
|
*/
|
|
2240
2270
|
set(e, t) {
|
|
2241
|
-
this.contents == null ? this.contents =
|
|
2271
|
+
this.contents == null ? this.contents = Pe(this.schema, [e], t) : se(this.contents) && this.contents.set(e, t);
|
|
2242
2272
|
}
|
|
2243
2273
|
/**
|
|
2244
2274
|
* Sets a value in this document. For `!!set`, `value` needs to be a
|
|
2245
2275
|
* boolean to add/remove the item from the set.
|
|
2246
2276
|
*/
|
|
2247
2277
|
setIn(e, t) {
|
|
2248
|
-
|
|
2278
|
+
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);
|
|
2249
2279
|
}
|
|
2250
2280
|
/**
|
|
2251
2281
|
* Change the YAML version and schema used by the document.
|
|
@@ -2259,11 +2289,11 @@ class ye {
|
|
|
2259
2289
|
let n;
|
|
2260
2290
|
switch (e) {
|
|
2261
2291
|
case "1.1":
|
|
2262
|
-
this.directives ? this.directives.yaml.version = "1.1" : this.directives = new B({ version: "1.1" }), n = {
|
|
2292
|
+
this.directives ? this.directives.yaml.version = "1.1" : this.directives = new B({ version: "1.1" }), n = { resolveKnownTags: !1, schema: "yaml-1.1" };
|
|
2263
2293
|
break;
|
|
2264
2294
|
case "1.2":
|
|
2265
2295
|
case "next":
|
|
2266
|
-
this.directives ? this.directives.yaml.version = e : this.directives = new B({ version: e }), n = {
|
|
2296
|
+
this.directives ? this.directives.yaml.version = e : this.directives = new B({ version: e }), n = { resolveKnownTags: !0, schema: "core" };
|
|
2267
2297
|
break;
|
|
2268
2298
|
case null:
|
|
2269
2299
|
this.directives && delete this.directives, n = null;
|
|
@@ -2276,7 +2306,7 @@ class ye {
|
|
|
2276
2306
|
if (t.schema instanceof Object)
|
|
2277
2307
|
this.schema = t.schema;
|
|
2278
2308
|
else if (n)
|
|
2279
|
-
this.schema = new
|
|
2309
|
+
this.schema = new Xe(Object.assign(n, t));
|
|
2280
2310
|
else
|
|
2281
2311
|
throw new Error("With a null YAML version, the { schema: Schema } option is required");
|
|
2282
2312
|
}
|
|
@@ -2289,11 +2319,11 @@ class ye {
|
|
|
2289
2319
|
mapAsMap: n === !0,
|
|
2290
2320
|
mapKeyWarned: !1,
|
|
2291
2321
|
maxAliasCount: typeof i == "number" ? i : 100
|
|
2292
|
-
}, a =
|
|
2322
|
+
}, a = P(this.contents, t ?? "", l);
|
|
2293
2323
|
if (typeof r == "function")
|
|
2294
|
-
for (const { count: c, res:
|
|
2295
|
-
r(
|
|
2296
|
-
return typeof o == "function" ?
|
|
2324
|
+
for (const { count: c, res: p } of l.anchors.values())
|
|
2325
|
+
r(p, c);
|
|
2326
|
+
return typeof o == "function" ? oe(o, { "": a }, "", a) : a;
|
|
2297
2327
|
}
|
|
2298
2328
|
/**
|
|
2299
2329
|
* A JSON representation of the document `contents`.
|
|
@@ -2312,25 +2342,25 @@ class ye {
|
|
|
2312
2342
|
const t = JSON.stringify(e.indent);
|
|
2313
2343
|
throw new Error(`"indent" option must be a positive integer, not ${t}`);
|
|
2314
2344
|
}
|
|
2315
|
-
return
|
|
2345
|
+
return an(this, e);
|
|
2316
2346
|
}
|
|
2317
2347
|
}
|
|
2318
|
-
function
|
|
2348
|
+
function se(s) {
|
|
2319
2349
|
if (L(s))
|
|
2320
2350
|
return !0;
|
|
2321
2351
|
throw new Error("Expected a YAML collection as document contents");
|
|
2322
2352
|
}
|
|
2323
|
-
class
|
|
2353
|
+
class At extends Error {
|
|
2324
2354
|
constructor(e, t, n, i) {
|
|
2325
2355
|
super(), this.name = e, this.code = n, this.message = i, this.pos = t;
|
|
2326
2356
|
}
|
|
2327
2357
|
}
|
|
2328
|
-
class
|
|
2358
|
+
class z extends At {
|
|
2329
2359
|
constructor(e, t, n) {
|
|
2330
2360
|
super("YAMLParseError", e, t, n);
|
|
2331
2361
|
}
|
|
2332
2362
|
}
|
|
2333
|
-
class
|
|
2363
|
+
class ys extends At {
|
|
2334
2364
|
constructor(e, t, n) {
|
|
2335
2365
|
super("YAMLWarning", e, t, n);
|
|
2336
2366
|
}
|
|
@@ -2363,55 +2393,56 @@ ${c}
|
|
|
2363
2393
|
`;
|
|
2364
2394
|
}
|
|
2365
2395
|
};
|
|
2366
|
-
function
|
|
2367
|
-
let a = !1, c = l,
|
|
2368
|
-
for (const
|
|
2369
|
-
switch (y && (
|
|
2396
|
+
function ue(s, { flow: e, indicator: t, next: n, offset: i, onError: r, parentIndent: o, startOnNewline: l }) {
|
|
2397
|
+
let a = !1, c = l, p = l, f = "", d = "", h = !1, y = !1, u = null, m = null, b = null, w = null, N = null, S = null, k = null;
|
|
2398
|
+
for (const g of s)
|
|
2399
|
+
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) {
|
|
2370
2400
|
case "space":
|
|
2371
|
-
!e && (t !== "doc-start" || (n == null ? void 0 : n.type) !== "flow-collection") &&
|
|
2401
|
+
!e && (t !== "doc-start" || (n == null ? void 0 : n.type) !== "flow-collection") && g.source.includes(" ") && (u = g), p = !0;
|
|
2372
2402
|
break;
|
|
2373
2403
|
case "comment": {
|
|
2374
|
-
|
|
2375
|
-
const _ =
|
|
2404
|
+
p || r(g, "MISSING_CHAR", "Comments must be separated from other tokens by white space characters");
|
|
2405
|
+
const _ = g.source.substring(1) || " ";
|
|
2376
2406
|
f ? f += d + _ : f = _, d = "", c = !1;
|
|
2377
2407
|
break;
|
|
2378
2408
|
}
|
|
2379
2409
|
case "newline":
|
|
2380
|
-
c ? f ? f +=
|
|
2410
|
+
c ? f ? f += g.source : a = !0 : d += g.source, c = !0, h = !0, (m || b) && (w = g), p = !0;
|
|
2381
2411
|
break;
|
|
2382
2412
|
case "anchor":
|
|
2383
|
-
|
|
2413
|
+
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;
|
|
2384
2414
|
break;
|
|
2385
2415
|
case "tag": {
|
|
2386
|
-
|
|
2416
|
+
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;
|
|
2387
2417
|
break;
|
|
2388
2418
|
}
|
|
2389
2419
|
case t:
|
|
2390
|
-
(
|
|
2420
|
+
(m || b) && r(g, "BAD_PROP_ORDER", `Anchors and tags must be after the ${g.source} indicator`), S && r(g, "UNEXPECTED_TOKEN", `Unexpected ${g.source} in ${e ?? "collection"}`), S = g, c = t === "seq-item-ind" || t === "explicit-key-ind", p = !1;
|
|
2391
2421
|
break;
|
|
2392
2422
|
case "comma":
|
|
2393
2423
|
if (e) {
|
|
2394
|
-
N && r(
|
|
2424
|
+
N && r(g, "UNEXPECTED_TOKEN", `Unexpected , in ${e}`), N = g, c = !1, p = !1;
|
|
2395
2425
|
break;
|
|
2396
2426
|
}
|
|
2427
|
+
// else fallthrough
|
|
2397
2428
|
default:
|
|
2398
|
-
r(
|
|
2429
|
+
r(g, "UNEXPECTED_TOKEN", `Unexpected ${g.type} token`), c = !1, p = !1;
|
|
2399
2430
|
}
|
|
2400
|
-
const
|
|
2431
|
+
const O = s[s.length - 1], I = O ? O.offset + O.source.length : i;
|
|
2401
2432
|
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"), {
|
|
2402
2433
|
comma: N,
|
|
2403
2434
|
found: S,
|
|
2404
2435
|
spaceBefore: a,
|
|
2405
2436
|
comment: f,
|
|
2406
2437
|
hasNewline: h,
|
|
2407
|
-
anchor:
|
|
2408
|
-
tag:
|
|
2438
|
+
anchor: m,
|
|
2439
|
+
tag: b,
|
|
2409
2440
|
newlineAfterProp: w,
|
|
2410
|
-
end:
|
|
2411
|
-
start:
|
|
2441
|
+
end: I,
|
|
2442
|
+
start: k ?? I
|
|
2412
2443
|
};
|
|
2413
2444
|
}
|
|
2414
|
-
function
|
|
2445
|
+
function Ne(s) {
|
|
2415
2446
|
if (!s)
|
|
2416
2447
|
return null;
|
|
2417
2448
|
switch (s.type) {
|
|
@@ -2438,7 +2469,7 @@ function ke(s) {
|
|
|
2438
2469
|
if (t.type === "newline")
|
|
2439
2470
|
return !0;
|
|
2440
2471
|
}
|
|
2441
|
-
if (
|
|
2472
|
+
if (Ne(e.key) || Ne(e.value))
|
|
2442
2473
|
return !0;
|
|
2443
2474
|
}
|
|
2444
2475
|
return !1;
|
|
@@ -2446,45 +2477,46 @@ function ke(s) {
|
|
|
2446
2477
|
return !0;
|
|
2447
2478
|
}
|
|
2448
2479
|
}
|
|
2449
|
-
function
|
|
2480
|
+
function ut(s, e, t) {
|
|
2450
2481
|
if ((e == null ? void 0 : e.type) === "flow-collection") {
|
|
2451
2482
|
const n = e.end[0];
|
|
2452
|
-
n.indent === s && (n.source === "]" || n.source === "}") &&
|
|
2483
|
+
n.indent === s && (n.source === "]" || n.source === "}") && Ne(e) && t(n, "BAD_INDENT", "Flow end indicator should be more indented than parent", !0);
|
|
2453
2484
|
}
|
|
2454
2485
|
}
|
|
2455
|
-
function
|
|
2486
|
+
function gs(s, e, t) {
|
|
2456
2487
|
const { uniqueKeys: n } = s.options;
|
|
2457
2488
|
if (n === !1)
|
|
2458
2489
|
return !1;
|
|
2459
|
-
const i = typeof n == "function" ? n : (r, o) => r === o || E(r) && E(o) && r.value === o.value
|
|
2490
|
+
const i = typeof n == "function" ? n : (r, o) => r === o || E(r) && E(o) && r.value === o.value;
|
|
2460
2491
|
return e.some((r) => i(r.key, t));
|
|
2461
2492
|
}
|
|
2462
|
-
const
|
|
2463
|
-
function
|
|
2464
|
-
var
|
|
2465
|
-
const o = (r == null ? void 0 : r.nodeClass) ??
|
|
2493
|
+
const Mt = "All mapping items must start at the same column";
|
|
2494
|
+
function cn({ composeNode: s, composeEmptyNode: e }, t, n, i, r) {
|
|
2495
|
+
var p;
|
|
2496
|
+
const o = (r == null ? void 0 : r.nodeClass) ?? K, l = new o(t.schema);
|
|
2466
2497
|
t.atRoot && (t.atRoot = !1);
|
|
2467
2498
|
let a = n.offset, c = null;
|
|
2468
2499
|
for (const f of n.items) {
|
|
2469
|
-
const { start: d, key: h, sep: y, value: u } = f,
|
|
2500
|
+
const { start: d, key: h, sep: y, value: u } = f, m = ue(d, {
|
|
2470
2501
|
indicator: "explicit-key-ind",
|
|
2471
2502
|
next: h ?? (y == null ? void 0 : y[0]),
|
|
2472
2503
|
offset: a,
|
|
2473
2504
|
onError: i,
|
|
2474
2505
|
parentIndent: n.indent,
|
|
2475
2506
|
startOnNewline: !0
|
|
2476
|
-
}),
|
|
2477
|
-
if (
|
|
2478
|
-
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",
|
|
2479
|
-
c =
|
|
2480
|
-
` +
|
|
2507
|
+
}), b = !m.found;
|
|
2508
|
+
if (b) {
|
|
2509
|
+
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) {
|
|
2510
|
+
c = m.end, m.comment && (l.comment ? l.comment += `
|
|
2511
|
+
` + m.comment : l.comment = m.comment);
|
|
2481
2512
|
continue;
|
|
2482
2513
|
}
|
|
2483
|
-
(
|
|
2484
|
-
} else ((
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
|
|
2514
|
+
(m.newlineAfterProp || Ne(h)) && i(h ?? d[d.length - 1], "MULTILINE_IMPLICIT_KEY", "Implicit keys need to be on a single line");
|
|
2515
|
+
} else ((p = m.found) == null ? void 0 : p.indent) !== n.indent && i(a, "BAD_INDENT", Mt);
|
|
2516
|
+
t.atKey = !0;
|
|
2517
|
+
const w = m.end, N = h ? s(t, h, m, i) : e(t, w, d, null, m, i);
|
|
2518
|
+
t.schema.compat && ut(n.indent, h, i), t.atKey = !1, gs(t, l.items, N) && i(w, "DUPLICATE_KEY", "Map keys must be unique");
|
|
2519
|
+
const S = ue(y ?? [], {
|
|
2488
2520
|
indicator: "map-value-ind",
|
|
2489
2521
|
next: u,
|
|
2490
2522
|
offset: N.range[2],
|
|
@@ -2493,26 +2525,26 @@ function on({ composeNode: s, composeEmptyNode: e }, t, n, i, r) {
|
|
|
2493
2525
|
startOnNewline: !h || h.type === "block-scalar"
|
|
2494
2526
|
});
|
|
2495
2527
|
if (a = S.end, S.found) {
|
|
2496
|
-
|
|
2497
|
-
const
|
|
2498
|
-
t.schema.compat &&
|
|
2499
|
-
const
|
|
2500
|
-
t.options.keepSourceTokens && (
|
|
2528
|
+
b && ((u == null ? void 0 : u.type) === "block-map" && !S.hasNewline && i(a, "BLOCK_AS_IMPLICIT_KEY", "Nested mappings are not allowed in compact mappings"), t.options.strict && m.start < S.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"));
|
|
2529
|
+
const k = u ? s(t, u, S, i) : e(t, a, y, null, S, i);
|
|
2530
|
+
t.schema.compat && ut(n.indent, u, i), a = k.range[2];
|
|
2531
|
+
const O = new v(N, k);
|
|
2532
|
+
t.options.keepSourceTokens && (O.srcToken = f), l.items.push(O);
|
|
2501
2533
|
} else {
|
|
2502
|
-
|
|
2534
|
+
b && i(N.range, "MISSING_CHAR", "Implicit map keys need to be followed by map values"), S.comment && (N.comment ? N.comment += `
|
|
2503
2535
|
` + S.comment : N.comment = S.comment);
|
|
2504
|
-
const
|
|
2505
|
-
t.options.keepSourceTokens && (
|
|
2536
|
+
const k = new v(N);
|
|
2537
|
+
t.options.keepSourceTokens && (k.srcToken = f), l.items.push(k);
|
|
2506
2538
|
}
|
|
2507
2539
|
}
|
|
2508
2540
|
return c && c < a && i(c, "IMPOSSIBLE", "Map comment with trailing content"), l.range = [n.offset, a, c ?? a], l;
|
|
2509
2541
|
}
|
|
2510
|
-
function
|
|
2511
|
-
const o = (r == null ? void 0 : r.nodeClass) ??
|
|
2512
|
-
t.atRoot && (t.atRoot = !1);
|
|
2542
|
+
function fn({ composeNode: s, composeEmptyNode: e }, t, n, i, r) {
|
|
2543
|
+
const o = (r == null ? void 0 : r.nodeClass) ?? Q, l = new o(t.schema);
|
|
2544
|
+
t.atRoot && (t.atRoot = !1), t.atKey && (t.atKey = !1);
|
|
2513
2545
|
let a = n.offset, c = null;
|
|
2514
|
-
for (const { start:
|
|
2515
|
-
const d =
|
|
2546
|
+
for (const { start: p, value: f } of n.items) {
|
|
2547
|
+
const d = ue(p, {
|
|
2516
2548
|
indicator: "seq-item-ind",
|
|
2517
2549
|
next: f,
|
|
2518
2550
|
offset: a,
|
|
@@ -2527,12 +2559,12 @@ function ln({ composeNode: s, composeEmptyNode: e }, t, n, i, r) {
|
|
|
2527
2559
|
c = d.end, d.comment && (l.comment = d.comment);
|
|
2528
2560
|
continue;
|
|
2529
2561
|
}
|
|
2530
|
-
const h = f ? s(t, f, d, i) : e(t, d.end,
|
|
2531
|
-
t.schema.compat &&
|
|
2562
|
+
const h = f ? s(t, f, d, i) : e(t, d.end, p, null, d, i);
|
|
2563
|
+
t.schema.compat && ut(n.indent, f, i), a = h.range[2], l.items.push(h);
|
|
2532
2564
|
}
|
|
2533
2565
|
return l.range = [n.offset, a, c ?? a], l;
|
|
2534
2566
|
}
|
|
2535
|
-
function
|
|
2567
|
+
function Ie(s, e, t, n) {
|
|
2536
2568
|
let i = "";
|
|
2537
2569
|
if (s) {
|
|
2538
2570
|
let r = !1, o = "";
|
|
@@ -2544,8 +2576,8 @@ function Ee(s, e, t, n) {
|
|
|
2544
2576
|
break;
|
|
2545
2577
|
case "comment": {
|
|
2546
2578
|
t && !r && n(l, "MISSING_CHAR", "Comments must be separated from other tokens by white space characters");
|
|
2547
|
-
const
|
|
2548
|
-
i ? i += o +
|
|
2579
|
+
const p = a.substring(1) || " ";
|
|
2580
|
+
i ? i += o + p : i = p, o = "";
|
|
2549
2581
|
break;
|
|
2550
2582
|
}
|
|
2551
2583
|
case "newline":
|
|
@@ -2559,15 +2591,15 @@ function Ee(s, e, t, n) {
|
|
|
2559
2591
|
}
|
|
2560
2592
|
return { comment: i, offset: e };
|
|
2561
2593
|
}
|
|
2562
|
-
const
|
|
2563
|
-
function
|
|
2564
|
-
const o = n.start.source === "{", l = o ? "flow map" : "flow sequence", a = (r == null ? void 0 : r.nodeClass) ?? (o ?
|
|
2594
|
+
const st = "Block collections are not allowed within flow collections", nt = (s) => s && (s.type === "block-map" || s.type === "block-seq");
|
|
2595
|
+
function un({ composeNode: s, composeEmptyNode: e }, t, n, i, r) {
|
|
2596
|
+
const o = n.start.source === "{", l = o ? "flow map" : "flow sequence", a = (r == null ? void 0 : r.nodeClass) ?? (o ? K : Q), c = new a(t.schema);
|
|
2565
2597
|
c.flow = !0;
|
|
2566
|
-
const
|
|
2567
|
-
|
|
2598
|
+
const p = t.atRoot;
|
|
2599
|
+
p && (t.atRoot = !1), t.atKey && (t.atKey = !1);
|
|
2568
2600
|
let f = n.offset + n.start.source.length;
|
|
2569
|
-
for (let
|
|
2570
|
-
const
|
|
2601
|
+
for (let m = 0; m < n.items.length; ++m) {
|
|
2602
|
+
const b = n.items[m], { start: w, key: N, sep: S, value: k } = b, O = ue(w, {
|
|
2571
2603
|
flow: l,
|
|
2572
2604
|
indicator: "explicit-key-ind",
|
|
2573
2605
|
next: N ?? (S == null ? void 0 : S[0]),
|
|
@@ -2576,57 +2608,58 @@ function an({ composeNode: s, composeEmptyNode: e }, t, n, i, r) {
|
|
|
2576
2608
|
parentIndent: n.indent,
|
|
2577
2609
|
startOnNewline: !1
|
|
2578
2610
|
});
|
|
2579
|
-
if (!
|
|
2580
|
-
if (!
|
|
2581
|
-
|
|
2582
|
-
` +
|
|
2611
|
+
if (!O.found) {
|
|
2612
|
+
if (!O.anchor && !O.tag && !S && !k) {
|
|
2613
|
+
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 += `
|
|
2614
|
+
` + O.comment : c.comment = O.comment), f = O.end;
|
|
2583
2615
|
continue;
|
|
2584
2616
|
}
|
|
2585
|
-
!o && t.options.strict &&
|
|
2617
|
+
!o && t.options.strict && Ne(N) && i(
|
|
2586
2618
|
N,
|
|
2587
2619
|
// checked by containsNewline()
|
|
2588
2620
|
"MULTILINE_IMPLICIT_KEY",
|
|
2589
2621
|
"Implicit keys of flow sequence pairs need to be on a single line"
|
|
2590
2622
|
);
|
|
2591
2623
|
}
|
|
2592
|
-
if (
|
|
2593
|
-
|
|
2594
|
-
else if (
|
|
2595
|
-
let
|
|
2596
|
-
e: for (const
|
|
2597
|
-
switch (
|
|
2624
|
+
if (m === 0)
|
|
2625
|
+
O.comma && i(O.comma, "UNEXPECTED_TOKEN", `Unexpected , in ${l}`);
|
|
2626
|
+
else if (O.comma || i(O.start, "MISSING_CHAR", `Missing , between ${l} items`), O.comment) {
|
|
2627
|
+
let I = "";
|
|
2628
|
+
e: for (const g of w)
|
|
2629
|
+
switch (g.type) {
|
|
2598
2630
|
case "comma":
|
|
2599
2631
|
case "space":
|
|
2600
2632
|
break;
|
|
2601
2633
|
case "comment":
|
|
2602
|
-
|
|
2634
|
+
I = g.source.substring(1);
|
|
2603
2635
|
break e;
|
|
2604
2636
|
default:
|
|
2605
2637
|
break e;
|
|
2606
2638
|
}
|
|
2607
|
-
if (
|
|
2608
|
-
let
|
|
2609
|
-
|
|
2610
|
-
` +
|
|
2639
|
+
if (I) {
|
|
2640
|
+
let g = c.items[c.items.length - 1];
|
|
2641
|
+
T(g) && (g = g.value ?? g.key), g.comment ? g.comment += `
|
|
2642
|
+
` + I : g.comment = I, O.comment = O.comment.substring(I.length + 1);
|
|
2611
2643
|
}
|
|
2612
2644
|
}
|
|
2613
|
-
if (!o && !S && !
|
|
2614
|
-
const
|
|
2615
|
-
c.items.push(
|
|
2645
|
+
if (!o && !S && !O.found) {
|
|
2646
|
+
const I = k ? s(t, k, O, i) : e(t, O.end, S, null, O, i);
|
|
2647
|
+
c.items.push(I), f = I.range[2], nt(k) && i(I.range, "BLOCK_IN_FLOW", st);
|
|
2616
2648
|
} else {
|
|
2617
|
-
|
|
2618
|
-
|
|
2619
|
-
|
|
2649
|
+
t.atKey = !0;
|
|
2650
|
+
const I = O.end, g = N ? s(t, N, O, i) : e(t, I, w, null, O, i);
|
|
2651
|
+
nt(N) && i(g.range, "BLOCK_IN_FLOW", st), t.atKey = !1;
|
|
2652
|
+
const _ = ue(S ?? [], {
|
|
2620
2653
|
flow: l,
|
|
2621
2654
|
indicator: "map-value-ind",
|
|
2622
|
-
next:
|
|
2623
|
-
offset:
|
|
2655
|
+
next: k,
|
|
2656
|
+
offset: g.range[2],
|
|
2624
2657
|
onError: i,
|
|
2625
2658
|
parentIndent: n.indent,
|
|
2626
2659
|
startOnNewline: !1
|
|
2627
2660
|
});
|
|
2628
2661
|
if (_.found) {
|
|
2629
|
-
if (!o && !
|
|
2662
|
+
if (!o && !O.found && t.options.strict) {
|
|
2630
2663
|
if (S)
|
|
2631
2664
|
for (const C of S) {
|
|
2632
2665
|
if (C === _.found)
|
|
@@ -2636,21 +2669,23 @@ function an({ composeNode: s, composeEmptyNode: e }, t, n, i, r) {
|
|
|
2636
2669
|
break;
|
|
2637
2670
|
}
|
|
2638
2671
|
}
|
|
2639
|
-
|
|
2672
|
+
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");
|
|
2640
2673
|
}
|
|
2641
|
-
} else
|
|
2642
|
-
const
|
|
2643
|
-
|
|
2644
|
-
` + _.comment :
|
|
2645
|
-
const
|
|
2646
|
-
if (t.options.keepSourceTokens && (
|
|
2674
|
+
} 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`));
|
|
2675
|
+
const J = k ? s(t, k, _, i) : _.found ? e(t, _.end, S, null, _, i) : null;
|
|
2676
|
+
J ? nt(k) && i(J.range, "BLOCK_IN_FLOW", st) : _.comment && (g.comment ? g.comment += `
|
|
2677
|
+
` + _.comment : g.comment = _.comment);
|
|
2678
|
+
const te = new v(g, J);
|
|
2679
|
+
if (t.options.keepSourceTokens && (te.srcToken = b), o) {
|
|
2647
2680
|
const C = c;
|
|
2648
|
-
|
|
2681
|
+
gs(t, C.items, g) && i(I, "DUPLICATE_KEY", "Map keys must be unique"), C.items.push(te);
|
|
2649
2682
|
} else {
|
|
2650
|
-
const C = new
|
|
2651
|
-
C.flow = !0, C.items.push(
|
|
2683
|
+
const C = new K(t.schema);
|
|
2684
|
+
C.flow = !0, C.items.push(te);
|
|
2685
|
+
const Lt = (J ?? g).range;
|
|
2686
|
+
C.range = [g.range[0], Lt[1], Lt[2]], c.items.push(C);
|
|
2652
2687
|
}
|
|
2653
|
-
f =
|
|
2688
|
+
f = J ? J.range[2] : _.end;
|
|
2654
2689
|
}
|
|
2655
2690
|
}
|
|
2656
2691
|
const d = o ? "}" : "]", [h, ...y] = n.end;
|
|
@@ -2658,22 +2693,22 @@ function an({ composeNode: s, composeEmptyNode: e }, t, n, i, r) {
|
|
|
2658
2693
|
if (h && h.source === d)
|
|
2659
2694
|
u = h.offset + h.source.length;
|
|
2660
2695
|
else {
|
|
2661
|
-
const
|
|
2662
|
-
i(f,
|
|
2696
|
+
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}`;
|
|
2697
|
+
i(f, p ? "MISSING_CHAR" : "BAD_INDENT", b), h && h.source.length !== 1 && y.unshift(h);
|
|
2663
2698
|
}
|
|
2664
2699
|
if (y.length > 0) {
|
|
2665
|
-
const
|
|
2666
|
-
|
|
2667
|
-
` +
|
|
2700
|
+
const m = Ie(y, u, t.options.strict, i);
|
|
2701
|
+
m.comment && (c.comment ? c.comment += `
|
|
2702
|
+
` + m.comment : c.comment = m.comment), c.range = [n.offset, u, m.offset];
|
|
2668
2703
|
} else
|
|
2669
2704
|
c.range = [n.offset, u, u];
|
|
2670
2705
|
return c;
|
|
2671
2706
|
}
|
|
2672
|
-
function
|
|
2673
|
-
const o = t.type === "block-map" ?
|
|
2707
|
+
function it(s, e, t, n, i, r) {
|
|
2708
|
+
const o = t.type === "block-map" ? cn(s, e, t, n, r) : t.type === "block-seq" ? fn(s, e, t, n, r) : un(s, e, t, n, r), l = o.constructor;
|
|
2674
2709
|
return i === "!" || i === l.tagName ? (o.tag = l.tagName, o) : (i && (o.tag = i), o);
|
|
2675
2710
|
}
|
|
2676
|
-
function
|
|
2711
|
+
function hn(s, e, t, n, i) {
|
|
2677
2712
|
var d;
|
|
2678
2713
|
const r = n.tag, o = r ? e.directives.tagName(r.source, (h) => i(r, "TAG_RESOLVE_FAILED", h)) : null;
|
|
2679
2714
|
if (t.type === "block-seq") {
|
|
@@ -2681,28 +2716,28 @@ function cn(s, e, t, n, i) {
|
|
|
2681
2716
|
u && (!y || y.offset < u.offset) && i(u, "MISSING_CHAR", "Missing newline after block sequence props");
|
|
2682
2717
|
}
|
|
2683
2718
|
const l = t.type === "block-map" ? "map" : t.type === "block-seq" ? "seq" : t.start.source === "{" ? "map" : "seq";
|
|
2684
|
-
if (!r || !o || o === "!" || o ===
|
|
2685
|
-
return
|
|
2719
|
+
if (!r || !o || o === "!" || o === K.tagName && l === "map" || o === Q.tagName && l === "seq")
|
|
2720
|
+
return it(s, e, t, i, o);
|
|
2686
2721
|
let a = e.schema.tags.find((h) => h.tag === o && h.collection === l);
|
|
2687
2722
|
if (!a) {
|
|
2688
2723
|
const h = e.schema.knownTags[o];
|
|
2689
2724
|
if (h && h.collection === l)
|
|
2690
2725
|
e.schema.tags.push(Object.assign({}, h, { default: !1 })), a = h;
|
|
2691
2726
|
else
|
|
2692
|
-
return h != null && h.collection ? i(r, "BAD_COLLECTION_TYPE", `${h.tag} used for ${l} collection, but expects ${h.collection}`, !0) : i(r, "TAG_RESOLVE_FAILED", `Unresolved tag: ${o}`, !0),
|
|
2727
|
+
return h != null && h.collection ? i(r, "BAD_COLLECTION_TYPE", `${h.tag} used for ${l} collection, but expects ${h.collection}`, !0) : i(r, "TAG_RESOLVE_FAILED", `Unresolved tag: ${o}`, !0), it(s, e, t, i, o);
|
|
2693
2728
|
}
|
|
2694
|
-
const c =
|
|
2729
|
+
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);
|
|
2695
2730
|
return f.range = c.range, f.tag = o, a != null && a.format && (f.format = a.format), f;
|
|
2696
2731
|
}
|
|
2697
|
-
function
|
|
2698
|
-
const n = e.offset, i =
|
|
2732
|
+
function bs(s, e, t) {
|
|
2733
|
+
const n = e.offset, i = dn(e, s.options.strict, t);
|
|
2699
2734
|
if (!i)
|
|
2700
2735
|
return { value: "", type: null, comment: "", range: [n, n, n] };
|
|
2701
|
-
const r = i.mode === ">" ?
|
|
2736
|
+
const r = i.mode === ">" ? A.BLOCK_FOLDED : A.BLOCK_LITERAL, o = e.source ? pn(e.source) : [];
|
|
2702
2737
|
let l = o.length;
|
|
2703
2738
|
for (let u = o.length - 1; u >= 0; --u) {
|
|
2704
|
-
const
|
|
2705
|
-
if (
|
|
2739
|
+
const m = o[u][1];
|
|
2740
|
+
if (m === "" || m === "\r")
|
|
2706
2741
|
l = u;
|
|
2707
2742
|
else
|
|
2708
2743
|
break;
|
|
@@ -2710,44 +2745,44 @@ function ms(s, e, t) {
|
|
|
2710
2745
|
if (l === 0) {
|
|
2711
2746
|
const u = i.chomp === "+" && o.length > 0 ? `
|
|
2712
2747
|
`.repeat(Math.max(1, o.length - 1)) : "";
|
|
2713
|
-
let
|
|
2714
|
-
return e.source && (
|
|
2748
|
+
let m = n + i.length;
|
|
2749
|
+
return e.source && (m += e.source.length), { value: u, type: r, comment: i.comment, range: [n, m, m] };
|
|
2715
2750
|
}
|
|
2716
|
-
let a = e.indent + i.indent, c = e.offset + i.length,
|
|
2751
|
+
let a = e.indent + i.indent, c = e.offset + i.length, p = 0;
|
|
2717
2752
|
for (let u = 0; u < l; ++u) {
|
|
2718
|
-
const [
|
|
2719
|
-
if (
|
|
2720
|
-
i.indent === 0 &&
|
|
2753
|
+
const [m, b] = o[u];
|
|
2754
|
+
if (b === "" || b === "\r")
|
|
2755
|
+
i.indent === 0 && m.length > a && (a = m.length);
|
|
2721
2756
|
else {
|
|
2722
|
-
|
|
2757
|
+
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");
|
|
2723
2758
|
break;
|
|
2724
2759
|
}
|
|
2725
|
-
c +=
|
|
2760
|
+
c += m.length + b.length + 1;
|
|
2726
2761
|
}
|
|
2727
2762
|
for (let u = o.length - 1; u >= l; --u)
|
|
2728
2763
|
o[u][0].length > a && (l = u + 1);
|
|
2729
2764
|
let f = "", d = "", h = !1;
|
|
2730
|
-
for (let u = 0; u <
|
|
2765
|
+
for (let u = 0; u < p; ++u)
|
|
2731
2766
|
f += o[u][0].slice(a) + `
|
|
2732
2767
|
`;
|
|
2733
|
-
for (let u =
|
|
2734
|
-
let [
|
|
2735
|
-
c +=
|
|
2736
|
-
const w =
|
|
2737
|
-
if (w && (
|
|
2768
|
+
for (let u = p; u < l; ++u) {
|
|
2769
|
+
let [m, b] = o[u];
|
|
2770
|
+
c += m.length + b.length + 1;
|
|
2771
|
+
const w = b[b.length - 1] === "\r";
|
|
2772
|
+
if (w && (b = b.slice(0, -1)), b && m.length < a) {
|
|
2738
2773
|
const S = `Block scalar lines must not be less indented than their ${i.indent ? "explicit indentation indicator" : "first line"}`;
|
|
2739
|
-
t(c -
|
|
2774
|
+
t(c - b.length - (w ? 2 : 1), "BAD_INDENT", S), m = "";
|
|
2740
2775
|
}
|
|
2741
|
-
r ===
|
|
2742
|
-
`) :
|
|
2776
|
+
r === A.BLOCK_LITERAL ? (f += d + m.slice(a) + b, d = `
|
|
2777
|
+
`) : m.length > a || b[0] === " " ? (d === " " ? d = `
|
|
2743
2778
|
` : !h && d === `
|
|
2744
2779
|
` && (d = `
|
|
2745
2780
|
|
|
2746
|
-
`), f += d +
|
|
2747
|
-
`, h = !0) :
|
|
2781
|
+
`), f += d + m.slice(a) + b, d = `
|
|
2782
|
+
`, h = !0) : b === "" ? d === `
|
|
2748
2783
|
` ? f += `
|
|
2749
2784
|
` : d = `
|
|
2750
|
-
` : (f += d +
|
|
2785
|
+
` : (f += d + b, d = " ", h = !1);
|
|
2751
2786
|
}
|
|
2752
2787
|
switch (i.chomp) {
|
|
2753
2788
|
case "-":
|
|
@@ -2767,7 +2802,7 @@ function ms(s, e, t) {
|
|
|
2767
2802
|
const y = n + i.length + e.source.length;
|
|
2768
2803
|
return { value: f, type: r, comment: i.comment, range: [n, y, y] };
|
|
2769
2804
|
}
|
|
2770
|
-
function
|
|
2805
|
+
function dn({ offset: s, props: e }, t, n) {
|
|
2771
2806
|
if (e[0].type !== "block-scalar-header")
|
|
2772
2807
|
return n(e[0], "IMPOSSIBLE", "Block scalar header not found"), null;
|
|
2773
2808
|
const { source: i } = e[0], r = i[0];
|
|
@@ -2782,21 +2817,23 @@ function fn({ offset: s, props: e }, t, n) {
|
|
|
2782
2817
|
}
|
|
2783
2818
|
}
|
|
2784
2819
|
a !== -1 && n(a, "UNEXPECTED_TOKEN", `Block scalar header includes extra characters: ${i}`);
|
|
2785
|
-
let c = !1,
|
|
2820
|
+
let c = !1, p = "", f = i.length;
|
|
2786
2821
|
for (let d = 1; d < e.length; ++d) {
|
|
2787
2822
|
const h = e[d];
|
|
2788
2823
|
switch (h.type) {
|
|
2789
2824
|
case "space":
|
|
2790
2825
|
c = !0;
|
|
2826
|
+
// fallthrough
|
|
2791
2827
|
case "newline":
|
|
2792
2828
|
f += h.source.length;
|
|
2793
2829
|
break;
|
|
2794
2830
|
case "comment":
|
|
2795
|
-
t && !c && n(h, "MISSING_CHAR", "Comments must be separated from other tokens by white space characters"), f += h.source.length,
|
|
2831
|
+
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);
|
|
2796
2832
|
break;
|
|
2797
2833
|
case "error":
|
|
2798
2834
|
n(h, "UNEXPECTED_TOKEN", h.message), f += h.source.length;
|
|
2799
2835
|
break;
|
|
2836
|
+
/* istanbul ignore next should not happen */
|
|
2800
2837
|
default: {
|
|
2801
2838
|
const y = `Unexpected token in block scalar header: ${h.type}`;
|
|
2802
2839
|
n(h, "UNEXPECTED_TOKEN", y);
|
|
@@ -2805,28 +2842,29 @@ function fn({ offset: s, props: e }, t, n) {
|
|
|
2805
2842
|
}
|
|
2806
2843
|
}
|
|
2807
2844
|
}
|
|
2808
|
-
return { mode: r, indent: o, chomp: l, comment:
|
|
2845
|
+
return { mode: r, indent: o, chomp: l, comment: p, length: f };
|
|
2809
2846
|
}
|
|
2810
|
-
function
|
|
2847
|
+
function pn(s) {
|
|
2811
2848
|
const e = s.split(/\n( *)/), t = e[0], n = t.match(/^( *)/), r = [n != null && n[1] ? [n[1], t.slice(n[1].length)] : ["", t]];
|
|
2812
2849
|
for (let o = 1; o < e.length; o += 2)
|
|
2813
2850
|
r.push([e[o], e[o + 1]]);
|
|
2814
2851
|
return r;
|
|
2815
2852
|
}
|
|
2816
|
-
function
|
|
2853
|
+
function ws(s, e, t) {
|
|
2817
2854
|
const { offset: n, type: i, source: r, end: o } = s;
|
|
2818
2855
|
let l, a;
|
|
2819
2856
|
const c = (d, h, y) => t(n + d, h, y);
|
|
2820
2857
|
switch (i) {
|
|
2821
2858
|
case "scalar":
|
|
2822
|
-
l =
|
|
2859
|
+
l = A.PLAIN, a = mn(r, c);
|
|
2823
2860
|
break;
|
|
2824
2861
|
case "single-quoted-scalar":
|
|
2825
|
-
l =
|
|
2862
|
+
l = A.QUOTE_SINGLE, a = yn(r, c);
|
|
2826
2863
|
break;
|
|
2827
2864
|
case "double-quoted-scalar":
|
|
2828
|
-
l =
|
|
2865
|
+
l = A.QUOTE_DOUBLE, a = gn(r, c);
|
|
2829
2866
|
break;
|
|
2867
|
+
/* istanbul ignore next should not happen */
|
|
2830
2868
|
default:
|
|
2831
2869
|
return t(s, "UNEXPECTED_TOKEN", `Expected a flow scalar value, but found: ${i}`), {
|
|
2832
2870
|
value: "",
|
|
@@ -2835,17 +2873,18 @@ function ys(s, e, t) {
|
|
|
2835
2873
|
range: [n, n + r.length, n + r.length]
|
|
2836
2874
|
};
|
|
2837
2875
|
}
|
|
2838
|
-
const
|
|
2876
|
+
const p = n + r.length, f = Ie(o, p, e, t);
|
|
2839
2877
|
return {
|
|
2840
2878
|
value: a,
|
|
2841
2879
|
type: l,
|
|
2842
2880
|
comment: f.comment,
|
|
2843
|
-
range: [n,
|
|
2881
|
+
range: [n, p, f.offset]
|
|
2844
2882
|
};
|
|
2845
2883
|
}
|
|
2846
|
-
function
|
|
2884
|
+
function mn(s, e) {
|
|
2847
2885
|
let t = "";
|
|
2848
2886
|
switch (s[0]) {
|
|
2887
|
+
/* istanbul ignore next should not happen */
|
|
2849
2888
|
case " ":
|
|
2850
2889
|
t = "a tab character";
|
|
2851
2890
|
break;
|
|
@@ -2866,12 +2905,12 @@ function hn(s, e) {
|
|
|
2866
2905
|
break;
|
|
2867
2906
|
}
|
|
2868
2907
|
}
|
|
2869
|
-
return t && e(0, "BAD_SCALAR_START", `Plain value cannot start with ${t}`),
|
|
2908
|
+
return t && e(0, "BAD_SCALAR_START", `Plain value cannot start with ${t}`), Ss(s);
|
|
2870
2909
|
}
|
|
2871
|
-
function
|
|
2872
|
-
return (s[s.length - 1] !== "'" || s.length === 1) && e(s.length, "MISSING_CHAR", "Missing closing 'quote"),
|
|
2910
|
+
function yn(s, e) {
|
|
2911
|
+
return (s[s.length - 1] !== "'" || s.length === 1) && e(s.length, "MISSING_CHAR", "Missing closing 'quote"), Ss(s.slice(1, -1)).replace(/''/g, "'");
|
|
2873
2912
|
}
|
|
2874
|
-
function
|
|
2913
|
+
function Ss(s) {
|
|
2875
2914
|
let e, t;
|
|
2876
2915
|
try {
|
|
2877
2916
|
e = new RegExp(`(.*?)(?<![ ])[ ]*\r?
|
|
@@ -2891,7 +2930,7 @@ function gs(s) {
|
|
|
2891
2930
|
const l = /[ \t]*(.*)/sy;
|
|
2892
2931
|
return l.lastIndex = o, n = l.exec(s), i + r + ((n == null ? void 0 : n[1]) ?? "");
|
|
2893
2932
|
}
|
|
2894
|
-
function
|
|
2933
|
+
function gn(s, e) {
|
|
2895
2934
|
let t = "";
|
|
2896
2935
|
for (let n = 1; n < s.length - 1; ++n) {
|
|
2897
2936
|
const i = s[n];
|
|
@@ -2899,11 +2938,11 @@ function pn(s, e) {
|
|
|
2899
2938
|
`))
|
|
2900
2939
|
if (i === `
|
|
2901
2940
|
`) {
|
|
2902
|
-
const { fold: r, offset: o } =
|
|
2941
|
+
const { fold: r, offset: o } = bn(s, n);
|
|
2903
2942
|
t += r, n = o;
|
|
2904
2943
|
} else if (i === "\\") {
|
|
2905
2944
|
let r = s[++n];
|
|
2906
|
-
const o =
|
|
2945
|
+
const o = wn[r];
|
|
2907
2946
|
if (o)
|
|
2908
2947
|
t += o;
|
|
2909
2948
|
else if (r === `
|
|
@@ -2916,7 +2955,7 @@ function pn(s, e) {
|
|
|
2916
2955
|
r = s[++n + 1];
|
|
2917
2956
|
else if (r === "x" || r === "u" || r === "U") {
|
|
2918
2957
|
const l = { x: 2, u: 4, U: 8 }[r];
|
|
2919
|
-
t +=
|
|
2958
|
+
t += Sn(s, n + 1, l, e), n += l;
|
|
2920
2959
|
} else {
|
|
2921
2960
|
const l = s.substr(n - 1, 2);
|
|
2922
2961
|
e(n - 1, "BAD_DQ_ESCAPE", `Invalid escape sequence ${l}`), t += l;
|
|
@@ -2934,7 +2973,7 @@ function pn(s, e) {
|
|
|
2934
2973
|
}
|
|
2935
2974
|
return (s[s.length - 1] !== '"' || s.length === 1) && e(s.length, "MISSING_CHAR", 'Missing closing "quote'), t;
|
|
2936
2975
|
}
|
|
2937
|
-
function
|
|
2976
|
+
function bn(s, e) {
|
|
2938
2977
|
let t = "", n = s[e + 1];
|
|
2939
2978
|
for (; (n === " " || n === " " || n === `
|
|
2940
2979
|
` || n === "\r") && !(n === "\r" && s[e + 2] !== `
|
|
@@ -2944,7 +2983,7 @@ function mn(s, e) {
|
|
|
2944
2983
|
`), e += 1, n = s[e + 1];
|
|
2945
2984
|
return t || (t = " "), { fold: t, offset: e };
|
|
2946
2985
|
}
|
|
2947
|
-
const
|
|
2986
|
+
const wn = {
|
|
2948
2987
|
0: "\0",
|
|
2949
2988
|
// null character
|
|
2950
2989
|
a: "\x07",
|
|
@@ -2978,7 +3017,7 @@ const yn = {
|
|
|
2978
3017
|
"\\": "\\",
|
|
2979
3018
|
" ": " "
|
|
2980
3019
|
};
|
|
2981
|
-
function
|
|
3020
|
+
function Sn(s, e, t, n) {
|
|
2982
3021
|
const i = s.substr(e, t), o = i.length === t && /^[0-9a-fA-F]+$/.test(i) ? parseInt(i, 16) : NaN;
|
|
2983
3022
|
if (isNaN(o)) {
|
|
2984
3023
|
const l = s.substr(e - 2, t + 2);
|
|
@@ -2986,19 +3025,21 @@ function gn(s, e, t, n) {
|
|
|
2986
3025
|
}
|
|
2987
3026
|
return String.fromCodePoint(o);
|
|
2988
3027
|
}
|
|
2989
|
-
function
|
|
2990
|
-
const { value: i, type: r, comment: o, range: l } = e.type === "block-scalar" ?
|
|
2991
|
-
let
|
|
3028
|
+
function ks(s, e, t, n) {
|
|
3029
|
+
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;
|
|
3030
|
+
let c;
|
|
3031
|
+
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];
|
|
3032
|
+
let p;
|
|
2992
3033
|
try {
|
|
2993
3034
|
const f = c.resolve(i, (d) => n(t ?? e, "TAG_RESOLVE_FAILED", d), s.options);
|
|
2994
|
-
|
|
3035
|
+
p = E(f) ? f : new A(f);
|
|
2995
3036
|
} catch (f) {
|
|
2996
3037
|
const d = f instanceof Error ? f.message : String(f);
|
|
2997
|
-
n(t ?? e, "TAG_RESOLVE_FAILED", d),
|
|
3038
|
+
n(t ?? e, "TAG_RESOLVE_FAILED", d), p = new A(i);
|
|
2998
3039
|
}
|
|
2999
|
-
return
|
|
3040
|
+
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;
|
|
3000
3041
|
}
|
|
3001
|
-
function
|
|
3042
|
+
function kn(s, e, t, n, i) {
|
|
3002
3043
|
var l;
|
|
3003
3044
|
if (t === "!")
|
|
3004
3045
|
return s[R];
|
|
@@ -3015,24 +3056,24 @@ function bn(s, e, t, n, i) {
|
|
|
3015
3056
|
const o = s.knownTags[t];
|
|
3016
3057
|
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]);
|
|
3017
3058
|
}
|
|
3018
|
-
function
|
|
3019
|
-
const
|
|
3020
|
-
var
|
|
3021
|
-
return
|
|
3022
|
-
}) ||
|
|
3023
|
-
if (
|
|
3024
|
-
const
|
|
3025
|
-
var
|
|
3026
|
-
return
|
|
3027
|
-
}) ??
|
|
3028
|
-
if (
|
|
3029
|
-
const
|
|
3030
|
-
i
|
|
3059
|
+
function Nn({ atKey: s, directives: e, schema: t }, n, i, r) {
|
|
3060
|
+
const o = t.tags.find((l) => {
|
|
3061
|
+
var a;
|
|
3062
|
+
return (l.default === !0 || s && l.default === "key") && ((a = l.test) == null ? void 0 : a.test(n));
|
|
3063
|
+
}) || t[R];
|
|
3064
|
+
if (t.compat) {
|
|
3065
|
+
const l = t.compat.find((a) => {
|
|
3066
|
+
var c;
|
|
3067
|
+
return a.default && ((c = a.test) == null ? void 0 : c.test(n));
|
|
3068
|
+
}) ?? t[R];
|
|
3069
|
+
if (o.tag !== l.tag) {
|
|
3070
|
+
const a = e.tagString(o.tag), c = e.tagString(l.tag), p = `Value may be parsed as either ${a} or ${c}`;
|
|
3071
|
+
r(i, "TAG_RESOLVE_FAILED", p, !0);
|
|
3031
3072
|
}
|
|
3032
3073
|
}
|
|
3033
|
-
return
|
|
3074
|
+
return o;
|
|
3034
3075
|
}
|
|
3035
|
-
function
|
|
3076
|
+
function On(s, e, t) {
|
|
3036
3077
|
if (e) {
|
|
3037
3078
|
t === null && (t = e.length);
|
|
3038
3079
|
for (let n = t - 1; n >= 0; --n) {
|
|
@@ -3051,54 +3092,55 @@ function Sn(s, e, t) {
|
|
|
3051
3092
|
}
|
|
3052
3093
|
return s;
|
|
3053
3094
|
}
|
|
3054
|
-
const
|
|
3055
|
-
function
|
|
3056
|
-
const { spaceBefore:
|
|
3057
|
-
let
|
|
3095
|
+
const An = { composeNode: Ns, composeEmptyNode: Et };
|
|
3096
|
+
function Ns(s, e, t, n) {
|
|
3097
|
+
const i = s.atKey, { spaceBefore: r, comment: o, anchor: l, tag: a } = t;
|
|
3098
|
+
let c, p = !0;
|
|
3058
3099
|
switch (e.type) {
|
|
3059
3100
|
case "alias":
|
|
3060
|
-
|
|
3101
|
+
c = En(s, e, n), (l || a) && n(e, "ALIAS_PROPS", "An alias node must not specify any properties");
|
|
3061
3102
|
break;
|
|
3062
3103
|
case "scalar":
|
|
3063
3104
|
case "single-quoted-scalar":
|
|
3064
3105
|
case "double-quoted-scalar":
|
|
3065
3106
|
case "block-scalar":
|
|
3066
|
-
|
|
3107
|
+
c = ks(s, e, a, n), l && (c.anchor = l.source.substring(1));
|
|
3067
3108
|
break;
|
|
3068
3109
|
case "block-map":
|
|
3069
3110
|
case "block-seq":
|
|
3070
3111
|
case "flow-collection":
|
|
3071
|
-
|
|
3112
|
+
c = hn(An, s, e, t, n), l && (c.anchor = l.source.substring(1));
|
|
3072
3113
|
break;
|
|
3073
3114
|
default: {
|
|
3074
|
-
const
|
|
3075
|
-
n(e, "UNEXPECTED_TOKEN",
|
|
3115
|
+
const f = e.type === "error" ? e.message : `Unsupported token (type: ${e.type})`;
|
|
3116
|
+
n(e, "UNEXPECTED_TOKEN", f), c = Et(s, e.offset, void 0, null, t, n), p = !1;
|
|
3076
3117
|
}
|
|
3077
3118
|
}
|
|
3078
|
-
return
|
|
3119
|
+
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;
|
|
3079
3120
|
}
|
|
3080
|
-
function
|
|
3081
|
-
const
|
|
3121
|
+
function Et(s, e, t, n, { spaceBefore: i, comment: r, anchor: o, tag: l, end: a }, c) {
|
|
3122
|
+
const p = {
|
|
3082
3123
|
type: "scalar",
|
|
3083
|
-
offset:
|
|
3124
|
+
offset: On(e, t, n),
|
|
3084
3125
|
indent: -1,
|
|
3085
3126
|
source: ""
|
|
3086
|
-
}, f =
|
|
3127
|
+
}, f = ks(s, p, l, c);
|
|
3087
3128
|
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;
|
|
3088
3129
|
}
|
|
3089
|
-
function
|
|
3090
|
-
const r = new
|
|
3130
|
+
function En({ options: s }, { offset: e, source: t, end: n }, i) {
|
|
3131
|
+
const r = new Re(t.substring(1));
|
|
3091
3132
|
r.source === "" && i(e, "BAD_ALIAS", "Alias cannot be an empty string"), r.source.endsWith(":") && i(e + t.length - 1, "BAD_ALIAS", "Alias ending in : is ambiguous", !0);
|
|
3092
|
-
const o = e + t.length, l =
|
|
3133
|
+
const o = e + t.length, l = Ie(n, o, s.strict, i);
|
|
3093
3134
|
return r.range = [e, o, l.offset], l.comment && (r.comment = l.comment), r;
|
|
3094
3135
|
}
|
|
3095
|
-
function
|
|
3096
|
-
const l = Object.assign({ _directives: e }, s), a = new
|
|
3136
|
+
function In(s, e, { offset: t, start: n, value: i, end: r }, o) {
|
|
3137
|
+
const l = Object.assign({ _directives: e }, s), a = new ge(void 0, l), c = {
|
|
3138
|
+
atKey: !1,
|
|
3097
3139
|
atRoot: !0,
|
|
3098
3140
|
directives: a.directives,
|
|
3099
3141
|
options: a.options,
|
|
3100
3142
|
schema: a.schema
|
|
3101
|
-
},
|
|
3143
|
+
}, p = ue(n, {
|
|
3102
3144
|
indicator: "doc-start",
|
|
3103
3145
|
next: i ?? (r == null ? void 0 : r[0]),
|
|
3104
3146
|
offset: t,
|
|
@@ -3106,11 +3148,11 @@ function On(s, e, { offset: t, start: n, value: i, end: r }, o) {
|
|
|
3106
3148
|
parentIndent: 0,
|
|
3107
3149
|
startOnNewline: !0
|
|
3108
3150
|
});
|
|
3109
|
-
|
|
3110
|
-
const f = a.contents.range[2], d =
|
|
3151
|
+
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);
|
|
3152
|
+
const f = a.contents.range[2], d = Ie(r, f, !1, o);
|
|
3111
3153
|
return d.comment && (a.comment = d.comment), a.range = [t, f, d.offset], a;
|
|
3112
3154
|
}
|
|
3113
|
-
function
|
|
3155
|
+
function be(s) {
|
|
3114
3156
|
if (typeof s == "number")
|
|
3115
3157
|
return [s, s + 1];
|
|
3116
3158
|
if (Array.isArray(s))
|
|
@@ -3118,7 +3160,7 @@ function ge(s) {
|
|
|
3118
3160
|
const { offset: e, source: t } = s;
|
|
3119
3161
|
return [e, e + (typeof t == "string" ? t.length : 1)];
|
|
3120
3162
|
}
|
|
3121
|
-
function
|
|
3163
|
+
function Kt(s) {
|
|
3122
3164
|
var i;
|
|
3123
3165
|
let e = "", t = !1, n = !1;
|
|
3124
3166
|
for (let r = 0; r < s.length; ++r) {
|
|
@@ -3139,15 +3181,15 @@ function Bt(s) {
|
|
|
3139
3181
|
}
|
|
3140
3182
|
return { comment: e, afterEmptyLine: n };
|
|
3141
3183
|
}
|
|
3142
|
-
class
|
|
3184
|
+
class It {
|
|
3143
3185
|
constructor(e = {}) {
|
|
3144
3186
|
this.doc = null, this.atDirectives = !1, this.prelude = [], this.errors = [], this.warnings = [], this.onError = (t, n, i, r) => {
|
|
3145
|
-
const o =
|
|
3146
|
-
r ? this.warnings.push(new
|
|
3187
|
+
const o = be(t);
|
|
3188
|
+
r ? this.warnings.push(new ys(o, n, i)) : this.errors.push(new z(o, n, i));
|
|
3147
3189
|
}, this.directives = new B({ version: e.version || "1.2" }), this.options = e;
|
|
3148
3190
|
}
|
|
3149
3191
|
decorate(e, t) {
|
|
3150
|
-
const { comment: n, afterEmptyLine: i } =
|
|
3192
|
+
const { comment: n, afterEmptyLine: i } = Kt(this.prelude);
|
|
3151
3193
|
if (n) {
|
|
3152
3194
|
const r = e.contents;
|
|
3153
3195
|
if (t)
|
|
@@ -3157,7 +3199,7 @@ ${n}` : n;
|
|
|
3157
3199
|
e.commentBefore = n;
|
|
3158
3200
|
else if (L(r) && !r.flow && r.items.length > 0) {
|
|
3159
3201
|
let o = r.items[0];
|
|
3160
|
-
|
|
3202
|
+
T(o) && (o = o.key);
|
|
3161
3203
|
const l = o.commentBefore;
|
|
3162
3204
|
o.commentBefore = l ? `${n}
|
|
3163
3205
|
${l}` : n;
|
|
@@ -3176,7 +3218,7 @@ ${o}` : n;
|
|
|
3176
3218
|
*/
|
|
3177
3219
|
streamInfo() {
|
|
3178
3220
|
return {
|
|
3179
|
-
comment:
|
|
3221
|
+
comment: Kt(this.prelude).comment,
|
|
3180
3222
|
directives: this.directives,
|
|
3181
3223
|
errors: this.errors,
|
|
3182
3224
|
warnings: this.warnings
|
|
@@ -3198,12 +3240,12 @@ ${o}` : n;
|
|
|
3198
3240
|
switch (e.type) {
|
|
3199
3241
|
case "directive":
|
|
3200
3242
|
this.directives.add(e.source, (t, n, i) => {
|
|
3201
|
-
const r =
|
|
3243
|
+
const r = be(e);
|
|
3202
3244
|
r[0] += t, this.onError(r, "BAD_DIRECTIVE", n, i);
|
|
3203
3245
|
}), this.prelude.push(e.source), this.atDirectives = !0;
|
|
3204
3246
|
break;
|
|
3205
3247
|
case "document": {
|
|
3206
|
-
const t =
|
|
3248
|
+
const t = In(this.options, this.directives, e, this.onError);
|
|
3207
3249
|
this.atDirectives && !t.directives.docStart && this.onError(e, "MISSING_CHAR", "Missing directives-end/doc-start indicator line"), this.decorate(t, !1), this.doc && (yield this.doc), this.doc = t, this.atDirectives = !1;
|
|
3208
3250
|
break;
|
|
3209
3251
|
}
|
|
@@ -3215,18 +3257,18 @@ ${o}` : n;
|
|
|
3215
3257
|
this.prelude.push(e.source);
|
|
3216
3258
|
break;
|
|
3217
3259
|
case "error": {
|
|
3218
|
-
const t = e.source ? `${e.message}: ${JSON.stringify(e.source)}` : e.message, n = new
|
|
3260
|
+
const t = e.source ? `${e.message}: ${JSON.stringify(e.source)}` : e.message, n = new z(be(e), "UNEXPECTED_TOKEN", t);
|
|
3219
3261
|
this.atDirectives || !this.doc ? this.errors.push(n) : this.doc.errors.push(n);
|
|
3220
3262
|
break;
|
|
3221
3263
|
}
|
|
3222
3264
|
case "doc-end": {
|
|
3223
3265
|
if (!this.doc) {
|
|
3224
3266
|
const n = "Unexpected doc-end without preceding document";
|
|
3225
|
-
this.errors.push(new
|
|
3267
|
+
this.errors.push(new z(be(e), "UNEXPECTED_TOKEN", n));
|
|
3226
3268
|
break;
|
|
3227
3269
|
}
|
|
3228
3270
|
this.doc.directives.docEnd = !0;
|
|
3229
|
-
const t =
|
|
3271
|
+
const t = Ie(e.end, e.offset + e.source.length, this.doc.options.strict, this.onError);
|
|
3230
3272
|
if (this.decorate(this.doc, !0), t.comment) {
|
|
3231
3273
|
const n = this.doc.comment;
|
|
3232
3274
|
this.doc.comment = n ? `${n}
|
|
@@ -3236,7 +3278,7 @@ ${t.comment}` : t.comment;
|
|
|
3236
3278
|
break;
|
|
3237
3279
|
}
|
|
3238
3280
|
default:
|
|
3239
|
-
this.errors.push(new
|
|
3281
|
+
this.errors.push(new z(be(e), "UNEXPECTED_TOKEN", `Unsupported token ${e.type}`));
|
|
3240
3282
|
}
|
|
3241
3283
|
}
|
|
3242
3284
|
/**
|
|
@@ -3249,33 +3291,33 @@ ${t.comment}` : t.comment;
|
|
|
3249
3291
|
if (this.doc)
|
|
3250
3292
|
this.decorate(this.doc, !0), yield this.doc, this.doc = null;
|
|
3251
3293
|
else if (e) {
|
|
3252
|
-
const n = Object.assign({ _directives: this.directives }, this.options), i = new
|
|
3294
|
+
const n = Object.assign({ _directives: this.directives }, this.options), i = new ge(void 0, n);
|
|
3253
3295
|
this.atDirectives && this.onError(t, "MISSING_CHAR", "Missing directives-end indicator line"), i.range = [0, t, t], this.decorate(i, !1), yield i;
|
|
3254
3296
|
}
|
|
3255
3297
|
}
|
|
3256
3298
|
}
|
|
3257
|
-
function
|
|
3299
|
+
function Tn(s, e = !0, t) {
|
|
3258
3300
|
if (s) {
|
|
3259
3301
|
const n = (i, r, o) => {
|
|
3260
3302
|
const l = typeof i == "number" ? i : Array.isArray(i) ? i[0] : i.offset;
|
|
3261
3303
|
if (t)
|
|
3262
3304
|
t(l, r, o);
|
|
3263
3305
|
else
|
|
3264
|
-
throw new
|
|
3306
|
+
throw new z([l, l + 1], r, o);
|
|
3265
3307
|
};
|
|
3266
3308
|
switch (s.type) {
|
|
3267
3309
|
case "scalar":
|
|
3268
3310
|
case "single-quoted-scalar":
|
|
3269
3311
|
case "double-quoted-scalar":
|
|
3270
|
-
return
|
|
3312
|
+
return ws(s, e, n);
|
|
3271
3313
|
case "block-scalar":
|
|
3272
|
-
return
|
|
3314
|
+
return bs({ options: { strict: e } }, s, n);
|
|
3273
3315
|
}
|
|
3274
3316
|
}
|
|
3275
3317
|
return null;
|
|
3276
3318
|
}
|
|
3277
|
-
function
|
|
3278
|
-
const { implicitKey: t = !1, indent: n, inFlow: i = !1, offset: r = -1, type: o = "PLAIN" } = e, l =
|
|
3319
|
+
function Ln(s, e) {
|
|
3320
|
+
const { implicitKey: t = !1, indent: n, inFlow: i = !1, offset: r = -1, type: o = "PLAIN" } = e, l = Ae({ type: o, value: s }, {
|
|
3279
3321
|
implicitKey: t,
|
|
3280
3322
|
indent: n > 0 ? " ".repeat(n) : "",
|
|
3281
3323
|
inFlow: i,
|
|
@@ -3288,11 +3330,11 @@ function En(s, e) {
|
|
|
3288
3330
|
case "|":
|
|
3289
3331
|
case ">": {
|
|
3290
3332
|
const c = l.indexOf(`
|
|
3291
|
-
`),
|
|
3333
|
+
`), p = l.substring(0, c), f = l.substring(c + 1) + `
|
|
3292
3334
|
`, d = [
|
|
3293
|
-
{ type: "block-scalar-header", offset: r, indent: n, source:
|
|
3335
|
+
{ type: "block-scalar-header", offset: r, indent: n, source: p }
|
|
3294
3336
|
];
|
|
3295
|
-
return
|
|
3337
|
+
return Os(d, a) || d.push({ type: "newline", offset: -1, indent: n, source: `
|
|
3296
3338
|
` }), { type: "block-scalar", offset: r, indent: n, props: d, source: f };
|
|
3297
3339
|
}
|
|
3298
3340
|
case '"':
|
|
@@ -3303,7 +3345,7 @@ function En(s, e) {
|
|
|
3303
3345
|
return { type: "scalar", offset: r, indent: n, source: l, end: a };
|
|
3304
3346
|
}
|
|
3305
3347
|
}
|
|
3306
|
-
function
|
|
3348
|
+
function $n(s, e, t = {}) {
|
|
3307
3349
|
let { afterKey: n = !1, implicitKey: i = !1, inFlow: r = !1, type: o } = t, l = "indent" in s ? s.indent : null;
|
|
3308
3350
|
if (n && typeof l == "number" && (l += 2), !o)
|
|
3309
3351
|
switch (s.type) {
|
|
@@ -3323,7 +3365,7 @@ function In(s, e, t = {}) {
|
|
|
3323
3365
|
default:
|
|
3324
3366
|
o = "PLAIN";
|
|
3325
3367
|
}
|
|
3326
|
-
const a =
|
|
3368
|
+
const a = Ae({ type: o, value: e }, {
|
|
3327
3369
|
implicitKey: i || l === null,
|
|
3328
3370
|
indent: l !== null && l > 0 ? " ".repeat(l) : "",
|
|
3329
3371
|
inFlow: r,
|
|
@@ -3332,19 +3374,19 @@ function In(s, e, t = {}) {
|
|
|
3332
3374
|
switch (a[0]) {
|
|
3333
3375
|
case "|":
|
|
3334
3376
|
case ">":
|
|
3335
|
-
|
|
3377
|
+
_n(s, a);
|
|
3336
3378
|
break;
|
|
3337
3379
|
case '"':
|
|
3338
|
-
|
|
3380
|
+
rt(s, a, "double-quoted-scalar");
|
|
3339
3381
|
break;
|
|
3340
3382
|
case "'":
|
|
3341
|
-
|
|
3383
|
+
rt(s, a, "single-quoted-scalar");
|
|
3342
3384
|
break;
|
|
3343
3385
|
default:
|
|
3344
|
-
|
|
3386
|
+
rt(s, a, "scalar");
|
|
3345
3387
|
}
|
|
3346
3388
|
}
|
|
3347
|
-
function
|
|
3389
|
+
function _n(s, e) {
|
|
3348
3390
|
const t = e.indexOf(`
|
|
3349
3391
|
`), n = e.substring(0, t), i = e.substring(t + 1) + `
|
|
3350
3392
|
`;
|
|
@@ -3357,14 +3399,14 @@ function Tn(s, e) {
|
|
|
3357
3399
|
const { offset: r } = s, o = "indent" in s ? s.indent : -1, l = [
|
|
3358
3400
|
{ type: "block-scalar-header", offset: r, indent: o, source: n }
|
|
3359
3401
|
];
|
|
3360
|
-
|
|
3402
|
+
Os(l, "end" in s ? s.end : void 0) || l.push({ type: "newline", offset: -1, indent: o, source: `
|
|
3361
3403
|
` });
|
|
3362
3404
|
for (const a of Object.keys(s))
|
|
3363
3405
|
a !== "type" && a !== "offset" && delete s[a];
|
|
3364
3406
|
Object.assign(s, { type: "block-scalar", indent: o, props: l, source: i });
|
|
3365
3407
|
}
|
|
3366
3408
|
}
|
|
3367
|
-
function
|
|
3409
|
+
function Os(s, e) {
|
|
3368
3410
|
if (e)
|
|
3369
3411
|
for (const t of e)
|
|
3370
3412
|
switch (t.type) {
|
|
@@ -3377,7 +3419,7 @@ function Ss(s, e) {
|
|
|
3377
3419
|
}
|
|
3378
3420
|
return !1;
|
|
3379
3421
|
}
|
|
3380
|
-
function
|
|
3422
|
+
function rt(s, e, t) {
|
|
3381
3423
|
switch (s.type) {
|
|
3382
3424
|
case "scalar":
|
|
3383
3425
|
case "double-quoted-scalar":
|
|
@@ -3408,32 +3450,32 @@ function nt(s, e, t) {
|
|
|
3408
3450
|
}
|
|
3409
3451
|
}
|
|
3410
3452
|
}
|
|
3411
|
-
const
|
|
3412
|
-
function
|
|
3453
|
+
const Cn = (s) => "type" in s ? qe(s) : Ke(s);
|
|
3454
|
+
function qe(s) {
|
|
3413
3455
|
switch (s.type) {
|
|
3414
3456
|
case "block-scalar": {
|
|
3415
3457
|
let e = "";
|
|
3416
3458
|
for (const t of s.props)
|
|
3417
|
-
e +=
|
|
3459
|
+
e += qe(t);
|
|
3418
3460
|
return e + s.source;
|
|
3419
3461
|
}
|
|
3420
3462
|
case "block-map":
|
|
3421
3463
|
case "block-seq": {
|
|
3422
3464
|
let e = "";
|
|
3423
3465
|
for (const t of s.items)
|
|
3424
|
-
e +=
|
|
3466
|
+
e += Ke(t);
|
|
3425
3467
|
return e;
|
|
3426
3468
|
}
|
|
3427
3469
|
case "flow-collection": {
|
|
3428
3470
|
let e = s.start.source;
|
|
3429
3471
|
for (const t of s.items)
|
|
3430
|
-
e +=
|
|
3472
|
+
e += Ke(t);
|
|
3431
3473
|
for (const t of s.end)
|
|
3432
3474
|
e += t.source;
|
|
3433
3475
|
return e;
|
|
3434
3476
|
}
|
|
3435
3477
|
case "document": {
|
|
3436
|
-
let e =
|
|
3478
|
+
let e = Ke(s);
|
|
3437
3479
|
if (s.end)
|
|
3438
3480
|
for (const t of s.end)
|
|
3439
3481
|
e += t.source;
|
|
@@ -3448,23 +3490,23 @@ function je(s) {
|
|
|
3448
3490
|
}
|
|
3449
3491
|
}
|
|
3450
3492
|
}
|
|
3451
|
-
function
|
|
3493
|
+
function Ke({ start: s, key: e, sep: t, value: n }) {
|
|
3452
3494
|
let i = "";
|
|
3453
3495
|
for (const r of s)
|
|
3454
3496
|
i += r.source;
|
|
3455
|
-
if (e && (i +=
|
|
3497
|
+
if (e && (i += qe(e)), t)
|
|
3456
3498
|
for (const r of t)
|
|
3457
3499
|
i += r.source;
|
|
3458
|
-
return n && (i +=
|
|
3500
|
+
return n && (i += qe(n)), i;
|
|
3459
3501
|
}
|
|
3460
|
-
const
|
|
3461
|
-
function
|
|
3462
|
-
"type" in s && s.type === "document" && (s = { start: s.start, value: s.value }),
|
|
3502
|
+
const ht = Symbol("break visit"), vn = Symbol("skip children"), As = Symbol("remove item");
|
|
3503
|
+
function Z(s, e) {
|
|
3504
|
+
"type" in s && s.type === "document" && (s = { start: s.start, value: s.value }), Es(Object.freeze([]), s, e);
|
|
3463
3505
|
}
|
|
3464
|
-
|
|
3465
|
-
|
|
3466
|
-
|
|
3467
|
-
|
|
3506
|
+
Z.BREAK = ht;
|
|
3507
|
+
Z.SKIP = vn;
|
|
3508
|
+
Z.REMOVE = As;
|
|
3509
|
+
Z.itemAtPath = (s, e) => {
|
|
3468
3510
|
let t = s;
|
|
3469
3511
|
for (const [n, i] of e) {
|
|
3470
3512
|
const r = t == null ? void 0 : t[n];
|
|
@@ -3475,13 +3517,13 @@ z.itemAtPath = (s, e) => {
|
|
|
3475
3517
|
}
|
|
3476
3518
|
return t;
|
|
3477
3519
|
};
|
|
3478
|
-
|
|
3479
|
-
const t =
|
|
3520
|
+
Z.parentCollection = (s, e) => {
|
|
3521
|
+
const t = Z.itemAtPath(s, e.slice(0, -1)), n = e[e.length - 1][0], i = t == null ? void 0 : t[n];
|
|
3480
3522
|
if (i && "items" in i)
|
|
3481
3523
|
return i;
|
|
3482
3524
|
throw new Error("Parent collection not found");
|
|
3483
3525
|
};
|
|
3484
|
-
function
|
|
3526
|
+
function Es(s, e, t) {
|
|
3485
3527
|
let n = t(e, s);
|
|
3486
3528
|
if (typeof n == "symbol")
|
|
3487
3529
|
return n;
|
|
@@ -3489,13 +3531,13 @@ function Ns(s, e, t) {
|
|
|
3489
3531
|
const r = e[i];
|
|
3490
3532
|
if (r && "items" in r) {
|
|
3491
3533
|
for (let o = 0; o < r.items.length; ++o) {
|
|
3492
|
-
const l =
|
|
3534
|
+
const l = Es(Object.freeze(s.concat([[i, o]])), r.items[o], t);
|
|
3493
3535
|
if (typeof l == "number")
|
|
3494
3536
|
o = l - 1;
|
|
3495
3537
|
else {
|
|
3496
|
-
if (l ===
|
|
3497
|
-
return
|
|
3498
|
-
l ===
|
|
3538
|
+
if (l === ht)
|
|
3539
|
+
return ht;
|
|
3540
|
+
l === As && (r.items.splice(o, 1), o -= 1);
|
|
3499
3541
|
}
|
|
3500
3542
|
}
|
|
3501
3543
|
typeof n == "function" && i === "key" && (n = n(e, s));
|
|
@@ -3503,30 +3545,30 @@ function Ns(s, e, t) {
|
|
|
3503
3545
|
}
|
|
3504
3546
|
return typeof n == "function" ? n(e, s) : n;
|
|
3505
3547
|
}
|
|
3506
|
-
const
|
|
3507
|
-
function
|
|
3548
|
+
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");
|
|
3549
|
+
function Kn(s) {
|
|
3508
3550
|
switch (s) {
|
|
3509
|
-
case
|
|
3551
|
+
case ze:
|
|
3510
3552
|
return "<BOM>";
|
|
3511
|
-
case
|
|
3553
|
+
case Ze:
|
|
3512
3554
|
return "<DOC>";
|
|
3513
|
-
case
|
|
3555
|
+
case xe:
|
|
3514
3556
|
return "<FLOW_END>";
|
|
3515
|
-
case
|
|
3557
|
+
case Oe:
|
|
3516
3558
|
return "<SCALAR>";
|
|
3517
3559
|
default:
|
|
3518
3560
|
return JSON.stringify(s);
|
|
3519
3561
|
}
|
|
3520
3562
|
}
|
|
3521
|
-
function
|
|
3563
|
+
function Is(s) {
|
|
3522
3564
|
switch (s) {
|
|
3523
|
-
case
|
|
3565
|
+
case ze:
|
|
3524
3566
|
return "byte-order-mark";
|
|
3525
|
-
case
|
|
3567
|
+
case Ze:
|
|
3526
3568
|
return "doc-mode";
|
|
3527
|
-
case
|
|
3569
|
+
case xe:
|
|
3528
3570
|
return "flow-error-end";
|
|
3529
|
-
case
|
|
3571
|
+
case Oe:
|
|
3530
3572
|
return "scalar";
|
|
3531
3573
|
case "---":
|
|
3532
3574
|
return "doc-start";
|
|
@@ -3579,23 +3621,23 @@ function Os(s) {
|
|
|
3579
3621
|
}
|
|
3580
3622
|
return null;
|
|
3581
3623
|
}
|
|
3582
|
-
|
|
3624
|
+
const Pn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3583
3625
|
__proto__: null,
|
|
3584
|
-
BOM:
|
|
3585
|
-
DOCUMENT:
|
|
3586
|
-
FLOW_END:
|
|
3587
|
-
SCALAR:
|
|
3588
|
-
createScalarToken:
|
|
3589
|
-
isCollection:
|
|
3590
|
-
isScalar:
|
|
3591
|
-
prettyToken:
|
|
3592
|
-
resolveAsScalar:
|
|
3593
|
-
setScalarValue:
|
|
3594
|
-
stringify:
|
|
3595
|
-
tokenType:
|
|
3596
|
-
visit:
|
|
3597
|
-
});
|
|
3598
|
-
function
|
|
3626
|
+
BOM: ze,
|
|
3627
|
+
DOCUMENT: Ze,
|
|
3628
|
+
FLOW_END: xe,
|
|
3629
|
+
SCALAR: Oe,
|
|
3630
|
+
createScalarToken: Ln,
|
|
3631
|
+
isCollection: Bn,
|
|
3632
|
+
isScalar: Mn,
|
|
3633
|
+
prettyToken: Kn,
|
|
3634
|
+
resolveAsScalar: Tn,
|
|
3635
|
+
setScalarValue: $n,
|
|
3636
|
+
stringify: Cn,
|
|
3637
|
+
tokenType: Is,
|
|
3638
|
+
visit: Z
|
|
3639
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
3640
|
+
function D(s) {
|
|
3599
3641
|
switch (s) {
|
|
3600
3642
|
case void 0:
|
|
3601
3643
|
case " ":
|
|
@@ -3608,9 +3650,9 @@ function K(s) {
|
|
|
3608
3650
|
return !1;
|
|
3609
3651
|
}
|
|
3610
3652
|
}
|
|
3611
|
-
const
|
|
3612
|
-
\r `),
|
|
3613
|
-
class
|
|
3653
|
+
const Pt = new Set("0123456789ABCDEFabcdef"), jn = new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"), _e = new Set(",[]{}"), Dn = new Set(` ,[]{}
|
|
3654
|
+
\r `), ot = (s) => !s || Dn.has(s);
|
|
3655
|
+
class Ts {
|
|
3614
3656
|
constructor() {
|
|
3615
3657
|
this.atEnd = !1, this.blockScalarIndent = -1, this.blockScalarKeep = !1, this.buffer = "", this.flowKey = !1, this.flowLevel = 0, this.indentNext = 0, this.indentValue = 0, this.lineEndPos = null, this.next = null, this.pos = 0;
|
|
3616
3658
|
}
|
|
@@ -3659,7 +3701,7 @@ class As {
|
|
|
3659
3701
|
}
|
|
3660
3702
|
if (t === "-" || t === ".") {
|
|
3661
3703
|
const n = this.buffer.substr(e, 3);
|
|
3662
|
-
if ((n === "---" || n === "...") &&
|
|
3704
|
+
if ((n === "---" || n === "...") && D(this.buffer[e + 3]))
|
|
3663
3705
|
return -1;
|
|
3664
3706
|
}
|
|
3665
3707
|
return e;
|
|
@@ -3702,7 +3744,7 @@ class As {
|
|
|
3702
3744
|
let e = this.getLine();
|
|
3703
3745
|
if (e === null)
|
|
3704
3746
|
return this.setNext("stream");
|
|
3705
|
-
if (e[0] ===
|
|
3747
|
+
if (e[0] === ze && (yield* this.pushCount(1), e = e.substring(1)), e[0] === "%") {
|
|
3706
3748
|
let t = e.length, n = e.indexOf("#");
|
|
3707
3749
|
for (; n !== -1; ) {
|
|
3708
3750
|
const r = e[n - 1];
|
|
@@ -3726,7 +3768,7 @@ class As {
|
|
|
3726
3768
|
const t = yield* this.pushSpaces(!0);
|
|
3727
3769
|
return yield* this.pushCount(e.length - t), yield* this.pushNewline(), "stream";
|
|
3728
3770
|
}
|
|
3729
|
-
return yield
|
|
3771
|
+
return yield Ze, yield* this.parseLineStart();
|
|
3730
3772
|
}
|
|
3731
3773
|
*parseLineStart() {
|
|
3732
3774
|
const e = this.charAt(0);
|
|
@@ -3736,16 +3778,16 @@ class As {
|
|
|
3736
3778
|
if (!this.atEnd && !this.hasChars(4))
|
|
3737
3779
|
return this.setNext("line-start");
|
|
3738
3780
|
const t = this.peek(3);
|
|
3739
|
-
if ((t === "---" || t === "...") &&
|
|
3781
|
+
if ((t === "---" || t === "...") && D(this.charAt(3)))
|
|
3740
3782
|
return yield* this.pushCount(3), this.indentValue = 0, this.indentNext = 0, t === "---" ? "doc" : "stream";
|
|
3741
3783
|
}
|
|
3742
|
-
return this.indentValue = yield* this.pushSpaces(!1), this.indentNext > this.indentValue && !
|
|
3784
|
+
return this.indentValue = yield* this.pushSpaces(!1), this.indentNext > this.indentValue && !D(this.charAt(1)) && (this.indentNext = this.indentValue), yield* this.parseBlockStart();
|
|
3743
3785
|
}
|
|
3744
3786
|
*parseBlockStart() {
|
|
3745
3787
|
const [e, t] = this.peek(2);
|
|
3746
3788
|
if (!t && !this.atEnd)
|
|
3747
3789
|
return this.setNext("block-start");
|
|
3748
|
-
if ((e === "-" || e === "?" || e === ":") &&
|
|
3790
|
+
if ((e === "-" || e === "?" || e === ":") && D(t)) {
|
|
3749
3791
|
const n = (yield* this.pushCount(1)) + (yield* this.pushSpaces(!0));
|
|
3750
3792
|
return this.indentNext = this.indentValue + 1, this.indentValue += n, yield* this.parseBlockStart();
|
|
3751
3793
|
}
|
|
@@ -3760,6 +3802,7 @@ class As {
|
|
|
3760
3802
|
switch (e[t]) {
|
|
3761
3803
|
case "#":
|
|
3762
3804
|
yield* this.pushCount(e.length - t);
|
|
3805
|
+
// fallthrough
|
|
3763
3806
|
case void 0:
|
|
3764
3807
|
return yield* this.pushNewline(), yield* this.parseLineStart();
|
|
3765
3808
|
case "{":
|
|
@@ -3769,7 +3812,7 @@ class As {
|
|
|
3769
3812
|
case "]":
|
|
3770
3813
|
return yield* this.pushCount(1), "doc";
|
|
3771
3814
|
case "*":
|
|
3772
|
-
return yield* this.pushUntil(
|
|
3815
|
+
return yield* this.pushUntil(ot), "doc";
|
|
3773
3816
|
case '"':
|
|
3774
3817
|
case "'":
|
|
3775
3818
|
return yield* this.parseQuotedScalar();
|
|
@@ -3788,8 +3831,8 @@ class As {
|
|
|
3788
3831
|
const i = this.getLine();
|
|
3789
3832
|
if (i === null)
|
|
3790
3833
|
return this.setNext("flow");
|
|
3791
|
-
if ((n !== -1 && n < this.indentNext && i[0] !== "#" || n === 0 && (i.startsWith("---") || i.startsWith("...")) &&
|
|
3792
|
-
return this.flowLevel = 0, yield
|
|
3834
|
+
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] === "}")))
|
|
3835
|
+
return this.flowLevel = 0, yield xe, yield* this.parseLineStart();
|
|
3793
3836
|
let r = 0;
|
|
3794
3837
|
for (; i[r] === ","; )
|
|
3795
3838
|
r += yield* this.pushCount(1), r += yield* this.pushSpaces(!0), this.flowKey = !1;
|
|
@@ -3805,15 +3848,16 @@ class As {
|
|
|
3805
3848
|
case "]":
|
|
3806
3849
|
return yield* this.pushCount(1), this.flowKey = !0, this.flowLevel -= 1, this.flowLevel ? "flow" : "doc";
|
|
3807
3850
|
case "*":
|
|
3808
|
-
return yield* this.pushUntil(
|
|
3851
|
+
return yield* this.pushUntil(ot), "flow";
|
|
3809
3852
|
case '"':
|
|
3810
3853
|
case "'":
|
|
3811
3854
|
return this.flowKey = !0, yield* this.parseQuotedScalar();
|
|
3812
3855
|
case ":": {
|
|
3813
3856
|
const o = this.charAt(1);
|
|
3814
|
-
if (this.flowKey ||
|
|
3857
|
+
if (this.flowKey || D(o) || o === ",")
|
|
3815
3858
|
return this.flowKey = !1, yield* this.pushCount(1), yield* this.pushSpaces(!0), "flow";
|
|
3816
3859
|
}
|
|
3860
|
+
// fallthrough
|
|
3817
3861
|
default:
|
|
3818
3862
|
return this.flowKey = !1, yield* this.parsePlainScalar();
|
|
3819
3863
|
}
|
|
@@ -3865,7 +3909,7 @@ class As {
|
|
|
3865
3909
|
else if (t !== "-")
|
|
3866
3910
|
break;
|
|
3867
3911
|
}
|
|
3868
|
-
return yield* this.pushUntil((t) =>
|
|
3912
|
+
return yield* this.pushUntil((t) => D(t) || t === "#");
|
|
3869
3913
|
}
|
|
3870
3914
|
*parseBlockScalar() {
|
|
3871
3915
|
let e = this.pos - 1, t = 0, n;
|
|
@@ -3886,6 +3930,7 @@ class As {
|
|
|
3886
3930
|
`)
|
|
3887
3931
|
break;
|
|
3888
3932
|
}
|
|
3933
|
+
// fallthrough
|
|
3889
3934
|
default:
|
|
3890
3935
|
break e;
|
|
3891
3936
|
}
|
|
@@ -3927,7 +3972,7 @@ class As {
|
|
|
3927
3972
|
else
|
|
3928
3973
|
break;
|
|
3929
3974
|
} while (!0);
|
|
3930
|
-
return yield
|
|
3975
|
+
return yield Oe, yield* this.pushToIndex(e + 1, !0), yield* this.parseLineStart();
|
|
3931
3976
|
}
|
|
3932
3977
|
*parsePlainScalar() {
|
|
3933
3978
|
const e = this.flowLevel > 0;
|
|
@@ -3935,14 +3980,14 @@ class As {
|
|
|
3935
3980
|
for (; i = this.buffer[++n]; )
|
|
3936
3981
|
if (i === ":") {
|
|
3937
3982
|
const r = this.buffer[n + 1];
|
|
3938
|
-
if (
|
|
3983
|
+
if (D(r) || e && _e.has(r))
|
|
3939
3984
|
break;
|
|
3940
3985
|
t = n;
|
|
3941
|
-
} else if (
|
|
3986
|
+
} else if (D(i)) {
|
|
3942
3987
|
let r = this.buffer[n + 1];
|
|
3943
3988
|
if (i === "\r" && (r === `
|
|
3944
3989
|
` ? (n += 1, i = `
|
|
3945
|
-
`, r = this.buffer[n + 1]) : t = n), r === "#" || e &&
|
|
3990
|
+
`, r = this.buffer[n + 1]) : t = n), r === "#" || e && _e.has(r))
|
|
3946
3991
|
break;
|
|
3947
3992
|
if (i === `
|
|
3948
3993
|
`) {
|
|
@@ -3952,11 +3997,11 @@ class As {
|
|
|
3952
3997
|
n = Math.max(n, o - 2);
|
|
3953
3998
|
}
|
|
3954
3999
|
} else {
|
|
3955
|
-
if (e &&
|
|
4000
|
+
if (e && _e.has(i))
|
|
3956
4001
|
break;
|
|
3957
4002
|
t = n;
|
|
3958
4003
|
}
|
|
3959
|
-
return !i && !this.atEnd ? this.setNext("plain-scalar") : (yield
|
|
4004
|
+
return !i && !this.atEnd ? this.setNext("plain-scalar") : (yield Oe, yield* this.pushToIndex(t + 1, !0), e ? "flow" : "doc");
|
|
3960
4005
|
}
|
|
3961
4006
|
*pushCount(e) {
|
|
3962
4007
|
return e > 0 ? (yield this.buffer.substr(this.pos, e), this.pos += e, e) : 0;
|
|
@@ -3970,12 +4015,14 @@ class As {
|
|
|
3970
4015
|
case "!":
|
|
3971
4016
|
return (yield* this.pushTag()) + (yield* this.pushSpaces(!0)) + (yield* this.pushIndicators());
|
|
3972
4017
|
case "&":
|
|
3973
|
-
return (yield* this.pushUntil(
|
|
4018
|
+
return (yield* this.pushUntil(ot)) + (yield* this.pushSpaces(!0)) + (yield* this.pushIndicators());
|
|
3974
4019
|
case "-":
|
|
4020
|
+
// this is an error
|
|
3975
4021
|
case "?":
|
|
4022
|
+
// this is an error outside flow collections
|
|
3976
4023
|
case ":": {
|
|
3977
4024
|
const e = this.flowLevel > 0, t = this.charAt(1);
|
|
3978
|
-
if (
|
|
4025
|
+
if (D(t) || e && _e.has(t))
|
|
3979
4026
|
return e ? this.flowKey && (this.flowKey = !1) : this.indentNext = this.indentValue + 1, (yield* this.pushCount(1)) + (yield* this.pushSpaces(!0)) + (yield* this.pushIndicators());
|
|
3980
4027
|
}
|
|
3981
4028
|
}
|
|
@@ -3984,15 +4031,15 @@ class As {
|
|
|
3984
4031
|
*pushTag() {
|
|
3985
4032
|
if (this.charAt(1) === "<") {
|
|
3986
4033
|
let e = this.pos + 2, t = this.buffer[e];
|
|
3987
|
-
for (; !
|
|
4034
|
+
for (; !D(t) && t !== ">"; )
|
|
3988
4035
|
t = this.buffer[++e];
|
|
3989
4036
|
return yield* this.pushToIndex(t === ">" ? e + 1 : e, !1);
|
|
3990
4037
|
} else {
|
|
3991
4038
|
let e = this.pos + 1, t = this.buffer[e];
|
|
3992
4039
|
for (; t; )
|
|
3993
|
-
if (
|
|
4040
|
+
if (jn.has(t))
|
|
3994
4041
|
t = this.buffer[++e];
|
|
3995
|
-
else if (t === "%" &&
|
|
4042
|
+
else if (t === "%" && Pt.has(this.buffer[e + 1]) && Pt.has(this.buffer[e + 2]))
|
|
3996
4043
|
t = this.buffer[e += 3];
|
|
3997
4044
|
else
|
|
3998
4045
|
break;
|
|
@@ -4020,7 +4067,7 @@ class As {
|
|
|
4020
4067
|
return yield* this.pushToIndex(t, !1);
|
|
4021
4068
|
}
|
|
4022
4069
|
}
|
|
4023
|
-
class
|
|
4070
|
+
class Ls {
|
|
4024
4071
|
constructor() {
|
|
4025
4072
|
this.lineStarts = [], this.addNewLine = (e) => this.lineStarts.push(e), this.linePos = (e) => {
|
|
4026
4073
|
let t = 0, n = this.lineStarts.length;
|
|
@@ -4037,13 +4084,13 @@ class Es {
|
|
|
4037
4084
|
};
|
|
4038
4085
|
}
|
|
4039
4086
|
}
|
|
4040
|
-
function
|
|
4087
|
+
function W(s, e) {
|
|
4041
4088
|
for (let t = 0; t < s.length; ++t)
|
|
4042
4089
|
if (s[t].type === e)
|
|
4043
4090
|
return !0;
|
|
4044
4091
|
return !1;
|
|
4045
4092
|
}
|
|
4046
|
-
function
|
|
4093
|
+
function jt(s) {
|
|
4047
4094
|
for (let e = 0; e < s.length; ++e)
|
|
4048
4095
|
switch (s[e].type) {
|
|
4049
4096
|
case "space":
|
|
@@ -4055,7 +4102,7 @@ function Pt(s) {
|
|
|
4055
4102
|
}
|
|
4056
4103
|
return -1;
|
|
4057
4104
|
}
|
|
4058
|
-
function
|
|
4105
|
+
function $s(s) {
|
|
4059
4106
|
switch (s == null ? void 0 : s.type) {
|
|
4060
4107
|
case "alias":
|
|
4061
4108
|
case "scalar":
|
|
@@ -4067,7 +4114,7 @@ function Is(s) {
|
|
|
4067
4114
|
return !1;
|
|
4068
4115
|
}
|
|
4069
4116
|
}
|
|
4070
|
-
function
|
|
4117
|
+
function Ce(s) {
|
|
4071
4118
|
switch (s.type) {
|
|
4072
4119
|
case "document":
|
|
4073
4120
|
return s.start;
|
|
@@ -4077,11 +4124,12 @@ function $e(s) {
|
|
|
4077
4124
|
}
|
|
4078
4125
|
case "block-seq":
|
|
4079
4126
|
return s.items[s.items.length - 1].start;
|
|
4127
|
+
/* istanbul ignore next should not happen */
|
|
4080
4128
|
default:
|
|
4081
4129
|
return [];
|
|
4082
4130
|
}
|
|
4083
4131
|
}
|
|
4084
|
-
function
|
|
4132
|
+
function ne(s) {
|
|
4085
4133
|
var t;
|
|
4086
4134
|
if (s.length === 0)
|
|
4087
4135
|
return [];
|
|
@@ -4102,15 +4150,15 @@ function te(s) {
|
|
|
4102
4150
|
function Dt(s) {
|
|
4103
4151
|
if (s.start.type === "flow-seq-start")
|
|
4104
4152
|
for (const e of s.items)
|
|
4105
|
-
e.sep && !e.value && !
|
|
4153
|
+
e.sep && !e.value && !W(e.start, "explicit-key-ind") && !W(e.sep, "map-value-ind") && (e.key && (e.value = e.key), delete e.key, $s(e.value) ? e.value.end ? Array.prototype.push.apply(e.value.end, e.sep) : e.value.end = e.sep : Array.prototype.push.apply(e.start, e.sep), delete e.sep);
|
|
4106
4154
|
}
|
|
4107
|
-
class
|
|
4155
|
+
class Tt {
|
|
4108
4156
|
/**
|
|
4109
4157
|
* @param onNewLine - If defined, called separately with the start position of
|
|
4110
4158
|
* each new line (in `parse()`, including the start of input).
|
|
4111
4159
|
*/
|
|
4112
4160
|
constructor(e) {
|
|
4113
|
-
this.atNewLine = !0, this.atScalar = !1, this.indent = 0, this.offset = 0, this.onKeyLine = !1, this.stack = [], this.source = "", this.type = "", this.lexer = new
|
|
4161
|
+
this.atNewLine = !0, this.atScalar = !1, this.indent = 0, this.offset = 0, this.onKeyLine = !1, this.stack = [], this.source = "", this.type = "", this.lexer = new Ts(), this.onNewLine = e;
|
|
4114
4162
|
}
|
|
4115
4163
|
/**
|
|
4116
4164
|
* Parse `source` as a YAML stream.
|
|
@@ -4134,7 +4182,7 @@ class Et {
|
|
|
4134
4182
|
this.atScalar = !1, yield* this.step(), this.offset += e.length;
|
|
4135
4183
|
return;
|
|
4136
4184
|
}
|
|
4137
|
-
const t =
|
|
4185
|
+
const t = Is(e);
|
|
4138
4186
|
if (t)
|
|
4139
4187
|
if (t === "scalar")
|
|
4140
4188
|
this.atNewLine = !1, this.atScalar = !0, this.type = "scalar";
|
|
@@ -4253,12 +4301,13 @@ class Et {
|
|
|
4253
4301
|
!i || i.value ? n.items.push({ start: [], key: t, sep: [] }) : i.sep ? i.value = t : Object.assign(i, { key: t, sep: [] });
|
|
4254
4302
|
return;
|
|
4255
4303
|
}
|
|
4304
|
+
/* istanbul ignore next should not happen */
|
|
4256
4305
|
default:
|
|
4257
4306
|
yield* this.pop(), yield* this.pop(t);
|
|
4258
4307
|
}
|
|
4259
4308
|
if ((n.type === "document" || n.type === "block-map" || n.type === "block-seq") && (t.type === "block-map" || t.type === "block-seq")) {
|
|
4260
4309
|
const i = t.items[t.items.length - 1];
|
|
4261
|
-
i && !i.sep && !i.value && i.start.length > 0 &&
|
|
4310
|
+
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));
|
|
4262
4311
|
}
|
|
4263
4312
|
}
|
|
4264
4313
|
}
|
|
@@ -4296,7 +4345,7 @@ class Et {
|
|
|
4296
4345
|
return yield* this.lineEnd(e);
|
|
4297
4346
|
switch (this.type) {
|
|
4298
4347
|
case "doc-start": {
|
|
4299
|
-
|
|
4348
|
+
jt(e.start) !== -1 ? (yield* this.pop(), yield* this.step()) : e.start.push(this.sourceToken);
|
|
4300
4349
|
return;
|
|
4301
4350
|
}
|
|
4302
4351
|
case "anchor":
|
|
@@ -4317,7 +4366,7 @@ class Et {
|
|
|
4317
4366
|
}
|
|
4318
4367
|
*scalar(e) {
|
|
4319
4368
|
if (this.type === "map-value-ind") {
|
|
4320
|
-
const t =
|
|
4369
|
+
const t = Ce(this.peek(2)), n = ne(t);
|
|
4321
4370
|
let i;
|
|
4322
4371
|
e.end ? (i = e.end, i.push(this.sourceToken), delete e.end) : i = [this.sourceToken];
|
|
4323
4372
|
const r = {
|
|
@@ -4347,6 +4396,7 @@ class Et {
|
|
|
4347
4396
|
}
|
|
4348
4397
|
yield* this.pop();
|
|
4349
4398
|
break;
|
|
4399
|
+
/* istanbul ignore next should not happen */
|
|
4350
4400
|
default:
|
|
4351
4401
|
yield* this.pop(), yield* this.step();
|
|
4352
4402
|
}
|
|
@@ -4419,15 +4469,15 @@ class Et {
|
|
|
4419
4469
|
if (t.sep)
|
|
4420
4470
|
if (t.value)
|
|
4421
4471
|
e.items.push({ start: [], key: null, sep: [this.sourceToken] });
|
|
4422
|
-
else if (
|
|
4472
|
+
else if (W(t.sep, "map-value-ind"))
|
|
4423
4473
|
this.stack.push({
|
|
4424
4474
|
type: "block-map",
|
|
4425
4475
|
offset: this.offset,
|
|
4426
4476
|
indent: this.indent,
|
|
4427
4477
|
items: [{ start: o, key: null, sep: [this.sourceToken] }]
|
|
4428
4478
|
});
|
|
4429
|
-
else if (
|
|
4430
|
-
const l =
|
|
4479
|
+
else if ($s(t.key) && !W(t.sep, "newline")) {
|
|
4480
|
+
const l = ne(t.start), a = t.key, c = t.sep;
|
|
4431
4481
|
c.push(this.sourceToken), delete t.key, delete t.sep, this.stack.push({
|
|
4432
4482
|
type: "block-map",
|
|
4433
4483
|
offset: this.offset,
|
|
@@ -4435,10 +4485,10 @@ class Et {
|
|
|
4435
4485
|
items: [{ start: l, key: a, sep: c }]
|
|
4436
4486
|
});
|
|
4437
4487
|
} else o.length > 0 ? t.sep = t.sep.concat(o, this.sourceToken) : t.sep.push(this.sourceToken);
|
|
4438
|
-
else if (
|
|
4488
|
+
else if (W(t.start, "newline"))
|
|
4439
4489
|
Object.assign(t, { key: null, sep: [this.sourceToken] });
|
|
4440
4490
|
else {
|
|
4441
|
-
const l =
|
|
4491
|
+
const l = ne(t.start);
|
|
4442
4492
|
this.stack.push({
|
|
4443
4493
|
type: "block-map",
|
|
4444
4494
|
offset: this.offset,
|
|
@@ -4447,7 +4497,7 @@ class Et {
|
|
|
4447
4497
|
});
|
|
4448
4498
|
}
|
|
4449
4499
|
else
|
|
4450
|
-
t.sep ? t.value || r ? e.items.push({ start: o, key: null, sep: [this.sourceToken] }) :
|
|
4500
|
+
t.sep ? t.value || r ? e.items.push({ start: o, key: null, sep: [this.sourceToken] }) : W(t.sep, "map-value-ind") ? this.stack.push({
|
|
4451
4501
|
type: "block-map",
|
|
4452
4502
|
offset: this.offset,
|
|
4453
4503
|
indent: this.indent,
|
|
@@ -4509,7 +4559,7 @@ class Et {
|
|
|
4509
4559
|
case "seq-item-ind":
|
|
4510
4560
|
if (this.indent !== e.indent)
|
|
4511
4561
|
break;
|
|
4512
|
-
t.value ||
|
|
4562
|
+
t.value || W(t.start, "seq-item-ind") ? e.items.push({ start: [this.sourceToken] }) : t.start.push(this.sourceToken);
|
|
4513
4563
|
return;
|
|
4514
4564
|
}
|
|
4515
4565
|
if (this.indent > e.indent) {
|
|
@@ -4564,7 +4614,7 @@ class Et {
|
|
|
4564
4614
|
if (n.type === "block-map" && (this.type === "map-value-ind" && n.indent === e.indent || this.type === "newline" && !n.items[n.items.length - 1].sep))
|
|
4565
4615
|
yield* this.pop(), yield* this.step();
|
|
4566
4616
|
else if (this.type === "map-value-ind" && n.type !== "flow-collection") {
|
|
4567
|
-
const i =
|
|
4617
|
+
const i = Ce(n), r = ne(i);
|
|
4568
4618
|
Dt(e);
|
|
4569
4619
|
const o = e.end.splice(1, e.end.length);
|
|
4570
4620
|
o.push(this.sourceToken);
|
|
@@ -4628,7 +4678,7 @@ class Et {
|
|
|
4628
4678
|
};
|
|
4629
4679
|
case "explicit-key-ind": {
|
|
4630
4680
|
this.onKeyLine = !0;
|
|
4631
|
-
const t =
|
|
4681
|
+
const t = Ce(e), n = ne(t);
|
|
4632
4682
|
return n.push(this.sourceToken), {
|
|
4633
4683
|
type: "block-map",
|
|
4634
4684
|
offset: this.offset,
|
|
@@ -4638,7 +4688,7 @@ class Et {
|
|
|
4638
4688
|
}
|
|
4639
4689
|
case "map-value-ind": {
|
|
4640
4690
|
this.onKeyLine = !0;
|
|
4641
|
-
const t =
|
|
4691
|
+
const t = Ce(e), n = ne(t);
|
|
4642
4692
|
return {
|
|
4643
4693
|
type: "block-map",
|
|
4644
4694
|
offset: this.offset,
|
|
@@ -4667,6 +4717,7 @@ class Et {
|
|
|
4667
4717
|
break;
|
|
4668
4718
|
case "newline":
|
|
4669
4719
|
this.onKeyLine = !1;
|
|
4720
|
+
// fallthrough
|
|
4670
4721
|
case "space":
|
|
4671
4722
|
case "comment":
|
|
4672
4723
|
default:
|
|
@@ -4674,43 +4725,43 @@ class Et {
|
|
|
4674
4725
|
}
|
|
4675
4726
|
}
|
|
4676
4727
|
}
|
|
4677
|
-
function
|
|
4728
|
+
function _s(s) {
|
|
4678
4729
|
const e = s.prettyErrors !== !1;
|
|
4679
|
-
return { lineCounter: s.lineCounter || e && new
|
|
4730
|
+
return { lineCounter: s.lineCounter || e && new Ls() || null, prettyErrors: e };
|
|
4680
4731
|
}
|
|
4681
|
-
function
|
|
4682
|
-
const { lineCounter: t, prettyErrors: n } =
|
|
4732
|
+
function qn(s, e = {}) {
|
|
4733
|
+
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)));
|
|
4683
4734
|
if (n && t)
|
|
4684
4735
|
for (const l of o)
|
|
4685
4736
|
l.errors.forEach(De(s, t)), l.warnings.forEach(De(s, t));
|
|
4686
4737
|
return o.length > 0 ? o : Object.assign([], { empty: !0 }, r.streamInfo());
|
|
4687
4738
|
}
|
|
4688
|
-
function
|
|
4689
|
-
const { lineCounter: t, prettyErrors: n } =
|
|
4739
|
+
function Cs(s, e = {}) {
|
|
4740
|
+
const { lineCounter: t, prettyErrors: n } = _s(e), i = new Tt(t == null ? void 0 : t.addNewLine), r = new It(e);
|
|
4690
4741
|
let o = null;
|
|
4691
4742
|
for (const l of r.compose(i.parse(s), !0, s.length))
|
|
4692
4743
|
if (!o)
|
|
4693
4744
|
o = l;
|
|
4694
4745
|
else if (o.options.logLevel !== "silent") {
|
|
4695
|
-
o.errors.push(new
|
|
4746
|
+
o.errors.push(new z(l.range.slice(0, 2), "MULTIPLE_DOCS", "Source contains multiple documents; please use YAML.parseAllDocuments()"));
|
|
4696
4747
|
break;
|
|
4697
4748
|
}
|
|
4698
4749
|
return n && t && (o.errors.forEach(De(s, t)), o.warnings.forEach(De(s, t))), o;
|
|
4699
4750
|
}
|
|
4700
|
-
function
|
|
4751
|
+
function Fn(s, e, t) {
|
|
4701
4752
|
let n;
|
|
4702
4753
|
typeof e == "function" ? n = e : t === void 0 && e && typeof e == "object" && (t = e);
|
|
4703
|
-
const i =
|
|
4754
|
+
const i = Cs(s, t);
|
|
4704
4755
|
if (!i)
|
|
4705
4756
|
return null;
|
|
4706
|
-
if (i.warnings.forEach((r) =>
|
|
4757
|
+
if (i.warnings.forEach((r) => zt(i.options.logLevel, r)), i.errors.length > 0) {
|
|
4707
4758
|
if (i.options.logLevel !== "silent")
|
|
4708
4759
|
throw i.errors[0];
|
|
4709
4760
|
i.errors = [];
|
|
4710
4761
|
}
|
|
4711
4762
|
return i.toJS(Object.assign({ reviver: n }, t));
|
|
4712
4763
|
}
|
|
4713
|
-
function
|
|
4764
|
+
function Rn(s, e, t) {
|
|
4714
4765
|
let n = null;
|
|
4715
4766
|
if (typeof e == "function" || Array.isArray(e) ? n = e : t === void 0 && e && (t = e), typeof t == "string" && (t = t.length), typeof t == "number") {
|
|
4716
4767
|
const i = Math.round(t);
|
|
@@ -4721,70 +4772,70 @@ function Kn(s, e, t) {
|
|
|
4721
4772
|
if (!i)
|
|
4722
4773
|
return;
|
|
4723
4774
|
}
|
|
4724
|
-
return new
|
|
4775
|
+
return ee(s) && !n ? s.toString(t) : new ge(s, n, t).toString(t);
|
|
4725
4776
|
}
|
|
4726
|
-
|
|
4777
|
+
const Un = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4727
4778
|
__proto__: null,
|
|
4728
|
-
Alias:
|
|
4729
|
-
CST:
|
|
4730
|
-
Composer:
|
|
4731
|
-
Document:
|
|
4732
|
-
Lexer:
|
|
4733
|
-
LineCounter:
|
|
4779
|
+
Alias: Re,
|
|
4780
|
+
CST: Pn,
|
|
4781
|
+
Composer: It,
|
|
4782
|
+
Document: ge,
|
|
4783
|
+
Lexer: Ts,
|
|
4784
|
+
LineCounter: Ls,
|
|
4734
4785
|
Pair: v,
|
|
4735
|
-
Parser:
|
|
4736
|
-
Scalar:
|
|
4737
|
-
Schema:
|
|
4738
|
-
YAMLError:
|
|
4739
|
-
YAMLMap:
|
|
4740
|
-
YAMLParseError:
|
|
4741
|
-
YAMLSeq:
|
|
4742
|
-
YAMLWarning:
|
|
4743
|
-
isAlias:
|
|
4786
|
+
Parser: Tt,
|
|
4787
|
+
Scalar: A,
|
|
4788
|
+
Schema: Xe,
|
|
4789
|
+
YAMLError: At,
|
|
4790
|
+
YAMLMap: K,
|
|
4791
|
+
YAMLParseError: z,
|
|
4792
|
+
YAMLSeq: Q,
|
|
4793
|
+
YAMLWarning: ys,
|
|
4794
|
+
isAlias: x,
|
|
4744
4795
|
isCollection: L,
|
|
4745
|
-
isDocument:
|
|
4746
|
-
isMap:
|
|
4796
|
+
isDocument: ee,
|
|
4797
|
+
isMap: de,
|
|
4747
4798
|
isNode: $,
|
|
4748
|
-
isPair:
|
|
4799
|
+
isPair: T,
|
|
4749
4800
|
isScalar: E,
|
|
4750
|
-
isSeq:
|
|
4751
|
-
parse:
|
|
4752
|
-
parseAllDocuments:
|
|
4753
|
-
parseDocument:
|
|
4754
|
-
stringify:
|
|
4755
|
-
visit:
|
|
4756
|
-
visitAsync:
|
|
4757
|
-
});
|
|
4801
|
+
isSeq: pe,
|
|
4802
|
+
parse: Fn,
|
|
4803
|
+
parseAllDocuments: qn,
|
|
4804
|
+
parseDocument: Cs,
|
|
4805
|
+
stringify: Rn,
|
|
4806
|
+
visit: G,
|
|
4807
|
+
visitAsync: Fe
|
|
4808
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
4758
4809
|
export {
|
|
4759
|
-
|
|
4760
|
-
|
|
4761
|
-
|
|
4762
|
-
|
|
4763
|
-
|
|
4764
|
-
|
|
4810
|
+
Re as Alias,
|
|
4811
|
+
Pn as CST,
|
|
4812
|
+
It as Composer,
|
|
4813
|
+
ge as Document,
|
|
4814
|
+
Ts as Lexer,
|
|
4815
|
+
Ls as LineCounter,
|
|
4765
4816
|
v as Pair,
|
|
4766
|
-
|
|
4767
|
-
|
|
4768
|
-
|
|
4769
|
-
|
|
4770
|
-
|
|
4771
|
-
|
|
4772
|
-
|
|
4773
|
-
|
|
4774
|
-
|
|
4775
|
-
|
|
4817
|
+
Tt as Parser,
|
|
4818
|
+
A as Scalar,
|
|
4819
|
+
Xe as Schema,
|
|
4820
|
+
At as YAMLError,
|
|
4821
|
+
K as YAMLMap,
|
|
4822
|
+
z as YAMLParseError,
|
|
4823
|
+
Q as YAMLSeq,
|
|
4824
|
+
ys as YAMLWarning,
|
|
4825
|
+
Un as default,
|
|
4826
|
+
x as isAlias,
|
|
4776
4827
|
L as isCollection,
|
|
4777
|
-
|
|
4778
|
-
|
|
4828
|
+
ee as isDocument,
|
|
4829
|
+
de as isMap,
|
|
4779
4830
|
$ as isNode,
|
|
4780
|
-
|
|
4831
|
+
T as isPair,
|
|
4781
4832
|
E as isScalar,
|
|
4782
|
-
|
|
4783
|
-
|
|
4784
|
-
|
|
4785
|
-
|
|
4786
|
-
|
|
4787
|
-
|
|
4788
|
-
|
|
4833
|
+
pe as isSeq,
|
|
4834
|
+
Fn as parse,
|
|
4835
|
+
qn as parseAllDocuments,
|
|
4836
|
+
Cs as parseDocument,
|
|
4837
|
+
Rn as stringify,
|
|
4838
|
+
G as visit,
|
|
4839
|
+
Fe as visitAsync
|
|
4789
4840
|
};
|
|
4790
|
-
//# sourceMappingURL=index-
|
|
4841
|
+
//# sourceMappingURL=index-CBXSgjaE.js.map
|