stacks 0.56.24 → 0.58.18
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/buddy +2 -0
- package/core/.env +38 -0
- package/core/.simple-git-hooks.js +3 -0
- package/core/Caddyfile +23 -0
- package/core/README.md +415 -0
- package/core/buddy +2 -0
- package/core/env.ts +42 -0
- package/core/playwright.config.ts +109 -0
- package/core/scripts/build +84 -0
- package/core/scripts/ensure +33 -0
- package/core/scripts/fresh +14 -0
- package/core/scripts/link +14 -0
- package/core/scripts/move-built-src-files.ts +28 -0
- package/core/scripts/move-dts-files.ts +35 -0
- package/core/scripts/publish +37 -0
- package/core/scripts/setup +176 -0
- package/core/src/actions/README.md +58 -0
- package/core/src/actions/build.ts +5 -0
- package/core/src/actions/dist/src/add.js +29 -0
- package/core/src/actions/dist/src/build/component-libs.js +6 -0
- package/core/src/actions/dist/src/build/core.js +25 -0
- package/core/src/actions/dist/src/build/stacks.js +8 -0
- package/core/src/actions/dist/src/build.js +226 -0
- package/core/src/actions/dist/src/bump.js +8 -0
- package/core/src/actions/dist/src/changelog.js +9 -0
- package/core/src/actions/dist/src/clean.js +6 -0
- package/core/src/actions/dist/src/commit.js +17 -0
- package/core/src/actions/dist/src/copy-types.js +14 -0
- package/core/src/actions/dist/src/database/seed.js +4 -0
- package/core/src/actions/dist/src/deploy/index.js +31 -0
- package/core/src/actions/dist/src/dev/components.js +11 -0
- package/core/src/actions/dist/src/dev/docs.js +7 -0
- package/core/src/actions/dist/src/dev/index.js +90 -0
- package/core/src/actions/dist/src/examples.js +43 -0
- package/core/src/actions/dist/src/fresh.js +18 -0
- package/core/src/actions/dist/src/generate/component-meta.js +57 -0
- package/core/src/actions/dist/src/generate/ide-helpers.js +83 -0
- package/core/src/actions/dist/src/generate/index.js +161 -0
- package/core/src/actions/dist/src/generate/lib-entries.js +168 -0
- package/core/src/actions/dist/src/generate/vscode-custom-data.js +82 -0
- package/core/src/actions/dist/src/generate/vue-compat.js +18 -0
- package/core/src/actions/dist/src/helpers/component-meta.js +50 -0
- package/core/src/actions/dist/src/helpers/index.js +56 -0
- package/core/src/actions/dist/src/helpers/lib-entries.js +160 -0
- package/core/src/actions/dist/src/helpers/package-json.js +135 -0
- package/core/src/actions/dist/src/helpers/utils.js +56 -0
- package/core/src/actions/dist/src/helpers/vscode-custom-data.js +75 -0
- package/core/src/actions/dist/src/helpers/vue-compat.js +16 -0
- package/core/src/actions/dist/src/index.js +577 -0
- package/core/src/actions/dist/src/key-generate.js +10 -0
- package/core/src/actions/dist/src/lint/fix.js +8 -0
- package/core/src/actions/dist/src/lint/index.js +21 -0
- package/core/src/actions/dist/src/make.js +291 -0
- package/core/src/actions/dist/src/prepublish.js +14 -0
- package/core/src/actions/dist/src/release.js +545 -0
- package/core/src/actions/dist/src/test/coverage.js +6 -0
- package/core/src/actions/dist/src/test/feature.js +6 -0
- package/core/src/actions/dist/src/test/ui.js +6 -0
- package/core/src/actions/dist/src/test/unit.js +6 -0
- package/core/src/actions/dist/src/test.js +6 -0
- package/core/src/actions/dist/src/tinker.js +5 -0
- package/core/src/actions/dist/src/typecheck.js +6 -0
- package/core/src/actions/dist/src/types.js +21 -0
- package/core/src/actions/dist/src/upgrade/dependencies.js +6 -0
- package/core/src/actions/dist/src/upgrade/framework.js +1 -0
- package/core/src/actions/dist/src/upgrade/index.js +1 -0
- package/core/src/actions/dist/src/upgrade.js +39 -0
- package/core/src/actions/package.json +89 -0
- package/core/src/actions/src/action.ts +11 -0
- package/core/src/actions/src/actions.ts +2 -0
- package/core/src/actions/src/add.ts +27 -0
- package/core/src/actions/src/ai/request-model-access.ts +74 -0
- package/core/src/actions/src/build/component-libs.ts +5 -0
- package/core/src/actions/src/build/core.ts +66 -0
- package/core/src/actions/src/build/desktop.ts +7 -0
- package/core/src/actions/src/build/stacks.ts +7 -0
- package/core/src/actions/src/build.ts +89 -0
- package/core/src/actions/src/bump.ts +11 -0
- package/core/src/actions/src/cdn/invalidate-cache.ts +27 -0
- package/core/src/actions/src/changelog.ts +11 -0
- package/core/src/actions/src/clean.ts +6 -0
- package/core/src/actions/src/commit.ts +14 -0
- package/core/src/actions/src/copy-types.ts +22 -0
- package/core/src/actions/src/database/fields.ts +111 -0
- package/core/src/actions/src/database/migration-mysql.ts +72 -0
- package/core/src/actions/src/database/migration-sqlite.ts +67 -0
- package/core/src/actions/src/database/migration.ts +10 -0
- package/core/src/actions/src/database/mydb.sqlite +0 -0
- package/core/src/actions/src/database/seed.ts +4 -0
- package/core/src/actions/src/database/stacks.sqlite +0 -0
- package/core/src/actions/src/database/user-migration.ts +20 -0
- package/core/src/actions/src/deploy/create-receipt-rule.ts +55 -0
- package/core/src/actions/src/deploy/index.ts +46 -0
- package/core/src/actions/src/dev/api.ts +19 -0
- package/core/src/actions/src/dev/components.ts +14 -0
- package/core/src/actions/src/dev/desktop.ts +7 -0
- package/core/src/actions/src/dev/docs.ts +7 -0
- package/core/src/actions/src/dev/index.ts +38 -0
- package/core/src/actions/src/dev/views.ts +7 -0
- package/core/src/actions/src/domains/add.ts +82 -0
- package/core/src/actions/src/domains/purchase.ts +76 -0
- package/core/src/actions/src/domains/remove.ts +38 -0
- package/core/src/actions/src/examples.ts +46 -0
- package/core/src/actions/src/fresh.ts +20 -0
- package/core/src/actions/src/generate/caddyfile.ts +1 -0
- package/core/src/actions/src/generate/component-meta.ts +15 -0
- package/core/src/actions/src/generate/env-files.ts +89 -0
- package/core/src/actions/src/generate/ide-helpers.ts +20 -0
- package/core/src/actions/src/generate/index.ts +141 -0
- package/core/src/actions/src/generate/lib-entries.ts +17 -0
- package/core/src/actions/src/generate/model-classes.ts +299 -0
- package/core/src/actions/src/generate/model-generate.ts +12 -0
- package/core/src/actions/src/generate/pkgx-file.ts +72 -0
- package/core/src/actions/src/generate/vscode-custom-data.ts +16 -0
- package/core/src/actions/src/generate/vue-compat.ts +10 -0
- package/core/src/actions/src/helpers/component-meta.ts +93 -0
- package/core/src/actions/src/helpers/index.ts +1 -0
- package/core/src/actions/src/helpers/lib-entries.ts +139 -0
- package/core/src/actions/src/helpers/package-json.ts +96 -0
- package/core/src/actions/src/helpers/utils.ts +82 -0
- package/core/src/actions/src/helpers/vscode-custom-data.ts +28 -0
- package/core/src/actions/src/helpers/vue-compat.ts +16 -0
- package/core/src/actions/src/index.ts +29 -0
- package/core/src/actions/src/key-generate.ts +10 -0
- package/core/src/actions/src/lint/fix.ts +7 -0
- package/core/src/actions/src/lint/index.ts +19 -0
- package/core/src/actions/src/make.ts +322 -0
- package/core/src/actions/src/migrate/database.ts +1 -0
- package/core/src/actions/src/migrate/dns.ts +3 -0
- package/core/src/actions/src/prepublish.ts +17 -0
- package/core/src/actions/src/release.ts +15 -0
- package/core/src/actions/src/start-caddy.ts +13 -0
- package/core/src/actions/src/test/coverage.ts +5 -0
- package/core/src/actions/src/test/feature.ts +5 -0
- package/core/src/actions/src/test/ui.ts +5 -0
- package/core/src/actions/src/test/unit.ts +5 -0
- package/core/src/actions/src/test.ts +5 -0
- package/core/src/actions/src/tinker.ts +10 -0
- package/core/src/actions/src/typecheck.ts +5 -0
- package/core/src/actions/src/types.ts +20 -0
- package/core/src/actions/src/upgrade/bun.ts +4 -0
- package/core/src/actions/src/upgrade/framework.ts +30 -0
- package/core/src/actions/src/upgrade/index.ts +25 -0
- package/core/src/actions/src/upgrade.ts +65 -0
- package/core/src/actions/src/zip/api.ts +22 -0
- package/core/src/actions/tests/example.test.ts +5 -0
- package/core/src/ai/README.md +67 -0
- package/core/src/ai/build.ts +9 -0
- package/core/src/ai/package.json +59 -0
- package/core/src/ai/src/index.ts +8 -0
- package/core/src/ai/src/text-generation.ts +0 -0
- package/core/src/ai/src/text-summary.ts +0 -0
- package/core/src/ai/src/utils/client-bedrock-runtime.ts +38 -0
- package/core/src/ai/src/utils/client-bedrock.ts +53 -0
- package/core/src/ai/tests/example.test.ts +5 -0
- package/core/src/alias/README.md +53 -0
- package/core/src/alias/build.ts +8 -0
- package/core/src/alias/dist/index.js +218 -0
- package/core/src/alias/package.json +51 -0
- package/core/src/alias/src/index.ts +220 -0
- package/core/src/alias/tests/example.test.ts +5 -0
- package/core/src/analytics/README.md +55 -0
- package/core/src/analytics/build.ts +8 -0
- package/core/src/analytics/dist/index.js +5 -0
- package/core/src/analytics/package.json +54 -0
- package/core/src/analytics/src/drivers/fathom.ts +1 -0
- package/core/src/analytics/src/drivers/index.ts +1 -0
- package/core/src/analytics/src/index.ts +1 -0
- package/core/src/analytics/tests/example.test.ts +5 -0
- package/core/src/api/build.ts +7 -0
- package/core/src/api/package.json +61 -0
- package/core/src/api/src/index.ts +114 -0
- package/core/src/arrays/README.md +59 -0
- package/core/src/arrays/build.ts +8 -0
- package/core/src/arrays/dist/index.js +469 -0
- package/core/src/arrays/package.json +59 -0
- package/core/src/arrays/src/arr.ts +3 -0
- package/core/src/arrays/src/contains.ts +87 -0
- package/core/src/arrays/src/helpers.ts +272 -0
- package/core/src/arrays/src/index.ts +3 -0
- package/core/src/arrays/src/macro.ts +131 -0
- package/core/src/arrays/src/math.ts +220 -0
- package/core/src/arrays/tests/example.test.ts +5 -0
- package/core/src/auth/README.md +59 -0
- package/core/src/auth/build.ts +8 -0
- package/core/src/auth/dist/index.js +5 -0
- package/core/src/auth/package.json +50 -0
- package/core/src/auth/tests/example.test.ts +5 -0
- package/core/src/bud +2 -0
- package/core/src/buddy/README.md +390 -0
- package/core/src/buddy/art/social.jpg +0 -0
- package/core/src/buddy/build.ts +8 -0
- package/core/src/buddy/dist/chunk-815e657d8c6ba584.js +1677 -0
- package/core/src/buddy/dist/chunk-b75e6db0012faa55.js +22 -0
- package/core/src/buddy/dist/cli.js +49 -0
- package/core/src/buddy/dist/index.js +70 -0
- package/core/src/buddy/package.json +174 -0
- package/core/src/buddy/src/cli.ts +51 -0
- package/core/src/buddy/src/commands/add.ts +65 -0
- package/core/src/buddy/src/commands/build.ts +172 -0
- package/core/src/buddy/src/commands/changelog.ts +36 -0
- package/core/src/buddy/src/commands/clean.ts +34 -0
- package/core/src/buddy/src/commands/cloud.ts +299 -0
- package/core/src/buddy/src/commands/commit.ts +22 -0
- package/core/src/buddy/src/commands/configure.ts +65 -0
- package/core/src/buddy/src/commands/create.ts +131 -0
- package/core/src/buddy/src/commands/deploy.ts +99 -0
- package/core/src/buddy/src/commands/dev.ts +228 -0
- package/core/src/buddy/src/commands/dns.ts +78 -0
- package/core/src/buddy/src/commands/domains.ts +156 -0
- package/core/src/buddy/src/commands/example.ts +62 -0
- package/core/src/buddy/src/commands/fresh.ts +34 -0
- package/core/src/buddy/src/commands/generate.ts +142 -0
- package/core/src/buddy/src/commands/http.ts +53 -0
- package/core/src/buddy/src/commands/index.ts +30 -0
- package/core/src/buddy/src/commands/inspire.ts +24 -0
- package/core/src/buddy/src/commands/install.ts +26 -0
- package/core/src/buddy/src/commands/key.ts +32 -0
- package/core/src/buddy/src/commands/lint.ts +49 -0
- package/core/src/buddy/src/commands/make.ts +259 -0
- package/core/src/buddy/src/commands/migrate.ts +55 -0
- package/core/src/buddy/src/commands/prepublish.ts +23 -0
- package/core/src/buddy/src/commands/release.ts +33 -0
- package/core/src/buddy/src/commands/seed.ts +36 -0
- package/core/src/buddy/src/commands/setup.ts +116 -0
- package/core/src/buddy/src/commands/test.ts +122 -0
- package/core/src/buddy/src/commands/tinker.ts +34 -0
- package/core/src/buddy/src/commands/types.ts +30 -0
- package/core/src/buddy/src/commands/upgrade.ts +109 -0
- package/core/src/buddy/src/commands/version.ts +24 -0
- package/core/src/buddy/src/compile.ts +9 -0
- package/core/src/build/README.md +59 -0
- package/core/src/build/build.ts +8 -0
- package/core/src/build/dist/index.js +19 -0
- package/core/src/build/package.json +63 -0
- package/core/src/build/src/index.ts +11 -0
- package/core/src/build/tests/example.test.ts +5 -0
- package/core/src/build/web-types.ts +15 -0
- package/core/src/bun-create/bud/README.md +45 -0
- package/core/src/bun-create/bud/package.json +152 -0
- package/core/src/bun-create/buddy/README.md +45 -0
- package/core/src/bun-create/buddy/package.json +152 -0
- package/core/src/bun-create/stack/README.md +45 -0
- package/core/src/bun-create/stack/package.json +152 -0
- package/core/src/bun-create/stacks/README.md +45 -0
- package/core/src/bun-create/stacks/package.json +152 -0
- package/core/src/bun-create/stx/README.md +45 -0
- package/core/src/bun-create/stx/package.json +152 -0
- package/core/src/bun-plugin-yaml/README.md +56 -0
- package/core/src/bun-plugin-yaml/build.ts +8 -0
- package/core/src/bun-plugin-yaml/dist/index.js +2781 -0
- package/core/src/bun-plugin-yaml/package.json +57 -0
- package/core/src/bun-plugin-yaml/src/index.ts +22 -0
- package/core/src/bun-plugin-yaml/tests/example.test.ts +5 -0
- package/core/src/cache/README.md +59 -0
- package/core/src/cache/build.ts +8 -0
- package/core/src/cache/dist/index.js +88 -0
- package/core/src/cache/package.json +65 -0
- package/core/src/cache/src/drivers/index.ts +2 -0
- package/core/src/cache/src/drivers/redis.ts +37 -0
- package/core/src/cache/src/index.ts +1 -0
- package/core/src/cache/tests/DynamoDB.test.ts +135 -0
- package/core/src/cache/tests/Memcached.test.ts +51 -0
- package/core/src/cache/tests/Redis.test.ts +84 -0
- package/core/src/chat/README.md +83 -0
- package/core/src/chat/build.ts +8 -0
- package/core/src/chat/dist/index.js +42 -0
- package/core/src/chat/package.json +73 -0
- package/core/src/chat/tests/example.test.ts +5 -0
- package/core/src/cli/README.md +168 -0
- package/core/src/cli/build.ts +8 -0
- package/core/src/cli/dist/index.js +372 -0
- package/core/src/cli/package.json +90 -0
- package/core/src/cli/src/actions/install.ts +40 -0
- package/core/src/cli/src/cli.ts +52 -0
- package/core/src/cli/src/command.ts +47 -0
- package/core/src/cli/src/console.ts +79 -0
- package/core/src/cli/src/exec.ts +89 -0
- package/core/src/cli/src/helpers.ts +90 -0
- package/core/src/cli/src/index.ts +10 -0
- package/core/src/cli/src/parse.ts +101 -0
- package/core/src/cli/src/run.ts +97 -0
- package/core/src/cli/src/utilities.ts +2 -0
- package/core/src/cli/tests/example.test.ts +5 -0
- package/core/src/cloud/README.md +67 -0
- package/core/src/cloud/build-server.ts +8 -0
- package/core/src/cloud/build.ts +8 -0
- package/core/src/cloud/cdk.json +62 -0
- package/core/src/cloud/deploy.ts +75 -0
- package/core/src/cloud/dist/origin-request.js +27 -0
- package/core/src/cloud/package.json +119 -0
- package/core/src/cloud/src/cloud/ai.ts +115 -0
- package/core/src/cloud/src/cloud/aws-sdk-layer/nodejs/package-lock.json +386 -0
- package/core/src/cloud/src/cloud/aws-sdk-layer/nodejs/package.json +15 -0
- package/core/src/cloud/src/cloud/cache.ts +0 -0
- package/core/src/cloud/src/cloud/cdn.ts +335 -0
- package/core/src/cloud/src/cloud/compute.ts +79 -0
- package/core/src/cloud/src/cloud/dashboard.ts +85 -0
- package/core/src/cloud/src/cloud/database.ts +0 -0
- package/core/src/cloud/src/cloud/deployment.ts +41 -0
- package/core/src/cloud/src/cloud/dns.ts +34 -0
- package/core/src/cloud/src/cloud/docs.ts +51 -0
- package/core/src/cloud/src/cloud/email.ts +339 -0
- package/core/src/cloud/src/cloud/file-system.ts +35 -0
- package/core/src/cloud/src/cloud/index.ts +93 -0
- package/core/src/cloud/src/cloud/jump-box.ts +48 -0
- package/core/src/cloud/src/cloud/lambda/ask/index.js +35 -0
- package/core/src/cloud/src/cloud/lambda/summarize/index.js +35 -0
- package/core/src/cloud/src/cloud/network.ts +52 -0
- package/core/src/cloud/src/cloud/permissions.ts +33 -0
- package/core/src/cloud/src/cloud/queue.ts +0 -0
- package/core/src/cloud/src/cloud/redirects.ts +45 -0
- package/core/src/cloud/src/cloud/search-engine.ts +108 -0
- package/core/src/cloud/src/cloud/security.ts +259 -0
- package/core/src/cloud/src/cloud/storage.ts +168 -0
- package/core/src/cloud/src/edge/origin-request.ts +49 -0
- package/core/src/cloud/src/helpers.ts +597 -0
- package/core/src/cloud/src/index.ts +2 -0
- package/core/src/cloud/src/runtime/README.md +116 -0
- package/core/src/cloud/src/runtime/bootstrap +3 -0
- package/core/src/cloud/src/runtime/example/lambda.ts +36 -0
- package/core/src/cloud/src/runtime/runtime.ts +829 -0
- package/core/src/cloud/src/runtime/scripts/build-layer.ts +104 -0
- package/core/src/cloud/src/runtime/scripts/publish-layer.ts +110 -0
- package/core/src/cloud/src/runtime/server.ts +39 -0
- package/core/src/cloud/src/server/.dockerignore +15 -0
- package/core/src/cloud/src/server/Dockerfile +20 -0
- package/core/src/cloud/src/server/index.ts +39 -0
- package/core/src/cloud/src/server/package.json +12 -0
- package/core/src/cloud/src/server/runtime.ts +828 -0
- package/core/src/cloud/src/types.ts +28 -0
- package/core/src/cloud/tests/example.test.ts +5 -0
- package/core/src/cloud/zip.ts +8 -0
- package/core/src/collections/README.md +71 -0
- package/core/src/collections/build.ts +8 -0
- package/core/src/collections/dist/index.js +6 -0
- package/core/src/collections/package.json +57 -0
- package/core/src/collections/tests/example.test.ts +5 -0
- package/core/src/config/README.md +71 -0
- package/core/src/config/build.ts +8 -0
- package/core/src/config/dist/index.js +1670 -0
- package/core/src/config/package.json +55 -0
- package/core/src/config/src/config.ts +38 -0
- package/core/src/config/src/defaults.ts +460 -0
- package/core/src/config/src/helpers.ts +256 -0
- package/core/src/config/src/index.ts +2 -0
- package/core/src/config/src/overrides.ts +49 -0
- package/core/src/config/tests/example.test.ts +5 -0
- package/core/src/database/README.md +59 -0
- package/core/src/database/build.ts +8 -0
- package/core/src/database/dist/index.js +200 -0
- package/core/src/database/package.json +78 -0
- package/core/src/database/src/index.ts +63 -0
- package/core/src/database/src/kysely-bun-worker/driver.ts +143 -0
- package/core/src/database/src/kysely-bun-worker/index.ts +46 -0
- package/core/src/database/src/kysely-bun-worker/mitt.ts +24 -0
- package/core/src/database/src/kysely-bun-worker/type.ts +40 -0
- package/core/src/database/src/kysely-bun-worker/worker.ts +53 -0
- package/core/src/database/src/migrations/index.ts +73 -0
- package/core/src/database/src/seeder/index.ts +79 -0
- package/core/src/database/tests/example.test.ts +5 -0
- package/core/src/datetime/README.md +66 -0
- package/core/src/datetime/build.ts +8 -0
- package/core/src/datetime/dist/index.js +9 -0
- package/core/src/datetime/package.json +56 -0
- package/core/src/datetime/tests/example.test.ts +5 -0
- package/core/src/desktop/README.md +49 -0
- package/core/src/desktop/build.ts +8 -0
- package/core/src/desktop/dist/index.js +3075 -0
- package/core/src/desktop/package.json +84 -0
- package/core/src/desktop/src/index.ts +41 -0
- package/core/src/desktop/tests/example.test.ts +5 -0
- package/core/src/development/README.md +27 -0
- package/core/src/development/build.ts +8 -0
- package/core/src/development/dist/index.js +6 -0
- package/core/src/development/package.json +77 -0
- package/core/src/development/src/index.ts +0 -0
- package/core/src/development/tests/example.test.ts +5 -0
- package/core/src/dns/README.md +56 -0
- package/core/src/dns/build.ts +8 -0
- package/core/src/dns/dist/index.js +166 -0
- package/core/src/dns/package.json +76 -0
- package/core/src/dns/src/drivers/aws.ts +224 -0
- package/core/src/dns/src/index.ts +20 -0
- package/core/src/dns/tests/example.test.ts +5 -0
- package/core/src/docs/README.md +59 -0
- package/core/src/docs/build.ts +8 -0
- package/core/src/docs/dist/index.js +214608 -0
- package/core/src/docs/package.json +68 -0
- package/core/src/docs/src/index.ts +61 -0
- package/core/src/docs/src/plugins.ts +4 -0
- package/core/src/docs/tests/example.test.ts +5 -0
- package/core/src/email/README.md +155 -0
- package/core/src/email/build-inbound.ts +8 -0
- package/core/src/email/build.ts +8 -0
- package/core/src/email/dist/index.js +325 -0
- package/core/src/email/email-forwarder.cjs +406 -0
- package/core/src/email/email-forwarder.zip +0 -0
- package/core/src/email/package.json +94 -0
- package/core/src/email/src/drivers/emailjs.ts +23 -0
- package/core/src/email/src/drivers/index.ts +9 -0
- package/core/src/email/src/drivers/mailgun.ts +21 -0
- package/core/src/email/src/drivers/mailjet.ts +21 -0
- package/core/src/email/src/drivers/mandrill.ts +19 -0
- package/core/src/email/src/drivers/netcore.ts +19 -0
- package/core/src/email/src/drivers/nodemailer.ts +23 -0
- package/core/src/email/src/drivers/postmark.ts +19 -0
- package/core/src/email/src/drivers/sendgrid.ts +20 -0
- package/core/src/email/src/drivers/ses.ts +22 -0
- package/core/src/email/src/index.ts +1 -0
- package/core/src/email/src/send.ts +37 -0
- package/core/src/email/src/server/converter.ts +304 -0
- package/core/src/email/src/server/inbound.ts +389 -0
- package/core/src/email/src/server/outbound.ts +294 -0
- package/core/src/email/tests/example.test.ts +5 -0
- package/core/src/enums/README.md +54 -0
- package/core/src/enums/build.ts +8 -0
- package/core/src/enums/dist/index.js +98 -0
- package/core/src/enums/package.json +50 -0
- package/core/src/enums/src/index.ts +95 -0
- package/core/src/enums/tests/example.test.ts +5 -0
- package/core/src/env/README.md +71 -0
- package/core/src/env/build.ts +8 -0
- package/core/src/env/dist/index.js +221 -0
- package/core/src/env/package.json +55 -0
- package/core/src/env/src/index.ts +76 -0
- package/core/src/env/src/types.ts +54 -0
- package/core/src/env/tests/example.test.ts +5 -0
- package/core/src/error-handling/README.md +131 -0
- package/core/src/error-handling/build.ts +8 -0
- package/core/src/error-handling/dist/index.js +432 -0
- package/core/src/error-handling/package.json +62 -0
- package/core/src/error-handling/src/handler.ts +51 -0
- package/core/src/error-handling/src/index.ts +2 -0
- package/core/src/error-handling/tests/example.test.ts +5 -0
- package/core/src/eslint-config/.gitattributes +2 -0
- package/core/src/eslint-config/README.md +587 -0
- package/core/src/eslint-config/build.ts +8 -0
- package/core/src/eslint-config/package.json +119 -0
- package/core/src/eslint-config/src/configs/comments.ts +19 -0
- package/core/src/eslint-config/src/configs/formatters.ts +187 -0
- package/core/src/eslint-config/src/configs/ignores.ts +10 -0
- package/core/src/eslint-config/src/configs/imports.ts +37 -0
- package/core/src/eslint-config/src/configs/index.ts +21 -0
- package/core/src/eslint-config/src/configs/javascript.ts +226 -0
- package/core/src/eslint-config/src/configs/jsdoc.ts +42 -0
- package/core/src/eslint-config/src/configs/jsonc.ts +86 -0
- package/core/src/eslint-config/src/configs/markdown.ts +110 -0
- package/core/src/eslint-config/src/configs/node.ts +23 -0
- package/core/src/eslint-config/src/configs/perfectionist.ts +18 -0
- package/core/src/eslint-config/src/configs/react.ts +111 -0
- package/core/src/eslint-config/src/configs/sort.ts +223 -0
- package/core/src/eslint-config/src/configs/stylistic.ts +57 -0
- package/core/src/eslint-config/src/configs/svelte.ts +106 -0
- package/core/src/eslint-config/src/configs/test.ts +54 -0
- package/core/src/eslint-config/src/configs/toml.ts +72 -0
- package/core/src/eslint-config/src/configs/typescript.ts +156 -0
- package/core/src/eslint-config/src/configs/unicorn.ts +41 -0
- package/core/src/eslint-config/src/configs/unocss.ts +43 -0
- package/core/src/eslint-config/src/configs/vue.ts +169 -0
- package/core/src/eslint-config/src/configs/yaml.ts +72 -0
- package/core/src/eslint-config/src/factory.ts +260 -0
- package/core/src/eslint-config/src/globs.ts +92 -0
- package/core/src/eslint-config/src/index.ts +9 -0
- package/core/src/eslint-config/src/plugins.ts +10 -0
- package/core/src/eslint-config/src/stub.d.ts +3 -0
- package/core/src/eslint-config/src/types.ts +366 -0
- package/core/src/eslint-config/src/utils.ts +72 -0
- package/core/src/eslint-config/src/vendor/prettier-types.ts +136 -0
- package/core/src/eslint-config/test/cli.spec.ts +90 -0
- package/core/src/eslint-config/test/fixtures.test.ts +125 -0
- package/core/src/eslint-config/tsconfig.json +17 -0
- package/core/src/eslint-config/tsup.config.ts +8 -0
- package/core/src/events/README.md +76 -0
- package/core/src/events/build.ts +8 -0
- package/core/src/events/dist/index.js +63 -0
- package/core/src/events/package.json +52 -0
- package/core/src/events/src/index.ts +170 -0
- package/core/src/events/tests/example.test.ts +5 -0
- package/core/src/faker/README.md +53 -0
- package/core/src/faker/build.ts +8 -0
- package/core/src/faker/dist/index.js +6 -0
- package/core/src/faker/package.json +61 -0
- package/core/src/faker/tests/example.test.ts +5 -0
- package/core/src/git/README.md +65 -0
- package/core/src/git/build.ts +8 -0
- package/core/src/git/dist/index.js +6 -0
- package/core/src/git/package.json +68 -0
- package/core/src/git/src/index.ts +1 -0
- package/core/src/git/tests/example.test.ts +5 -0
- package/core/src/health/README.md +56 -0
- package/core/src/health/build.ts +8 -0
- package/core/src/health/dist/index.js +9 -0
- package/core/src/health/package.json +58 -0
- package/core/src/health/src/drivers/index.ts +1 -0
- package/core/src/health/src/drivers/ohdear.ts +1 -0
- package/core/src/health/src/index.ts +2 -0
- package/core/src/health/src/notifications/index.ts +1 -0
- package/core/src/health/tests/example.test.ts +5 -0
- package/core/src/http/README.md +59 -0
- package/core/src/http/build.ts +8 -0
- package/core/src/http/dist/index.js +65 -0
- package/core/src/http/package.json +52 -0
- package/core/src/http/src/index.ts +71 -0
- package/core/src/index.ts +57 -0
- package/core/src/lint/.eslintrc.json +3 -0
- package/core/src/lint/README.md +73 -0
- package/core/src/lint/build.ts +8 -0
- package/core/src/lint/dist/index.js +6 -0
- package/core/src/lint/package.json +69 -0
- package/core/src/lint/tests/example.test.ts +5 -0
- package/core/src/logging/README.md +58 -0
- package/core/src/logging/build.ts +8 -0
- package/core/src/logging/dist/index.js +1809 -0
- package/core/src/logging/package.json +61 -0
- package/core/src/logging/src/index.ts +27 -0
- package/core/src/logging/tests/example.test.ts +5 -0
- package/core/src/music/package.json +46 -0
- package/core/src/music/src/components/SampleComponent.stx +5 -0
- package/core/src/music/src/layouts/default.stx +3 -0
- package/core/src/music/src/pages/index.stx +10 -0
- package/core/src/music/src/pages/music.stx +10 -0
- package/core/src/music/src/styles/main.css +1 -0
- package/core/src/notifications/README.md +272 -0
- package/core/src/notifications/build.ts +8 -0
- package/core/src/notifications/dist/index.js +54 -0
- package/core/src/notifications/package.json +103 -0
- package/core/src/notifications/src/drivers/index.ts +4 -0
- package/core/src/notifications/src/index.ts +51 -0
- package/core/src/notifications/src/tailwind.config.ts +39 -0
- package/core/src/notifications/src/utils/config.ts +5 -0
- package/core/src/notifications/tests/chat/Slack.test.ts +34 -0
- package/core/src/notifications/tests/email/Mailgun.test.ts +40 -0
- package/core/src/notifications/tests/email/Sendgrid.test.ts +40 -0
- package/core/src/notifications/tests/sms/Twilio.test.ts +37 -0
- package/core/src/objects/README.md +71 -0
- package/core/src/objects/build.ts +8 -0
- package/core/src/objects/dist/index.js +64 -0
- package/core/src/objects/package.json +63 -0
- package/core/src/objects/src/index.ts +145 -0
- package/core/src/objects/tests/example.test.ts +5 -0
- package/core/src/orm/README.md +48 -0
- package/core/src/orm/build.ts +8 -0
- package/core/src/orm/dist/index.js +6 -0
- package/core/src/orm/package.json +59 -0
- package/core/src/orm/src/index.ts +49 -0
- package/core/src/orm/tests/example.test.ts +5 -0
- package/core/src/path/README.md +64 -0
- package/core/src/path/build.ts +8 -0
- package/core/src/path/dist/index.js +495 -0
- package/core/src/path/package.json +54 -0
- package/core/src/path/src/index.ts +529 -0
- package/core/src/path/tests/example.test.ts +5 -0
- package/core/src/payments/README.md +64 -0
- package/core/src/payments/build.ts +8 -0
- package/core/src/payments/dist/index.js +6261 -0
- package/core/src/payments/package.json +60 -0
- package/core/src/payments/src/drivers/stripe.ts +116 -0
- package/core/src/payments/tests/example.test.ts +5 -0
- package/core/src/push/README.md +71 -0
- package/core/src/push/build.ts +9 -0
- package/core/src/push/package.json +64 -0
- package/core/src/push/src/drivers/expo.ts +21 -0
- package/core/src/push/src/drivers/fcm.ts +21 -0
- package/core/src/push/src/drivers/index.ts +2 -0
- package/core/src/push/src/index.ts +1 -0
- package/core/src/push/tests/example.test.ts +5 -0
- package/core/src/query-builder/README.md +48 -0
- package/core/src/query-builder/build.ts +8 -0
- package/core/src/query-builder/dist/index.js +18 -0
- package/core/src/query-builder/package.json +59 -0
- package/core/src/query-builder/src/kysely.ts +38 -0
- package/core/src/query-builder/tests/example.test.ts +5 -0
- package/core/src/queue/README.md +59 -0
- package/core/src/queue/build.ts +8 -0
- package/core/src/queue/dist/index.js +19 -0
- package/core/src/queue/package.json +55 -0
- package/core/src/queue/src/index.ts +17 -0
- package/core/src/queue/tests/example.test.ts +5 -0
- package/core/src/realtime/README.md +59 -0
- package/core/src/realtime/build.ts +8 -0
- package/core/src/realtime/dist/index.js +6 -0
- package/core/src/realtime/package.json +52 -0
- package/core/src/realtime/src/drivers/index.ts +1 -0
- package/core/src/realtime/src/index.ts +1 -0
- package/core/src/realtime/tests/example.test.ts +5 -0
- package/core/src/repl/README.md +53 -0
- package/core/src/repl/build.ts +8 -0
- package/core/src/repl/dist/index.js +6 -0
- package/core/src/repl/package.json +59 -0
- package/core/src/repl/tests/example.test.ts +5 -0
- package/core/src/router/README.md +59 -0
- package/core/src/router/build.ts +8 -0
- package/core/src/router/dist/index.js +841 -0
- package/core/src/router/package.json +62 -0
- package/core/src/router/src/index.ts +4 -0
- package/core/src/router/src/middleware.ts +34 -0
- package/core/src/router/src/request.ts +44 -0
- package/core/src/router/src/router.ts +162 -0
- package/core/src/router/src/server.ts +154 -0
- package/core/src/router/tests/example.test.ts +5 -0
- package/core/src/scheduler/README.md +137 -0
- package/core/src/scheduler/build.ts +8 -0
- package/core/src/scheduler/dist/index.js +208 -0
- package/core/src/scheduler/package.json +56 -0
- package/core/src/scheduler/src/index.ts +321 -0
- package/core/src/scheduler/tests/example.test.ts +5 -0
- package/core/src/search-engine/README.md +66 -0
- package/core/src/search-engine/build.ts +8 -0
- package/core/src/search-engine/dist/index.js +89 -0
- package/core/src/search-engine/package.json +67 -0
- package/core/src/search-engine/src/drivers/index.ts +1 -0
- package/core/src/search-engine/src/drivers/meilisearch.ts +124 -0
- package/core/src/search-engine/src/drivers/opensearch.ts +59 -0
- package/core/src/search-engine/src/helpers.ts +138 -0
- package/core/src/search-engine/src/index.ts +69 -0
- package/core/src/search-engine/tests/example.test.ts +5 -0
- package/core/src/security/README.md +66 -0
- package/core/src/security/build.ts +8 -0
- package/core/src/security/dist/index.js +3288 -0
- package/core/src/security/package.json +65 -0
- package/core/src/security/src/crypt.ts +23 -0
- package/core/src/security/src/hash.ts +54 -0
- package/core/src/security/src/key.ts +11 -0
- package/core/src/security/tests/example.test.ts +5 -0
- package/core/src/server/README.md +51 -0
- package/core/src/server/build.ts +8 -0
- package/core/src/server/dist/index.js +48 -0
- package/core/src/server/package.json +67 -0
- package/core/src/server/src/api.ts +5 -0
- package/core/src/server/src/config.ts +59 -0
- package/core/src/server/src/index.ts +1 -0
- package/core/src/server/tests/example.test.ts +5 -0
- package/core/src/signals/README.md +105 -0
- package/core/src/signals/build.ts +8 -0
- package/core/src/signals/dist/index.js +9 -0
- package/core/src/signals/package.json +63 -0
- package/core/src/signals/tests/example.test.ts +5 -0
- package/core/src/slug/README.md +59 -0
- package/core/src/slug/build.ts +8 -0
- package/core/src/slug/dist/index.js +5 -0
- package/core/src/slug/package.json +65 -0
- package/core/src/slug/src/index.ts +56 -0
- package/core/src/slug/tests/example.test.ts +5 -0
- package/core/src/sms/README.md +137 -0
- package/core/src/sms/build.ts +9 -0
- package/core/src/sms/package.json +82 -0
- package/core/src/sms/src/drivers/index.ts +8 -0
- package/core/src/sms/src/index.ts +1 -0
- package/core/src/sms/tests/example.test.ts +5 -0
- package/core/src/storage/README.md +74 -0
- package/core/src/storage/build.ts +8 -0
- package/core/src/storage/dist/index.js +798 -0
- package/core/src/storage/package.json +77 -0
- package/core/src/storage/src/copy.ts +42 -0
- package/core/src/storage/src/delete.ts +131 -0
- package/core/src/storage/src/drivers/aws.ts +15 -0
- package/core/src/storage/src/drivers/index.ts +1 -0
- package/core/src/storage/src/files.ts +182 -0
- package/core/src/storage/src/folders.ts +51 -0
- package/core/src/storage/src/fs.ts +9 -0
- package/core/src/storage/src/glob.ts +1 -0
- package/core/src/storage/src/hash.ts +39 -0
- package/core/src/storage/src/helpers.ts +29 -0
- package/core/src/storage/src/index.ts +11 -0
- package/core/src/storage/src/move.ts +84 -0
- package/core/src/storage/src/storage.ts +10 -0
- package/core/src/storage/src/visibility.ts +6 -0
- package/core/src/storage/src/zip.ts +55 -0
- package/core/src/storage/tests/example.test.ts +5 -0
- package/core/src/strings/README.md +137 -0
- package/core/src/strings/build.ts +9 -0
- package/core/src/strings/dist/index.js +393 -0
- package/core/src/strings/package.json +81 -0
- package/core/src/strings/src/case.ts +27 -0
- package/core/src/strings/src/helpers.ts +3 -0
- package/core/src/strings/src/index.ts +2 -0
- package/core/src/strings/src/macro.ts +131 -0
- package/core/src/strings/src/pluralize.ts +26 -0
- package/core/src/strings/src/string.ts +5 -0
- package/core/src/strings/src/types.ts +4 -0
- package/core/src/strings/src/utils.ts +117 -0
- package/core/src/strings/tests/example.test.ts +5 -0
- package/core/src/tables/README.md +110 -0
- package/core/src/tables/examples/vue/App.stx +12 -0
- package/core/src/tables/examples/vue/favicon.png +0 -0
- package/core/src/tables/examples/vue/index.html +20 -0
- package/core/src/tables/examples/web/favicon.png +0 -0
- package/core/src/tables/examples/web/index.html +13 -0
- package/core/src/tables/package.json +57 -0
- package/core/src/tables/src/App.stx +23 -0
- package/core/src/tables/src/components/README.md +109 -0
- package/core/src/tables/src/components/Table.stx +342 -0
- package/core/src/tables/src/components/TableBody.stx +32 -0
- package/core/src/tables/src/components/TableFilters.stx +704 -0
- package/core/src/tables/src/components/TableHead.stx +60 -0
- package/core/src/tables/src/components/TablePagination.stx +131 -0
- package/core/src/tables/src/components/TableRow.stx +73 -0
- package/core/src/tables/src/components/TableSearch.stx +39 -0
- package/core/src/tables/src/components/Tooltip.stx +10 -0
- package/core/src/tables/src/components.d.ts +24 -0
- package/core/src/tables/src/config/tables.ts +2 -0
- package/core/src/tables/src/docs/index.md +0 -0
- package/core/src/tables/src/main.ts +4 -0
- package/core/src/tables/tests/example.test.ts +5 -0
- package/core/src/tables/vite.config.ts +84 -0
- package/core/src/testing/README.md +59 -0
- package/core/src/testing/build.ts +8 -0
- package/core/src/testing/dist/index.js +6 -0
- package/core/src/testing/package.json +62 -0
- package/core/src/testing/src/index.ts +3 -0
- package/core/src/tinker/package.json +46 -0
- package/core/src/tunnel/README.md +53 -0
- package/core/src/tunnel/build.ts +8 -0
- package/core/src/tunnel/dist/index.js +10 -0
- package/core/src/tunnel/package.json +57 -0
- package/core/src/tunnel/src/index.ts +6 -0
- package/core/src/tunnel/tests/example.test.ts +5 -0
- package/core/src/types/README.md +59 -0
- package/core/src/types/build.ts +8 -0
- package/core/src/types/dist/index.js +501 -0
- package/core/src/types/package.json +86 -0
- package/core/src/types/src/ai.ts +25 -0
- package/core/src/types/src/analytics.ts +21 -0
- package/core/src/types/src/api.ts +63 -0
- package/core/src/types/src/app.ts +172 -0
- package/core/src/types/src/binary.ts +12 -0
- package/core/src/types/src/cache.ts +98 -0
- package/core/src/types/src/cdn.ts +17 -0
- package/core/src/types/src/chat.ts +5 -0
- package/core/src/types/src/cli.ts +305 -0
- package/core/src/types/src/cloud.ts +82 -0
- package/core/src/types/src/components.ts +64 -0
- package/core/src/types/src/configure.ts +6 -0
- package/core/src/types/src/cron-jobs.ts +44 -0
- package/core/src/types/src/database.ts +45 -0
- package/core/src/types/src/dependencies.ts +69 -0
- package/core/src/types/src/deploy.ts +13 -0
- package/core/src/types/src/dns.ts +186 -0
- package/core/src/types/src/docs.ts +22 -0
- package/core/src/types/src/email.ts +16 -0
- package/core/src/types/src/env.ts +1 -0
- package/core/src/types/src/errors.ts +11 -0
- package/core/src/types/src/events.ts +30 -0
- package/core/src/types/src/file-systems.ts +70 -0
- package/core/src/types/src/git.ts +133 -0
- package/core/src/types/src/hashing.ts +131 -0
- package/core/src/types/src/helpers.ts +11 -0
- package/core/src/types/src/index.ts +58 -0
- package/core/src/types/src/layout.ts +8 -0
- package/core/src/types/src/library.ts +154 -0
- package/core/src/types/src/model.ts +72 -0
- package/core/src/types/src/money.ts +3 -0
- package/core/src/types/src/notifications.ts +147 -0
- package/core/src/types/src/payments.ts +65 -0
- package/core/src/types/src/push.ts +36 -0
- package/core/src/types/src/queue.ts +36 -0
- package/core/src/types/src/router.ts +70 -0
- package/core/src/types/src/scheduler.ts +1 -0
- package/core/src/types/src/search-engine.ts +136 -0
- package/core/src/types/src/security.ts +23 -0
- package/core/src/types/src/services.ts +44 -0
- package/core/src/types/src/sms.ts +5 -0
- package/core/src/types/src/ssg.ts +3 -0
- package/core/src/types/src/stacks.ts +236 -0
- package/core/src/types/src/storage.ts +13 -0
- package/core/src/types/src/team.ts +8 -0
- package/core/src/types/src/ui.ts +197 -0
- package/core/src/types/src/utils.ts +47 -0
- package/core/src/ui/README.md +66 -0
- package/core/src/ui/build.ts +8 -0
- package/core/src/ui/dist/components.js +68 -0
- package/core/src/ui/dist/index.js +69 -0
- package/core/src/ui/package.json +91 -0
- package/core/src/ui/src/components/autocomplete.ts +0 -0
- package/core/src/ui/src/components/disclosure.ts +5 -0
- package/core/src/ui/src/components/menu.ts +1 -0
- package/core/src/ui/src/components/modal.ts +6 -0
- package/core/src/ui/src/components/popover.ts +1 -0
- package/core/src/ui/src/components/radio-group.ts +5 -0
- package/core/src/ui/src/components/select.ts +6 -0
- package/core/src/ui/src/components/tabs.ts +1 -0
- package/core/src/ui/src/components/toggle.ts +1 -0
- package/core/src/ui/src/components/transition.ts +1 -0
- package/core/src/ui/src/components.ts +10 -0
- package/core/src/ui/src/index.ts +15 -0
- package/core/src/ui/src/uno.config.ts +64 -0
- package/core/src/ui/tests/example.test.ts +5 -0
- package/core/src/utils/build.ts +8 -0
- package/core/src/utils/dist/index.js +1276 -0
- package/core/src/utils/package.json +110 -0
- package/core/src/utils/scripts/export-size.ts +94 -0
- package/core/src/utils/src/base.ts +12 -0
- package/core/src/utils/src/clean.ts +17 -0
- package/core/src/utils/src/config.ts +25 -0
- package/core/src/utils/src/delete.ts +1 -0
- package/core/src/utils/src/equal.ts +27 -0
- package/core/src/utils/src/export-size.ts +1 -0
- package/core/src/utils/src/git.ts +11 -0
- package/core/src/utils/src/glob.ts +1 -0
- package/core/src/utils/src/hash.ts +17 -0
- package/core/src/utils/src/helpers.ts +187 -0
- package/core/src/utils/src/index.ts +22 -0
- package/core/src/utils/src/macroable.ts +1 -0
- package/core/src/utils/src/math.ts +30 -0
- package/core/src/utils/src/promise.ts +117 -0
- package/core/src/utils/src/regex.ts +2 -0
- package/core/src/utils/src/sleep.ts +60 -0
- package/core/src/utils/src/throttle.ts +44 -0
- package/core/src/utils/src/vendors.ts +258 -0
- package/core/src/utils/src/versions.ts +6 -0
- package/core/src/utils/tests/example.test.ts +5 -0
- package/core/src/validation/README.md +53 -0
- package/core/src/validation/build.ts +5 -0
- package/core/src/validation/dist/index.js +187 -0
- package/core/src/validation/package.json +63 -0
- package/core/src/validation/src/is.ts +111 -0
- package/core/src/validation/src/rules.ts +126 -0
- package/core/src/validation/src/types/index.ts +7 -0
- package/core/src/validation/src/types/money.ts +17 -0
- package/core/src/validation/src/validate.ts +33 -0
- package/core/src/validation/tests/example.test.ts +5 -0
- package/core/src/vite/README.md +59 -0
- package/core/src/vite/build.ts +9 -0
- package/core/src/vite/dist/index.js +649 -0
- package/core/src/vite/package.json +122 -0
- package/core/src/vite/src/api.ts +19 -0
- package/core/src/vite/src/components.ts +79 -0
- package/core/src/vite/src/desktop.ts +59 -0
- package/core/src/vite/src/example-vue.ts +27 -0
- package/core/src/vite/src/example-wc.ts +27 -0
- package/core/src/vite/src/functions.ts +55 -0
- package/core/src/vite/src/index.ts +20 -0
- package/core/src/vite/src/plugin/auto-imports.ts +40 -0
- package/core/src/vite/src/plugin/components.ts +18 -0
- package/core/src/vite/src/plugin/css-engine.ts +16 -0
- package/core/src/vite/src/plugin/devtools.ts +1 -0
- package/core/src/vite/src/plugin/docs.ts +16 -0
- package/core/src/vite/src/plugin/fonts.ts +6 -0
- package/core/src/vite/src/plugin/i18n.ts +13 -0
- package/core/src/vite/src/plugin/index.ts +21 -0
- package/core/src/vite/src/plugin/inspect.ts +6 -0
- package/core/src/vite/src/plugin/layouts.ts +21 -0
- package/core/src/vite/src/plugin/markdown.ts +26 -0
- package/core/src/vite/src/plugin/pages.ts +34 -0
- package/core/src/vite/src/plugin/presets.ts +17 -0
- package/core/src/vite/src/plugin/pwa.ts +33 -0
- package/core/src/vite/src/plugin/router.ts +15 -0
- package/core/src/vite/src/plugin/stacks.ts +149 -0
- package/core/src/vite/src/plugin/ui-engine.ts +19 -0
- package/core/src/vite/src/stacks.ts +12 -0
- package/core/src/vite/src/views.ts +86 -0
- package/core/src/vite/src/web-components.ts +67 -0
- package/core/src/vite/tests/example.test.ts +5 -0
- package/core/src/vite-plugin-vue-layouts/README.md +59 -0
- package/core/src/vite-plugin-vue-layouts/build.ts +8 -0
- package/core/src/vite-plugin-vue-layouts/client.d.ts +5 -0
- package/core/src/vite-plugin-vue-layouts/dist/index.js +271 -0
- package/core/src/vite-plugin-vue-layouts/package.json +64 -0
- package/core/src/vite-plugin-vue-layouts/src/RouteLayout.ts +26 -0
- package/core/src/vite-plugin-vue-layouts/src/clientSide.ts +99 -0
- package/core/src/vite-plugin-vue-layouts/src/files.ts +24 -0
- package/core/src/vite-plugin-vue-layouts/src/importCode.ts +32 -0
- package/core/src/vite-plugin-vue-layouts/src/index.ts +150 -0
- package/core/src/vite-plugin-vue-layouts/src/types.ts +53 -0
- package/core/src/vite-plugin-vue-layouts/src/utils.ts +15 -0
- package/core/src/vite-plugin-vue-layouts/tests/example.test.ts +5 -0
- package/core/src/whois/README.md +55 -0
- package/core/src/whois/build.ts +8 -0
- package/core/src/whois/dist/index.js +601 -0
- package/core/src/whois/package.json +60 -0
- package/core/src/whois/src/index.ts +497 -0
- package/core/src/whois/src/parameters.ts +4 -0
- package/core/src/whois/src/servers.ts +318 -0
- package/core/src/whois/src/test.ts +5 -0
- package/core/src/whois/tests/example.test.ts +5 -0
- package/core/src/x-ray/README.md +55 -0
- package/core/src/x-ray/package.json +53 -0
- package/core/src/x-ray/src/client.ts +14 -0
- package/core/src/x-ray/src/desktop/api/nitro.config.ts +19 -0
- package/core/src/x-ray/src/desktop/api/storage/index.ts +7 -0
- package/core/src/x-ray/src/desktop/app.stx +377 -0
- package/core/src/x-ray/src/desktop/functions/http.ts +26 -0
- package/core/src/x-ray/src/desktop/main.ts +14 -0
- package/core/src/x-ray/src/desktop/plugins/unified/unified-styles.scss +0 -0
- package/core/src/x-ray/src/desktop/styles/app.scss +0 -0
- package/core/src/x-ray/src/http.ts +26 -0
- package/core/src/x-ray/src/index.ts +42 -0
- package/core/src/x-ray/tests/example.test.ts +5 -0
- package/core/tsconfig.json +73 -0
- package/core/web-types.json +67 -0
- package/ide/dictionary.txt +306 -0
- package/ide/jetbrains/.idea/jsLinters/eslint.xml +1 -1
- package/ide/jetbrains/.idea/stacks.iml +56 -56
- package/ide/jetbrains/options/nodejs.xml +3 -3
- package/ide/vscode/.vscode/settings.json +55 -51
- package/ide/vscode/LICENSE.md +1 -1
- package/ide/vscode/README.md +1 -2
- package/ide/vscode/package.json +10 -9
- package/package.json +477 -201
- package/stubs/.gitkeep +0 -0
- package/stubs/TODO.md +18 -0
- package/vcs/github/CODE_OF_CONDUCT.md +1 -1
- package/vcs/github/CONTRIBUTING.md +6 -8
- package/vcs/github/EXPLANATIONS.md +2 -2
- package/vcs/github/ISSUE_TEMPLATE/bug_report.yml +1 -14
- package/vcs/github/ISSUE_TEMPLATE/config.yml +1 -1
- package/vcs/github/SECURITY.md +1 -1
- package/vcs/github/workflows/README.md +1 -1
- package/vcs/github/workflows/ci.yml +26 -47
- package/vcs/github/workflows/export-size.yml +5 -14
- package/vcs/github/workflows/labeler.yml +13 -0
- package/vcs/github/workflows/release.yml +21 -21
- package/.gitignore +0 -18
- package/README.md +0 -416
- package/api/nitro.config.ts +0 -17
- package/api/package.json +0 -43
- package/api/routes/index.ts +0 -1
- package/art/logo-dark.svg +0 -11
- package/art/logo.svg +0 -11
- package/auto-imports.d.ts +0 -2572
- package/components.d.ts +0 -19
- package/core/actions/README.md +0 -58
- package/core/actions/build.config.ts +0 -187
- package/core/actions/package.json +0 -276
- package/core/actions/src/add.ts +0 -32
- package/core/actions/src/build/component-libs.ts +0 -5
- package/core/actions/src/build/core.ts +0 -6
- package/core/actions/src/build/stacks.ts +0 -9
- package/core/actions/src/build.ts +0 -93
- package/core/actions/src/bump.ts +0 -7
- package/core/actions/src/changelog.ts +0 -7
- package/core/actions/src/clean.ts +0 -12
- package/core/actions/src/commit.ts +0 -19
- package/core/actions/src/copy-types.ts +0 -22
- package/core/actions/src/deploy/domains.ts +0 -8
- package/core/actions/src/deploy.ts +0 -8
- package/core/actions/src/dev/components.ts +0 -5
- package/core/actions/src/dev/docs.ts +0 -5
- package/core/actions/src/dev/index.ts +0 -25
- package/core/actions/src/examples.ts +0 -48
- package/core/actions/src/fresh.ts +0 -7
- package/core/actions/src/generate/component-meta.ts +0 -15
- package/core/actions/src/generate/ide-helpers.ts +0 -20
- package/core/actions/src/generate/index.ts +0 -134
- package/core/actions/src/generate/lib-entries.ts +0 -17
- package/core/actions/src/generate/settings.ts +0 -4
- package/core/actions/src/generate/vscode-custom-data.ts +0 -16
- package/core/actions/src/generate/vue-compat.ts +0 -10
- package/core/actions/src/helpers/component-meta.ts +0 -93
- package/core/actions/src/helpers/index.ts +0 -6
- package/core/actions/src/helpers/lib-entries.ts +0 -138
- package/core/actions/src/helpers/package-json.ts +0 -96
- package/core/actions/src/helpers/utils.ts +0 -76
- package/core/actions/src/helpers/vscode-custom-data.ts +0 -28
- package/core/actions/src/helpers/vue-compat.ts +0 -17
- package/core/actions/src/index.ts +0 -1
- package/core/actions/src/key-generate.ts +0 -10
- package/core/actions/src/lint/fix.ts +0 -5
- package/core/actions/src/lint/index.ts +0 -17
- package/core/actions/src/make.ts +0 -328
- package/core/actions/src/migrate.ts +0 -3
- package/core/actions/src/preinstall.ts +0 -27
- package/core/actions/src/prepublish.ts +0 -16
- package/core/actions/src/release.ts +0 -15
- package/core/actions/src/seed.ts +0 -3
- package/core/actions/src/test/coverage.ts +0 -5
- package/core/actions/src/test/feature.ts +0 -5
- package/core/actions/src/test/ui.ts +0 -5
- package/core/actions/src/test/unit.ts +0 -5
- package/core/actions/src/test.ts +0 -5
- package/core/actions/src/tinker.ts +0 -10
- package/core/actions/src/typecheck.ts +0 -5
- package/core/actions/src/types.ts +0 -23
- package/core/actions/src/upgrade/framework.ts +0 -29
- package/core/actions/src/upgrade/index.ts +0 -25
- package/core/actions/src/upgrade/node.ts +0 -4
- package/core/actions/src/upgrade/package-manager.ts +0 -4
- package/core/actions/src/upgrade.ts +0 -75
- package/core/actions/tests/example.test.ts +0 -7
- package/core/ai/README.md +0 -62
- package/core/ai/build.config.ts +0 -13
- package/core/ai/package.json +0 -54
- package/core/ai/src/drivers/openai.ts +0 -1
- package/core/ai/tests/example.test.ts +0 -7
- package/core/alias/README.md +0 -62
- package/core/alias/build.config.ts +0 -13
- package/core/alias/package.json +0 -51
- package/core/alias/src/index.ts +0 -108
- package/core/alias/tests/example.test.ts +0 -7
- package/core/analytics/README.md +0 -62
- package/core/analytics/build.config.ts +0 -13
- package/core/analytics/package.json +0 -64
- package/core/analytics/src/drivers/fathom.ts +0 -1
- package/core/analytics/tests/example.test.ts +0 -7
- package/core/arrays/README.md +0 -59
- package/core/arrays/build.config.ts +0 -12
- package/core/arrays/package.json +0 -60
- package/core/arrays/src/contains.ts +0 -23
- package/core/arrays/src/helpers.ts +0 -206
- package/core/arrays/src/index.ts +0 -4
- package/core/arrays/src/macro.ts +0 -135
- package/core/arrays/src/math.ts +0 -19
- package/core/arrays/tests/example.test.ts +0 -7
- package/core/auth/README.md +0 -59
- package/core/auth/build.config.ts +0 -12
- package/core/auth/package.json +0 -48
- package/core/auth/tests/example.test.ts +0 -7
- package/core/buddy/README.md +0 -416
- package/core/buddy/art/social.png +0 -0
- package/core/buddy/build.config.ts +0 -14
- package/core/buddy/package.json +0 -128
- package/core/buddy/src/cli.ts +0 -65
- package/core/buddy/src/commands/add.ts +0 -62
- package/core/buddy/src/commands/build.ts +0 -149
- package/core/buddy/src/commands/changelog.ts +0 -31
- package/core/buddy/src/commands/clean.ts +0 -29
- package/core/buddy/src/commands/commit.ts +0 -18
- package/core/buddy/src/commands/create.ts +0 -126
- package/core/buddy/src/commands/deploy.ts +0 -29
- package/core/buddy/src/commands/dev.ts +0 -142
- package/core/buddy/src/commands/example.ts +0 -59
- package/core/buddy/src/commands/fresh.ts +0 -29
- package/core/buddy/src/commands/generate.ts +0 -118
- package/core/buddy/src/commands/index.ts +0 -27
- package/core/buddy/src/commands/inspire.ts +0 -24
- package/core/buddy/src/commands/key.ts +0 -28
- package/core/buddy/src/commands/lint.ts +0 -45
- package/core/buddy/src/commands/make.ts +0 -257
- package/core/buddy/src/commands/migrate.ts +0 -31
- package/core/buddy/src/commands/onboarding.ts +0 -22
- package/core/buddy/src/commands/preinstall.ts +0 -18
- package/core/buddy/src/commands/prepublish.ts +0 -19
- package/core/buddy/src/commands/release.ts +0 -28
- package/core/buddy/src/commands/seed.ts +0 -31
- package/core/buddy/src/commands/setting.ts +0 -26
- package/core/buddy/src/commands/setup.ts +0 -26
- package/core/buddy/src/commands/test.ts +0 -118
- package/core/buddy/src/commands/tinker.ts +0 -29
- package/core/buddy/src/commands/types.ts +0 -26
- package/core/buddy/src/commands/upgrade.ts +0 -134
- package/core/buddy/src/commands/version.ts +0 -28
- package/core/build/README.md +0 -59
- package/core/build/build.config.ts +0 -27
- package/core/build/package.json +0 -77
- package/core/build/src/desktop.ts +0 -152
- package/core/build/src/example-vue.ts +0 -25
- package/core/build/src/example-wc.ts +0 -25
- package/core/build/src/functions.ts +0 -54
- package/core/build/src/index.ts +0 -7
- package/core/build/src/stacks.ts +0 -200
- package/core/build/src/views.ts +0 -50
- package/core/build/src/vue-components.ts +0 -137
- package/core/build/src/web-components.ts +0 -62
- package/core/build/tests/example.test.ts +0 -7
- package/core/build/web-types.ts +0 -14
- package/core/cache/README.md +0 -59
- package/core/cache/build.config.ts +0 -15
- package/core/cache/package.json +0 -77
- package/core/cache/src/drivers/memcached.ts +0 -21
- package/core/cache/src/drivers/redis.ts +0 -44
- package/core/cache/src/drivers/upstash.ts +0 -2
- package/core/cache/src/index.ts +0 -4
- package/core/cache/tests/DynamoDB.test.ts +0 -135
- package/core/cache/tests/Memcached.test.ts +0 -52
- package/core/cache/tests/Redis.test.ts +0 -82
- package/core/cache/vite.config.ts +0 -7
- package/core/chat/README.md +0 -83
- package/core/chat/build.config.ts +0 -13
- package/core/chat/package.json +0 -60
- package/core/chat/tests/example.test.ts +0 -7
- package/core/cli/README.md +0 -129
- package/core/cli/build.config.ts +0 -12
- package/core/cli/package.json +0 -71
- package/core/cli/src/actions/install.ts +0 -40
- package/core/cli/src/command.ts +0 -2
- package/core/cli/src/console.ts +0 -78
- package/core/cli/src/helpers.ts +0 -74
- package/core/cli/src/index.ts +0 -10
- package/core/cli/src/parse.ts +0 -99
- package/core/cli/src/run.ts +0 -100
- package/core/cli/src/utilities.ts +0 -1
- package/core/cli/tests/example.test.ts +0 -7
- package/core/cloud/README.md +0 -59
- package/core/cloud/build.config.ts +0 -12
- package/core/cloud/netlify.toml +0 -18
- package/core/cloud/package.json +0 -66
- package/core/cloud/src/aws/index.ts +0 -9
- package/core/cloud/src/aws/logger.ts +0 -8
- package/core/cloud/src/aws/metrics.ts +0 -8
- package/core/cloud/src/aws/stack.ts +0 -12
- package/core/cloud/src/aws/tracer.ts +0 -3
- package/core/cloud/src/index.ts +0 -1
- package/core/cloud/src/runtime/nodejs/bootstrap.ts +0 -16
- package/core/cloud/src/runtime/nodejs/build.sh +0 -1
- package/core/cloud/tests/example.test.ts +0 -7
- package/core/collections/README.md +0 -71
- package/core/collections/build.config.ts +0 -11
- package/core/collections/package.json +0 -55
- package/core/collections/tests/example.test.ts +0 -7
- package/core/config/README.md +0 -71
- package/core/config/build.config.ts +0 -46
- package/core/config/package.json +0 -54
- package/core/config/src/defaults.ts +0 -17
- package/core/config/src/index.ts +0 -4
- package/core/config/src/stacks.ts +0 -48
- package/core/config/tests/example.test.ts +0 -7
- package/core/database/README.md +0 -59
- package/core/database/build.config.ts +0 -16
- package/core/database/package.json +0 -64
- package/core/database/src/factory/index.ts +0 -24
- package/core/database/src/index.ts +0 -3
- package/core/database/src/migrations/index.ts +0 -148
- package/core/database/src/seeder/index.ts +0 -79
- package/core/database/tests/example.test.ts +0 -7
- package/core/datetime/README.md +0 -66
- package/core/datetime/build.config.ts +0 -12
- package/core/datetime/package.json +0 -54
- package/core/datetime/tests/example.test.ts +0 -7
- package/core/desktop/README.md +0 -49
- package/core/desktop/build.config.ts +0 -16
- package/core/desktop/package.json +0 -68
- package/core/desktop/src/drivers/tauri/index.ts +0 -1
- package/core/desktop/src/index.ts +0 -1
- package/core/desktop/tests/example.test.ts +0 -7
- package/core/development/README.md +0 -27
- package/core/development/build.config.ts +0 -25
- package/core/development/package.json +0 -68
- package/core/development/src/index.ts +0 -4
- package/core/development/tests/example.test.ts +0 -7
- package/core/dns/README.md +0 -56
- package/core/dns/build.config.ts +0 -18
- package/core/dns/package.json +0 -55
- package/core/dns/src/index.ts +0 -18
- package/core/dns/tests/example.test.ts +0 -7
- package/core/docs/README.md +0 -59
- package/core/docs/build.config.ts +0 -15
- package/core/docs/package.json +0 -54
- package/core/docs/src/index.ts +0 -5
- package/core/docs/tests/example.test.ts +0 -7
- package/core/email/README.md +0 -155
- package/core/email/build.config.ts +0 -12
- package/core/email/package.json +0 -82
- package/core/email/src/actions/send.ts +0 -38
- package/core/email/src/drivers/emailjs.ts +0 -23
- package/core/email/src/drivers/mailgun.ts +0 -21
- package/core/email/src/drivers/mailjet.ts +0 -21
- package/core/email/src/drivers/mandrill.ts +0 -19
- package/core/email/src/drivers/netcore.ts +0 -19
- package/core/email/src/drivers/nodemailer.ts +0 -23
- package/core/email/src/drivers/postmark.ts +0 -19
- package/core/email/src/drivers/sendgrid.ts +0 -20
- package/core/email/src/drivers/ses.ts +0 -22
- package/core/email/src/index.ts +0 -9
- package/core/email/tests/example.test.ts +0 -7
- package/core/error-handling/README.md +0 -131
- package/core/error-handling/build.config.ts +0 -19
- package/core/error-handling/package.json +0 -58
- package/core/error-handling/src/index.ts +0 -58
- package/core/error-handling/tests/example.test.ts +0 -7
- package/core/events/README.md +0 -76
- package/core/events/build.config.ts +0 -12
- package/core/events/package.json +0 -53
- package/core/events/src/index.ts +0 -38
- package/core/events/tests/example.test.ts +0 -7
- package/core/faker/README.md +0 -62
- package/core/faker/build.config.ts +0 -17
- package/core/faker/package.json +0 -55
- package/core/faker/tests/example.test.ts +0 -7
- package/core/git/README.md +0 -69
- package/core/git/build.config.ts +0 -17
- package/core/git/package.json +0 -58
- package/core/git/src/index.ts +0 -1
- package/core/git/tests/example.test.ts +0 -7
- package/core/health/README.md +0 -56
- package/core/health/build.config.ts +0 -17
- package/core/health/package.json +0 -53
- package/core/health/src/drivers/ohdear.ts +0 -1
- package/core/health/src/index.ts +0 -1
- package/core/health/src/notifications/index.ts +0 -1
- package/core/health/tests/example.test.ts +0 -7
- package/core/lint/README.md +0 -73
- package/core/lint/build.config.ts +0 -17
- package/core/lint/package.json +0 -58
- package/core/lint/tests/example.test.ts +0 -7
- package/core/logging/README.md +0 -58
- package/core/logging/build.config.ts +0 -26
- package/core/logging/package.json +0 -61
- package/core/logging/src/index.ts +0 -11
- package/core/logging/tests/example.test.ts +0 -7
- package/core/modules/README.md +0 -51
- package/core/modules/build.config.ts +0 -18
- package/core/modules/package.json +0 -61
- package/core/modules/src/i18n.ts +0 -23
- package/core/modules/src/nprogress.ts +0 -14
- package/core/modules/src/pwa.ts +0 -12
- package/core/modules/tests/example.test.ts +0 -7
- package/core/notifications/README.md +0 -272
- package/core/notifications/build.config.ts +0 -16
- package/core/notifications/package.json +0 -93
- package/core/notifications/src/index.ts +0 -51
- package/core/notifications/src/tailwind.config.ts +0 -39
- package/core/notifications/src/utils/config.ts +0 -5
- package/core/notifications/tests/chat/Slack.test.ts +0 -35
- package/core/notifications/tests/email/Mailgun.test.ts +0 -41
- package/core/notifications/tests/email/Sendgrid.test.ts +0 -41
- package/core/notifications/tests/sms/Twilio.test.ts +0 -38
- package/core/objects/README.md +0 -71
- package/core/objects/build.config.ts +0 -19
- package/core/objects/package.json +0 -55
- package/core/objects/src/index.ts +0 -147
- package/core/objects/tests/example.test.ts +0 -7
- package/core/orm/README.md +0 -48
- package/core/orm/build.config.ts +0 -12
- package/core/orm/package.json +0 -52
- package/core/orm/src/index.ts +0 -43
- package/core/orm/tests/example.test.ts +0 -7
- package/core/pages/build.config.ts +0 -12
- package/core/pages/package.json +0 -57
- package/core/pages/src/index.ts +0 -39
- package/core/pages/tests/example.test.ts +0 -7
- package/core/path/README.md +0 -64
- package/core/path/build.config.ts +0 -16
- package/core/path/package.json +0 -55
- package/core/path/src/index.ts +0 -486
- package/core/path/tests/example.test.ts +0 -7
- package/core/payments/README.md +0 -64
- package/core/payments/build.config.ts +0 -12
- package/core/payments/package.json +0 -58
- package/core/payments/src/drivers/stripe.ts +0 -137
- package/core/payments/tests/example.test.ts +0 -7
- package/core/push/README.md +0 -71
- package/core/push/build.config.ts +0 -12
- package/core/push/package.json +0 -56
- package/core/push/src/drivers/expo.ts +0 -21
- package/core/push/src/drivers/fcm.ts +0 -21
- package/core/push/src/index.ts +0 -2
- package/core/push/tests/example.test.ts +0 -7
- package/core/query-builder/README.md +0 -48
- package/core/query-builder/build.config.ts +0 -12
- package/core/query-builder/package.json +0 -56
- package/core/query-builder/src/kysely.ts +0 -37
- package/core/query-builder/tests/example.test.ts +0 -7
- package/core/queue/README.md +0 -59
- package/core/queue/build.config.ts +0 -12
- package/core/queue/package.json +0 -53
- package/core/queue/src/index.ts +0 -1
- package/core/queue/tests/example.test.ts +0 -7
- package/core/realtime/README.md +0 -59
- package/core/realtime/build.config.ts +0 -12
- package/core/realtime/package.json +0 -50
- package/core/realtime/src/drivers/index.ts +0 -3
- package/core/realtime/src/index.ts +0 -5
- package/core/realtime/tests/example.test.ts +0 -7
- package/core/repl/README.md +0 -53
- package/core/repl/build.config.ts +0 -12
- package/core/repl/package.json +0 -56
- package/core/repl/tests/example.test.ts +0 -7
- package/core/router/README.md +0 -59
- package/core/router/build.config.ts +0 -17
- package/core/router/package.json +0 -53
- package/core/router/src/index.ts +0 -120
- package/core/router/tests/example.test.ts +0 -7
- package/core/scheduler/README.md +0 -137
- package/core/scheduler/build.config.ts +0 -12
- package/core/scheduler/package.json +0 -51
- package/core/scheduler/src/index.ts +0 -120
- package/core/scheduler/tests/example.test.ts +0 -7
- package/core/search-engine/README.md +0 -66
- package/core/search-engine/build.config.ts +0 -20
- package/core/search-engine/package.json +0 -65
- package/core/search-engine/src/drivers/meilisearch.ts +0 -39
- package/core/search-engine/src/helpers.ts +0 -134
- package/core/search-engine/src/index.ts +0 -67
- package/core/search-engine/tests/example.test.ts +0 -7
- package/core/security/README.md +0 -66
- package/core/security/build.config.ts +0 -21
- package/core/security/package.json +0 -57
- package/core/security/src/crypt.ts +0 -23
- package/core/security/src/hash.ts +0 -52
- package/core/security/src/key.ts +0 -11
- package/core/security/tests/example.test.ts +0 -7
- package/core/server/README.md +0 -51
- package/core/server/build.config.ts +0 -11
- package/core/server/package.json +0 -59
- package/core/server/src/config.ts +0 -7
- package/core/server/src/index.ts +0 -2
- package/core/server/src/nitro.config.ts +0 -7
- package/core/server/tests/example.test.ts +0 -7
- package/core/signals/README.md +0 -105
- package/core/signals/build.config.ts +0 -12
- package/core/signals/package.json +0 -55
- package/core/signals/tests/example.test.ts +0 -7
- package/core/slug/README.md +0 -59
- package/core/slug/build.config.ts +0 -12
- package/core/slug/package.json +0 -55
- package/core/slug/src/index.ts +0 -57
- package/core/slug/tests/example.test.ts +0 -7
- package/core/sms/README.md +0 -137
- package/core/sms/build.config.ts +0 -17
- package/core/sms/package.json +0 -72
- package/core/sms/src/index.ts +0 -8
- package/core/sms/tests/example.test.ts +0 -7
- package/core/storage/README.md +0 -74
- package/core/storage/build.config.ts +0 -12
- package/core/storage/package.json +0 -61
- package/core/storage/src/index.ts +0 -208
- package/core/storage/tests/example.test.ts +0 -7
- package/core/strings/README.md +0 -77
- package/core/strings/build.config.ts +0 -12
- package/core/strings/package.json +0 -78
- package/core/strings/src/case.ts +0 -27
- package/core/strings/src/index.ts +0 -4
- package/core/strings/src/macro.ts +0 -139
- package/core/strings/src/pluralize.ts +0 -5
- package/core/strings/src/utils.ts +0 -120
- package/core/strings/tests/example.test.ts +0 -7
- package/core/testing/README.md +0 -59
- package/core/testing/build.config.ts +0 -17
- package/core/testing/package.json +0 -62
- package/core/testing/src/index.ts +0 -3
- package/core/tinker/README.md +0 -61
- package/core/tinker/build.config.ts +0 -13
- package/core/tinker/package.json +0 -58
- package/core/tinker/src/index.ts +0 -1
- package/core/tinker/src/tinker.ts +0 -2
- package/core/types/README.md +0 -59
- package/core/types/build.config.ts +0 -37
- package/core/types/package.json +0 -88
- package/core/types/src/app.ts +0 -119
- package/core/types/src/cache.ts +0 -78
- package/core/types/src/cdn.ts +0 -15
- package/core/types/src/cli.ts +0 -303
- package/core/types/src/components.ts +0 -64
- package/core/types/src/cron-jobs.ts +0 -38
- package/core/types/src/database.ts +0 -49
- package/core/types/src/debug.ts +0 -6
- package/core/types/src/deploy.ts +0 -8
- package/core/types/src/dns.ts +0 -49
- package/core/types/src/docs.ts +0 -5
- package/core/types/src/errors.ts +0 -24
- package/core/types/src/events.ts +0 -30
- package/core/types/src/fs.ts +0 -30
- package/core/types/src/git.ts +0 -131
- package/core/types/src/hashing.ts +0 -122
- package/core/types/src/index.ts +0 -40
- package/core/types/src/layout.ts +0 -8
- package/core/types/src/library.ts +0 -146
- package/core/types/src/model.ts +0 -59
- package/core/types/src/money.ts +0 -3
- package/core/types/src/notifications.ts +0 -205
- package/core/types/src/payments.ts +0 -63
- package/core/types/src/queue.ts +0 -34
- package/core/types/src/router.ts +0 -52
- package/core/types/src/search-engine.ts +0 -166
- package/core/types/src/ssg.ts +0 -3
- package/core/types/src/stacks.ts +0 -192
- package/core/types/src/ui.ts +0 -193
- package/core/types/src/utils.ts +0 -43
- package/core/ui/README.md +0 -66
- package/core/ui/build.config.ts +0 -13
- package/core/ui/package.json +0 -69
- package/core/ui/src/index.ts +0 -20
- package/core/ui/src/unocss.config.ts +0 -47
- package/core/ui/src/unocss.ts +0 -45
- package/core/ui/tests/example.test.ts +0 -7
- package/core/utils/build.config.ts +0 -36
- package/core/utils/package.json +0 -102
- package/core/utils/src/base.ts +0 -25
- package/core/utils/src/config.ts +0 -135
- package/core/utils/src/delete.ts +0 -1
- package/core/utils/src/equal.ts +0 -27
- package/core/utils/src/helpers.ts +0 -169
- package/core/utils/src/index.ts +0 -15
- package/core/utils/src/math.ts +0 -30
- package/core/utils/src/promise.ts +0 -124
- package/core/utils/src/throttle.ts +0 -42
- package/core/utils/src/vendors.ts +0 -222
- package/core/utils/src/versions.ts +0 -1
- package/core/utils/tests/example.test.ts +0 -7
- package/core/validation/README.md +0 -53
- package/core/validation/build.config.ts +0 -21
- package/core/validation/package.json +0 -56
- package/core/validation/src/is.ts +0 -110
- package/core/validation/src/rules.ts +0 -126
- package/core/validation/src/types/env.ts +0 -147
- package/core/validation/src/types/index.ts +0 -2
- package/core/validation/src/types/money.ts +0 -17
- package/core/validation/src/validate.ts +0 -18
- package/core/validation/tests/example.test.ts +0 -7
- package/core/vite-plugin/README.md +0 -59
- package/core/vite-plugin/build.config.ts +0 -17
- package/core/vite-plugin/package.json +0 -51
- package/core/vite-plugin/src/index.ts +0 -23
- package/core/vite-plugin/tests/example.test.ts +0 -7
- package/dictionary.txt +0 -228
- package/docs/.vitepress/config.ts +0 -9
- package/docs/README.md +0 -13
- package/docs/package.json +0 -47
- package/env.d.ts +0 -7
- package/ide/jetbrains/.idea/.gitignore +0 -5
- package/libs/components/vue/index.html +0 -13
- package/libs/components/vue/main.ts +0 -19
- package/libs/components/vue/package.json +0 -41
- package/libs/components/web/package.json +0 -41
- package/libs/examples/vue/App.vue +0 -12
- package/libs/examples/vue/favicon.png +0 -0
- package/libs/examples/vue/index.html +0 -20
- package/libs/examples/web/favicon.png +0 -0
- package/libs/examples/web/index.html +0 -13
- package/libs/functions/package.json +0 -41
- package/reset.d.ts +0 -1
- package/scripts/ensure.sh +0 -33
- package/scripts/publish.sh +0 -18
- package/scripts/setup.sh +0 -540
- package/shims.d.ts +0 -17
- package/simple-git-hooks.cjs +0 -5
- package/stacks/dashboard/README.md +0 -74
- package/stacks/dashboard/build.config.ts +0 -15
- package/stacks/dashboard/package.json +0 -47
- package/stacks/dashboard/tests/example.test.ts +0 -7
- package/stacks/tables/README.md +0 -109
- package/stacks/tables/build.config.ts +0 -14
- package/stacks/tables/examples/vue/App.vue +0 -12
- package/stacks/tables/examples/vue/favicon.png +0 -0
- package/stacks/tables/examples/vue/index.html +0 -20
- package/stacks/tables/examples/web/favicon.png +0 -0
- package/stacks/tables/examples/web/index.html +0 -13
- package/stacks/tables/package.json +0 -57
- package/stacks/tables/src/App.vue +0 -23
- package/stacks/tables/src/cli/index.ts +0 -1
- package/stacks/tables/src/components/README.md +0 -110
- package/stacks/tables/src/components/Table.vue +0 -342
- package/stacks/tables/src/components/TableBody.vue +0 -32
- package/stacks/tables/src/components/TableFilters.vue +0 -704
- package/stacks/tables/src/components/TableHead.vue +0 -60
- package/stacks/tables/src/components/TablePagination.vue +0 -131
- package/stacks/tables/src/components/TableRow.vue +0 -73
- package/stacks/tables/src/components/TableSearch.vue +0 -39
- package/stacks/tables/src/components/Tooltip.vue +0 -10
- package/stacks/tables/src/config/tables.ts +0 -1
- package/stacks/tables/src/main.ts +0 -4
- package/stacks/tables/tests/example.test.ts +0 -7
- package/stacks/tables/vite.config.ts +0 -26
- package/stacks/tinker/package.json +0 -49
- package/stacks/tinker/src/index.ts +0 -1
- package/stacks/x-ray/README.md +0 -55
- package/stacks/x-ray/build.config.ts +0 -15
- package/stacks/x-ray/package.json +0 -56
- package/stacks/x-ray/src/client.ts +0 -14
- package/stacks/x-ray/src/desktop/api/nitro.config.ts +0 -19
- package/stacks/x-ray/src/desktop/api/storage/index.ts +0 -7
- package/stacks/x-ray/src/desktop/app.vue +0 -377
- package/stacks/x-ray/src/desktop/functions/http.ts +0 -26
- package/stacks/x-ray/src/desktop/main.ts +0 -14
- package/stacks/x-ray/src/http.ts +0 -26
- package/stacks/x-ray/src/index.ts +0 -42
- package/stacks/x-ray/tests/example.test.ts +0 -7
- package/stacks.d.ts +0 -22
- package/tsconfig.json +0 -159
- package/views/desktop/.gitignore +0 -24
- package/views/desktop/README.md +0 -73
- package/views/desktop/index.html +0 -13
- package/views/desktop/package.json +0 -29
- package/views/desktop/public/favicon.svg +0 -1
- package/views/desktop/src/.gitignore +0 -3
- package/views/desktop/src/Cargo.lock +0 -3916
- package/views/desktop/src/Cargo.toml +0 -28
- package/views/desktop/src/build.rs +0 -3
- package/views/desktop/src/icons/128x128.png +0 -0
- package/views/desktop/src/icons/128x128@2x.png +0 -0
- package/views/desktop/src/icons/32x32.png +0 -0
- package/views/desktop/src/icons/Square107x107Logo.png +0 -0
- package/views/desktop/src/icons/Square142x142Logo.png +0 -0
- package/views/desktop/src/icons/Square150x150Logo.png +0 -0
- package/views/desktop/src/icons/Square284x284Logo.png +0 -0
- package/views/desktop/src/icons/Square30x30Logo.png +0 -0
- package/views/desktop/src/icons/Square310x310Logo.png +0 -0
- package/views/desktop/src/icons/Square44x44Logo.png +0 -0
- package/views/desktop/src/icons/Square71x71Logo.png +0 -0
- package/views/desktop/src/icons/Square89x89Logo.png +0 -0
- package/views/desktop/src/icons/StoreLogo.png +0 -0
- package/views/desktop/src/icons/icon.icns +0 -0
- package/views/desktop/src/icons/icon.ico +0 -0
- package/views/desktop/src/icons/icon.png +0 -0
- package/views/desktop/src/src/main.rs +0 -10
- package/views/desktop/src/tauri.conf.json +0 -73
- package/views/web/App.vue +0 -26
- package/views/web/index.html +0 -23
- package/views/web/main.ts +0 -26
- package/views/web/public/_headers +0 -3
- package/views/web/public/favicon-dark.svg +0 -3
- package/views/web/public/favicon.svg +0 -3
- package/views/web/public/pwa-192x192.png +0 -0
- package/views/web/public/pwa-512x512.png +0 -0
- package/views/web/public/safari-pinned-tab.svg +0 -41
- package/views/web/styles/main.css +0 -29
- package/views/web/styles/markdown.css +0 -28
- package/vitest.config.ts +0 -31
- package/web-types.json +0 -67
- /package/{custom-elements.json → core/custom-elements.json} +0 -0
- /package/core/{actions → src/actions}/src/upgrade/dependencies.ts +0 -0
- /package/{stacks/dashboard/src/index.ts → core/src/ai/src/chatbots.ts} +0 -0
- /package/{stacks/tables/src/docs/index.md → core/src/ai/src/image-generation.ts} +0 -0
- /package/{stacks/x-ray/src/desktop/plugins/unified/unified-styles.scss → core/src/ai/src/personalization.ts} +0 -0
- /package/{stacks/x-ray/src/desktop/styles/app.scss → core/src/ai/src/search.ts} +0 -0
- /package/core/{auth → src/auth}/src/index.ts +0 -0
- /package/core/{buddy → src/buddy}/src/index.ts +0 -0
- /package/core/{build → src/build}/web-types.config.cjs +0 -0
- /package/core/{cache → src/cache}/src/drivers/dynamodb.ts +0 -0
- /package/core/{chat → src/chat}/src/drivers/discord.ts +0 -0
- /package/core/{chat → src/chat}/src/drivers/slack.ts +0 -0
- /package/core/{chat → src/chat}/src/drivers/teams.ts +0 -0
- /package/core/{chat → src/chat}/src/index.ts +0 -0
- /package/core/{cli → src/cli}/src/actions/index.ts +0 -0
- /package/core/{cli → src/cli}/src/spinner.ts +0 -0
- /package/core/{collections → src/collections}/src/index.ts +0 -0
- /package/core/{datetime → src/datetime}/src/index.ts +0 -0
- /package/core/{email → src/email}/src/tailwind.config.ts +0 -0
- /package/core/{email → src/email}/src/utils/config.ts +0 -0
- /package/core/{email → src/email}/src/utils/template.html +0 -0
- /package/core/{faker → src/faker}/src/index.ts +0 -0
- /package/core/{lint → src/lint}/src/index.ts +0 -0
- /package/core/{notifications → src/notifications}/src/drivers/chat.ts +0 -0
- /package/core/{notifications → src/notifications}/src/drivers/email.ts +0 -0
- /package/core/{notifications → src/notifications}/src/drivers/push.ts +0 -0
- /package/core/{notifications → src/notifications}/src/drivers/sms.ts +0 -0
- /package/core/{notifications → src/notifications}/src/utils/template.html +0 -0
- /package/core/{payments → src/payments}/src/index.ts +0 -0
- /package/core/{query-builder → src/query-builder}/src/index.ts +0 -0
- /package/core/{repl → src/repl}/src/index.ts +0 -0
- /package/core/{security → src/security}/src/index.ts +0 -0
- /package/core/{signals → src/signals}/src/index.ts +0 -0
- /package/core/{sms → src/sms}/src/drivers/gupshup.ts +0 -0
- /package/core/{sms → src/sms}/src/drivers/nexmo.ts +0 -0
- /package/core/{sms → src/sms}/src/drivers/plivo.ts +0 -0
- /package/core/{sms → src/sms}/src/drivers/sms77.ts +0 -0
- /package/core/{sms → src/sms}/src/drivers/sns.ts +0 -0
- /package/core/{sms → src/sms}/src/drivers/telnyx.ts +0 -0
- /package/core/{sms → src/sms}/src/drivers/termii.ts +0 -0
- /package/core/{sms → src/sms}/src/drivers/twilio.ts +0 -0
- /package/core/{strings → src/strings}/src/is.ts +0 -0
- /package/{stacks → core/src}/tables/index.html +0 -0
- /package/core/{ai/src → src/tables/src/commands}/index.ts +0 -0
- /package/{stacks/tables/src/components/Demo.vue → core/src/tables/src/components/Demo.stx} +0 -0
- /package/{stacks/tables/src/components/TableCellActionItems.vue → core/src/tables/src/components/TableCellActionItems.stx} +0 -0
- /package/{stacks → core/src}/tables/src/functions/README.md +0 -0
- /package/{stacks → core/src}/tables/src/functions/dark.ts +0 -0
- /package/{stacks → core/src}/tables/src/functions/index.ts +0 -0
- /package/{stacks → core/src}/tables/src/functions/table.ts +0 -0
- /package/core/{analytics → src/tinker}/src/index.ts +0 -0
- /package/core/{types → src/types}/src/auto-imports.ts +0 -0
- /package/core/{types → src/types}/src/build.ts +0 -0
- /package/core/{types → src/types}/src/exit-code.ts +0 -0
- /package/core/{types → src/types}/src/i18n.ts +0 -0
- /package/core/{types → src/types}/src/inspect.ts +0 -0
- /package/core/{types → src/types}/src/manifest.ts +0 -0
- /package/core/{types → src/types}/src/pages.ts +0 -0
- /package/core/{types → src/types}/src/promise.ts +0 -0
- /package/core/{types → src/types}/src/pwa.ts +0 -0
- /package/core/{types → src/types}/src/reactivity.ts +0 -0
- /package/core/{types → src/types}/src/tables.ts +0 -0
- /package/core/{utils → src/utils}/src/currency.ts +0 -0
- /package/core/{utils → src/utils}/src/debounce.ts +0 -0
- /package/core/{utils → src/utils}/src/function.ts +0 -0
- /package/core/{utils → src/utils}/src/guards.ts +0 -0
- /package/core/{utils → src/utils}/src/p.ts +0 -0
- /package/core/{validation → src/validation}/src/index.ts +0 -0
- /package/{stacks → core/src}/x-ray/index.html +0 -0
- /package/{stacks → core/src}/x-ray/routes/index.ts +0 -0
- /package/{stacks → core/src}/x-ray/src/desktop/api/routes/api/logs.ts +0 -0
- /package/{stacks → core/src}/x-ray/src/desktop/api/routes/api/store-logs.ts +0 -0
- /package/{stacks → core/src}/x-ray/src/desktop/api/src/types.ts +0 -0
- /package/{stacks → core/src}/x-ray/src/desktop/functions/types.ts +0 -0
- /package/{stacks/x-ray/src/desktop/modules/counter/mod.vue → core/src/x-ray/src/desktop/modules/counter/mod.stx} +0 -0
- /package/{stacks/x-ray/src/desktop/modules/fetcher/mod.vue → core/src/x-ray/src/desktop/modules/fetcher/mod.stx} +0 -0
- /package/{stacks → core/src}/x-ray/src/desktop/plugins/unified/unified-app.ts +0 -0
- /package/{stacks → core/src}/x-ray/src/desktop/services/http.ts +0 -0
- /package/{stacks → core/src}/x-ray/src/ray.config.ts +0 -0
- /package/{stacks → core/src}/x-ray/src/types.ts +0 -0
|
@@ -0,0 +1,2781 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __toESM = (mod, isNodeMode, target) => {
|
|
8
|
+
target = mod != null ? __create(__getProtoOf(mod)) : {};
|
|
9
|
+
const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
|
|
10
|
+
for (let key of __getOwnPropNames(mod))
|
|
11
|
+
if (!__hasOwnProp.call(to, key))
|
|
12
|
+
__defProp(to, key, {
|
|
13
|
+
get: () => mod[key],
|
|
14
|
+
enumerable: true
|
|
15
|
+
});
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __require = (id) => {
|
|
19
|
+
return import.meta.require(id);
|
|
20
|
+
};
|
|
21
|
+
var __export = (target, all) => {
|
|
22
|
+
for (var name in all)
|
|
23
|
+
__defProp(target, name, {
|
|
24
|
+
get: all[name],
|
|
25
|
+
enumerable: true,
|
|
26
|
+
configurable: true,
|
|
27
|
+
set: (newValue) => all[name] = () => newValue
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
|
|
31
|
+
|
|
32
|
+
// /Users/chrisbreuer/Code/stacks/node_modules/js-yaml/dist/js-yaml.mjs
|
|
33
|
+
var exports_js_yaml = {};
|
|
34
|
+
__export(exports_js_yaml, {
|
|
35
|
+
types: () => {
|
|
36
|
+
{
|
|
37
|
+
return types;
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
safeLoadAll: () => {
|
|
41
|
+
{
|
|
42
|
+
return safeLoadAll;
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
safeLoad: () => {
|
|
46
|
+
{
|
|
47
|
+
return safeLoad;
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
safeDump: () => {
|
|
51
|
+
{
|
|
52
|
+
return safeDump;
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
loadAll: () => {
|
|
56
|
+
{
|
|
57
|
+
return loadAll;
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
load: () => {
|
|
61
|
+
{
|
|
62
|
+
return load;
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
dump: () => {
|
|
66
|
+
{
|
|
67
|
+
return dump;
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
default: () => {
|
|
71
|
+
{
|
|
72
|
+
return js_yaml_default;
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
YAMLException: () => {
|
|
76
|
+
{
|
|
77
|
+
return YAMLException;
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
Type: () => {
|
|
81
|
+
{
|
|
82
|
+
return Type;
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
Schema: () => {
|
|
86
|
+
{
|
|
87
|
+
return Schema;
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
JSON_SCHEMA: () => {
|
|
91
|
+
{
|
|
92
|
+
return JSON_SCHEMA;
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
FAILSAFE_SCHEMA: () => {
|
|
96
|
+
{
|
|
97
|
+
return FAILSAFE_SCHEMA;
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
DEFAULT_SCHEMA: () => {
|
|
101
|
+
{
|
|
102
|
+
return DEFAULT_SCHEMA;
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
CORE_SCHEMA: () => {
|
|
106
|
+
{
|
|
107
|
+
return CORE_SCHEMA;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
var isNothing, isObject, toArray, extend, repeat, isNegativeZero, formatError, YAMLException$1, getLine, padStart, makeSnippet, compileStyleAliases, Type$1, compileList, compileMap, Schema$1, resolveYamlNull, constructYamlNull, isNull, resolveYamlBoolean, constructYamlBoolean, isBoolean, isHexCode, isOctCode, isDecCode, resolveYamlInteger, constructYamlInteger, isInteger, resolveYamlFloat, constructYamlFloat, representYamlFloat, isFloat, resolveYamlTimestamp, constructYamlTimestamp, representYamlTimestamp, resolveYamlMerge, resolveYamlBinary, constructYamlBinary, representYamlBinary, isBinary, resolveYamlOmap, constructYamlOmap, resolveYamlPairs, constructYamlPairs, resolveYamlSet, constructYamlSet, _class, is_EOL, is_WHITE_SPACE, is_WS_OR_EOL, is_FLOW_INDICATOR, fromHexCode, escapedHexLen, fromDecimalCode, simpleEscapeSequence, charFromCodepoint, State$1, generateError, throwError, throwWarning, captureSegment, mergeMappings, storeMappingPair, readLineBreak, skipSeparationSpace, testDocumentSeparator, writeFoldedLines, readPlainScalar, readSingleQuotedScalar, readDoubleQuotedScalar, readFlowCollection, readBlockScalar, readBlockSequence, readBlockMapping, readTagProperty, readAnchorProperty, readAlias, composeNode, readDocument, loadDocuments, loadAll$1, load$1, compileStyleMap, encodeHex, State, indentString, generateNextLine, testImplicitResolving, isWhitespace, isPrintable, isNsCharOrWhitespace, isPlainSafe, isPlainSafeFirst, isPlainSafeLast, codePointAt, needIndentIndicator, chooseScalarStyle, writeScalar, blockHeader, dropEndingNewline, foldString, foldLine, escapeString, writeFlowSequence, writeBlockSequence, writeFlowMapping, writeBlockMapping, detectType, writeNode, getDuplicateReferences, inspectNode, dump$1, renamed, isNothing_1, isObject_1, toArray_1, repeat_1, isNegativeZero_1, extend_1, common, exception, snippet, TYPE_CONSTRUCTOR_OPTIONS, YAML_NODE_KINDS, type, schema, str, seq, map, failsafe, _null, bool, int, YAML_FLOAT_PATTERN, SCIENTIFIC_WITHOUT_DOT, float, json, core, YAML_DATE_REGEXP, YAML_TIMESTAMP_REGEXP, timestamp, merge, BASE64_MAP, binary, _hasOwnProperty$3, _toString$2, omap, _toString$1, pairs, _hasOwnProperty$2, set, _default, _hasOwnProperty$1, CONTEXT_FLOW_IN, CONTEXT_FLOW_OUT, CONTEXT_BLOCK_IN, CONTEXT_BLOCK_OUT, CHOMPING_CLIP, CHOMPING_STRIP, CHOMPING_KEEP, PATTERN_NON_PRINTABLE, PATTERN_NON_ASCII_LINE_BREAKS, PATTERN_FLOW_INDICATORS, PATTERN_TAG_HANDLE, PATTERN_TAG_URI, simpleEscapeCheck, simpleEscapeMap, i, directiveHandlers, loadAll_1, load_1, loader, _toString, _hasOwnProperty, CHAR_BOM, CHAR_TAB, CHAR_LINE_FEED, CHAR_CARRIAGE_RETURN, CHAR_SPACE, CHAR_EXCLAMATION, CHAR_DOUBLE_QUOTE, CHAR_SHARP, CHAR_PERCENT, CHAR_AMPERSAND, CHAR_SINGLE_QUOTE, CHAR_ASTERISK, CHAR_COMMA, CHAR_MINUS, CHAR_COLON, CHAR_EQUALS, CHAR_GREATER_THAN, CHAR_QUESTION, CHAR_COMMERCIAL_AT, CHAR_LEFT_SQUARE_BRACKET, CHAR_RIGHT_SQUARE_BRACKET, CHAR_GRAVE_ACCENT, CHAR_LEFT_CURLY_BRACKET, CHAR_VERTICAL_LINE, CHAR_RIGHT_CURLY_BRACKET, ESCAPE_SEQUENCES, DEPRECATED_BOOLEANS_SYNTAX, DEPRECATED_BASE60_SYNTAX, QUOTING_TYPE_SINGLE, QUOTING_TYPE_DOUBLE, STYLE_PLAIN, STYLE_SINGLE, STYLE_LITERAL, STYLE_FOLDED, STYLE_DOUBLE, dump_1, dumper, Type, Schema, FAILSAFE_SCHEMA, JSON_SCHEMA, CORE_SCHEMA, DEFAULT_SCHEMA, load, loadAll, dump, YAMLException, types, safeLoad, safeLoadAll, safeDump, jsYaml, js_yaml_default;
|
|
112
|
+
var init_js_yaml = __esm(() => {
|
|
113
|
+
isNothing = function(subject) {
|
|
114
|
+
return typeof subject === "undefined" || subject === null;
|
|
115
|
+
};
|
|
116
|
+
isObject = function(subject) {
|
|
117
|
+
return typeof subject === "object" && subject !== null;
|
|
118
|
+
};
|
|
119
|
+
toArray = function(sequence) {
|
|
120
|
+
if (Array.isArray(sequence))
|
|
121
|
+
return sequence;
|
|
122
|
+
else if (isNothing(sequence))
|
|
123
|
+
return [];
|
|
124
|
+
return [sequence];
|
|
125
|
+
};
|
|
126
|
+
extend = function(target, source) {
|
|
127
|
+
var index, length, key, sourceKeys;
|
|
128
|
+
if (source) {
|
|
129
|
+
sourceKeys = Object.keys(source);
|
|
130
|
+
for (index = 0, length = sourceKeys.length;index < length; index += 1) {
|
|
131
|
+
key = sourceKeys[index];
|
|
132
|
+
target[key] = source[key];
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
return target;
|
|
136
|
+
};
|
|
137
|
+
repeat = function(string, count) {
|
|
138
|
+
var result = "", cycle;
|
|
139
|
+
for (cycle = 0;cycle < count; cycle += 1) {
|
|
140
|
+
result += string;
|
|
141
|
+
}
|
|
142
|
+
return result;
|
|
143
|
+
};
|
|
144
|
+
isNegativeZero = function(number) {
|
|
145
|
+
return number === 0 && Number.NEGATIVE_INFINITY === 1 / number;
|
|
146
|
+
};
|
|
147
|
+
formatError = function(exception, compact) {
|
|
148
|
+
var where = "", message = exception.reason || "(unknown reason)";
|
|
149
|
+
if (!exception.mark)
|
|
150
|
+
return message;
|
|
151
|
+
if (exception.mark.name) {
|
|
152
|
+
where += 'in "' + exception.mark.name + '" ';
|
|
153
|
+
}
|
|
154
|
+
where += "(" + (exception.mark.line + 1) + ":" + (exception.mark.column + 1) + ")";
|
|
155
|
+
if (!compact && exception.mark.snippet) {
|
|
156
|
+
where += "\n\n" + exception.mark.snippet;
|
|
157
|
+
}
|
|
158
|
+
return message + " " + where;
|
|
159
|
+
};
|
|
160
|
+
YAMLException$1 = function(reason, mark) {
|
|
161
|
+
Error.call(this);
|
|
162
|
+
this.name = "YAMLException";
|
|
163
|
+
this.reason = reason;
|
|
164
|
+
this.mark = mark;
|
|
165
|
+
this.message = formatError(this, false);
|
|
166
|
+
if (Error.captureStackTrace) {
|
|
167
|
+
Error.captureStackTrace(this, this.constructor);
|
|
168
|
+
} else {
|
|
169
|
+
this.stack = new Error().stack || "";
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
getLine = function(buffer, lineStart, lineEnd, position, maxLineLength) {
|
|
173
|
+
var head = "";
|
|
174
|
+
var tail = "";
|
|
175
|
+
var maxHalfLength = Math.floor(maxLineLength / 2) - 1;
|
|
176
|
+
if (position - lineStart > maxHalfLength) {
|
|
177
|
+
head = " ... ";
|
|
178
|
+
lineStart = position - maxHalfLength + head.length;
|
|
179
|
+
}
|
|
180
|
+
if (lineEnd - position > maxHalfLength) {
|
|
181
|
+
tail = " ...";
|
|
182
|
+
lineEnd = position + maxHalfLength - tail.length;
|
|
183
|
+
}
|
|
184
|
+
return {
|
|
185
|
+
str: head + buffer.slice(lineStart, lineEnd).replace(/\t/g, "\u2192") + tail,
|
|
186
|
+
pos: position - lineStart + head.length
|
|
187
|
+
};
|
|
188
|
+
};
|
|
189
|
+
padStart = function(string, max) {
|
|
190
|
+
return common.repeat(" ", max - string.length) + string;
|
|
191
|
+
};
|
|
192
|
+
makeSnippet = function(mark, options) {
|
|
193
|
+
options = Object.create(options || null);
|
|
194
|
+
if (!mark.buffer)
|
|
195
|
+
return null;
|
|
196
|
+
if (!options.maxLength)
|
|
197
|
+
options.maxLength = 79;
|
|
198
|
+
if (typeof options.indent !== "number")
|
|
199
|
+
options.indent = 1;
|
|
200
|
+
if (typeof options.linesBefore !== "number")
|
|
201
|
+
options.linesBefore = 3;
|
|
202
|
+
if (typeof options.linesAfter !== "number")
|
|
203
|
+
options.linesAfter = 2;
|
|
204
|
+
var re = /\r?\n|\r|\0/g;
|
|
205
|
+
var lineStarts = [0];
|
|
206
|
+
var lineEnds = [];
|
|
207
|
+
var match;
|
|
208
|
+
var foundLineNo = -1;
|
|
209
|
+
while (match = re.exec(mark.buffer)) {
|
|
210
|
+
lineEnds.push(match.index);
|
|
211
|
+
lineStarts.push(match.index + match[0].length);
|
|
212
|
+
if (mark.position <= match.index && foundLineNo < 0) {
|
|
213
|
+
foundLineNo = lineStarts.length - 2;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
if (foundLineNo < 0)
|
|
217
|
+
foundLineNo = lineStarts.length - 1;
|
|
218
|
+
var result = "", i, line;
|
|
219
|
+
var lineNoLength = Math.min(mark.line + options.linesAfter, lineEnds.length).toString().length;
|
|
220
|
+
var maxLineLength = options.maxLength - (options.indent + lineNoLength + 3);
|
|
221
|
+
for (i = 1;i <= options.linesBefore; i++) {
|
|
222
|
+
if (foundLineNo - i < 0)
|
|
223
|
+
break;
|
|
224
|
+
line = getLine(mark.buffer, lineStarts[foundLineNo - i], lineEnds[foundLineNo - i], mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo - i]), maxLineLength);
|
|
225
|
+
result = common.repeat(" ", options.indent) + padStart((mark.line - i + 1).toString(), lineNoLength) + " | " + line.str + "\n" + result;
|
|
226
|
+
}
|
|
227
|
+
line = getLine(mark.buffer, lineStarts[foundLineNo], lineEnds[foundLineNo], mark.position, maxLineLength);
|
|
228
|
+
result += common.repeat(" ", options.indent) + padStart((mark.line + 1).toString(), lineNoLength) + " | " + line.str + "\n";
|
|
229
|
+
result += common.repeat("-", options.indent + lineNoLength + 3 + line.pos) + "^\n";
|
|
230
|
+
for (i = 1;i <= options.linesAfter; i++) {
|
|
231
|
+
if (foundLineNo + i >= lineEnds.length)
|
|
232
|
+
break;
|
|
233
|
+
line = getLine(mark.buffer, lineStarts[foundLineNo + i], lineEnds[foundLineNo + i], mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo + i]), maxLineLength);
|
|
234
|
+
result += common.repeat(" ", options.indent) + padStart((mark.line + i + 1).toString(), lineNoLength) + " | " + line.str + "\n";
|
|
235
|
+
}
|
|
236
|
+
return result.replace(/\n$/, "");
|
|
237
|
+
};
|
|
238
|
+
compileStyleAliases = function(map) {
|
|
239
|
+
var result = {};
|
|
240
|
+
if (map !== null) {
|
|
241
|
+
Object.keys(map).forEach(function(style) {
|
|
242
|
+
map[style].forEach(function(alias) {
|
|
243
|
+
result[String(alias)] = style;
|
|
244
|
+
});
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
return result;
|
|
248
|
+
};
|
|
249
|
+
Type$1 = function(tag, options) {
|
|
250
|
+
options = options || {};
|
|
251
|
+
Object.keys(options).forEach(function(name) {
|
|
252
|
+
if (TYPE_CONSTRUCTOR_OPTIONS.indexOf(name) === -1) {
|
|
253
|
+
throw new exception('Unknown option "' + name + '" is met in definition of "' + tag + '" YAML type.');
|
|
254
|
+
}
|
|
255
|
+
});
|
|
256
|
+
this.options = options;
|
|
257
|
+
this.tag = tag;
|
|
258
|
+
this.kind = options["kind"] || null;
|
|
259
|
+
this.resolve = options["resolve"] || function() {
|
|
260
|
+
return true;
|
|
261
|
+
};
|
|
262
|
+
this.construct = options["construct"] || function(data) {
|
|
263
|
+
return data;
|
|
264
|
+
};
|
|
265
|
+
this.instanceOf = options["instanceOf"] || null;
|
|
266
|
+
this.predicate = options["predicate"] || null;
|
|
267
|
+
this.represent = options["represent"] || null;
|
|
268
|
+
this.representName = options["representName"] || null;
|
|
269
|
+
this.defaultStyle = options["defaultStyle"] || null;
|
|
270
|
+
this.multi = options["multi"] || false;
|
|
271
|
+
this.styleAliases = compileStyleAliases(options["styleAliases"] || null);
|
|
272
|
+
if (YAML_NODE_KINDS.indexOf(this.kind) === -1) {
|
|
273
|
+
throw new exception('Unknown kind "' + this.kind + '" is specified for "' + tag + '" YAML type.');
|
|
274
|
+
}
|
|
275
|
+
};
|
|
276
|
+
compileList = function(schema, name) {
|
|
277
|
+
var result = [];
|
|
278
|
+
schema[name].forEach(function(currentType) {
|
|
279
|
+
var newIndex = result.length;
|
|
280
|
+
result.forEach(function(previousType, previousIndex) {
|
|
281
|
+
if (previousType.tag === currentType.tag && previousType.kind === currentType.kind && previousType.multi === currentType.multi) {
|
|
282
|
+
newIndex = previousIndex;
|
|
283
|
+
}
|
|
284
|
+
});
|
|
285
|
+
result[newIndex] = currentType;
|
|
286
|
+
});
|
|
287
|
+
return result;
|
|
288
|
+
};
|
|
289
|
+
compileMap = function() {
|
|
290
|
+
var result = {
|
|
291
|
+
scalar: {},
|
|
292
|
+
sequence: {},
|
|
293
|
+
mapping: {},
|
|
294
|
+
fallback: {},
|
|
295
|
+
multi: {
|
|
296
|
+
scalar: [],
|
|
297
|
+
sequence: [],
|
|
298
|
+
mapping: [],
|
|
299
|
+
fallback: []
|
|
300
|
+
}
|
|
301
|
+
}, index, length;
|
|
302
|
+
function collectType(type) {
|
|
303
|
+
if (type.multi) {
|
|
304
|
+
result.multi[type.kind].push(type);
|
|
305
|
+
result.multi["fallback"].push(type);
|
|
306
|
+
} else {
|
|
307
|
+
result[type.kind][type.tag] = result["fallback"][type.tag] = type;
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
for (index = 0, length = arguments.length;index < length; index += 1) {
|
|
311
|
+
arguments[index].forEach(collectType);
|
|
312
|
+
}
|
|
313
|
+
return result;
|
|
314
|
+
};
|
|
315
|
+
Schema$1 = function(definition) {
|
|
316
|
+
return this.extend(definition);
|
|
317
|
+
};
|
|
318
|
+
resolveYamlNull = function(data) {
|
|
319
|
+
if (data === null)
|
|
320
|
+
return true;
|
|
321
|
+
var max = data.length;
|
|
322
|
+
return max === 1 && data === "~" || max === 4 && (data === "null" || data === "Null" || data === "NULL");
|
|
323
|
+
};
|
|
324
|
+
constructYamlNull = function() {
|
|
325
|
+
return null;
|
|
326
|
+
};
|
|
327
|
+
isNull = function(object) {
|
|
328
|
+
return object === null;
|
|
329
|
+
};
|
|
330
|
+
resolveYamlBoolean = function(data) {
|
|
331
|
+
if (data === null)
|
|
332
|
+
return false;
|
|
333
|
+
var max = data.length;
|
|
334
|
+
return max === 4 && (data === "true" || data === "True" || data === "TRUE") || max === 5 && (data === "false" || data === "False" || data === "FALSE");
|
|
335
|
+
};
|
|
336
|
+
constructYamlBoolean = function(data) {
|
|
337
|
+
return data === "true" || data === "True" || data === "TRUE";
|
|
338
|
+
};
|
|
339
|
+
isBoolean = function(object) {
|
|
340
|
+
return Object.prototype.toString.call(object) === "[object Boolean]";
|
|
341
|
+
};
|
|
342
|
+
isHexCode = function(c) {
|
|
343
|
+
return 48 <= c && c <= 57 || 65 <= c && c <= 70 || 97 <= c && c <= 102;
|
|
344
|
+
};
|
|
345
|
+
isOctCode = function(c) {
|
|
346
|
+
return 48 <= c && c <= 55;
|
|
347
|
+
};
|
|
348
|
+
isDecCode = function(c) {
|
|
349
|
+
return 48 <= c && c <= 57;
|
|
350
|
+
};
|
|
351
|
+
resolveYamlInteger = function(data) {
|
|
352
|
+
if (data === null)
|
|
353
|
+
return false;
|
|
354
|
+
var max = data.length, index = 0, hasDigits = false, ch;
|
|
355
|
+
if (!max)
|
|
356
|
+
return false;
|
|
357
|
+
ch = data[index];
|
|
358
|
+
if (ch === "-" || ch === "+") {
|
|
359
|
+
ch = data[++index];
|
|
360
|
+
}
|
|
361
|
+
if (ch === "0") {
|
|
362
|
+
if (index + 1 === max)
|
|
363
|
+
return true;
|
|
364
|
+
ch = data[++index];
|
|
365
|
+
if (ch === "b") {
|
|
366
|
+
index++;
|
|
367
|
+
for (;index < max; index++) {
|
|
368
|
+
ch = data[index];
|
|
369
|
+
if (ch === "_")
|
|
370
|
+
continue;
|
|
371
|
+
if (ch !== "0" && ch !== "1")
|
|
372
|
+
return false;
|
|
373
|
+
hasDigits = true;
|
|
374
|
+
}
|
|
375
|
+
return hasDigits && ch !== "_";
|
|
376
|
+
}
|
|
377
|
+
if (ch === "x") {
|
|
378
|
+
index++;
|
|
379
|
+
for (;index < max; index++) {
|
|
380
|
+
ch = data[index];
|
|
381
|
+
if (ch === "_")
|
|
382
|
+
continue;
|
|
383
|
+
if (!isHexCode(data.charCodeAt(index)))
|
|
384
|
+
return false;
|
|
385
|
+
hasDigits = true;
|
|
386
|
+
}
|
|
387
|
+
return hasDigits && ch !== "_";
|
|
388
|
+
}
|
|
389
|
+
if (ch === "o") {
|
|
390
|
+
index++;
|
|
391
|
+
for (;index < max; index++) {
|
|
392
|
+
ch = data[index];
|
|
393
|
+
if (ch === "_")
|
|
394
|
+
continue;
|
|
395
|
+
if (!isOctCode(data.charCodeAt(index)))
|
|
396
|
+
return false;
|
|
397
|
+
hasDigits = true;
|
|
398
|
+
}
|
|
399
|
+
return hasDigits && ch !== "_";
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
if (ch === "_")
|
|
403
|
+
return false;
|
|
404
|
+
for (;index < max; index++) {
|
|
405
|
+
ch = data[index];
|
|
406
|
+
if (ch === "_")
|
|
407
|
+
continue;
|
|
408
|
+
if (!isDecCode(data.charCodeAt(index))) {
|
|
409
|
+
return false;
|
|
410
|
+
}
|
|
411
|
+
hasDigits = true;
|
|
412
|
+
}
|
|
413
|
+
if (!hasDigits || ch === "_")
|
|
414
|
+
return false;
|
|
415
|
+
return true;
|
|
416
|
+
};
|
|
417
|
+
constructYamlInteger = function(data) {
|
|
418
|
+
var value = data, sign = 1, ch;
|
|
419
|
+
if (value.indexOf("_") !== -1) {
|
|
420
|
+
value = value.replace(/_/g, "");
|
|
421
|
+
}
|
|
422
|
+
ch = value[0];
|
|
423
|
+
if (ch === "-" || ch === "+") {
|
|
424
|
+
if (ch === "-")
|
|
425
|
+
sign = -1;
|
|
426
|
+
value = value.slice(1);
|
|
427
|
+
ch = value[0];
|
|
428
|
+
}
|
|
429
|
+
if (value === "0")
|
|
430
|
+
return 0;
|
|
431
|
+
if (ch === "0") {
|
|
432
|
+
if (value[1] === "b")
|
|
433
|
+
return sign * parseInt(value.slice(2), 2);
|
|
434
|
+
if (value[1] === "x")
|
|
435
|
+
return sign * parseInt(value.slice(2), 16);
|
|
436
|
+
if (value[1] === "o")
|
|
437
|
+
return sign * parseInt(value.slice(2), 8);
|
|
438
|
+
}
|
|
439
|
+
return sign * parseInt(value, 10);
|
|
440
|
+
};
|
|
441
|
+
isInteger = function(object) {
|
|
442
|
+
return Object.prototype.toString.call(object) === "[object Number]" && (object % 1 === 0 && !common.isNegativeZero(object));
|
|
443
|
+
};
|
|
444
|
+
resolveYamlFloat = function(data) {
|
|
445
|
+
if (data === null)
|
|
446
|
+
return false;
|
|
447
|
+
if (!YAML_FLOAT_PATTERN.test(data) || data[data.length - 1] === "_") {
|
|
448
|
+
return false;
|
|
449
|
+
}
|
|
450
|
+
return true;
|
|
451
|
+
};
|
|
452
|
+
constructYamlFloat = function(data) {
|
|
453
|
+
var value, sign;
|
|
454
|
+
value = data.replace(/_/g, "").toLowerCase();
|
|
455
|
+
sign = value[0] === "-" ? -1 : 1;
|
|
456
|
+
if ("+-".indexOf(value[0]) >= 0) {
|
|
457
|
+
value = value.slice(1);
|
|
458
|
+
}
|
|
459
|
+
if (value === ".inf") {
|
|
460
|
+
return sign === 1 ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY;
|
|
461
|
+
} else if (value === ".nan") {
|
|
462
|
+
return NaN;
|
|
463
|
+
}
|
|
464
|
+
return sign * parseFloat(value, 10);
|
|
465
|
+
};
|
|
466
|
+
representYamlFloat = function(object, style) {
|
|
467
|
+
var res;
|
|
468
|
+
if (isNaN(object)) {
|
|
469
|
+
switch (style) {
|
|
470
|
+
case "lowercase":
|
|
471
|
+
return ".nan";
|
|
472
|
+
case "uppercase":
|
|
473
|
+
return ".NAN";
|
|
474
|
+
case "camelcase":
|
|
475
|
+
return ".NaN";
|
|
476
|
+
}
|
|
477
|
+
} else if (Number.POSITIVE_INFINITY === object) {
|
|
478
|
+
switch (style) {
|
|
479
|
+
case "lowercase":
|
|
480
|
+
return ".inf";
|
|
481
|
+
case "uppercase":
|
|
482
|
+
return ".INF";
|
|
483
|
+
case "camelcase":
|
|
484
|
+
return ".Inf";
|
|
485
|
+
}
|
|
486
|
+
} else if (Number.NEGATIVE_INFINITY === object) {
|
|
487
|
+
switch (style) {
|
|
488
|
+
case "lowercase":
|
|
489
|
+
return "-.inf";
|
|
490
|
+
case "uppercase":
|
|
491
|
+
return "-.INF";
|
|
492
|
+
case "camelcase":
|
|
493
|
+
return "-.Inf";
|
|
494
|
+
}
|
|
495
|
+
} else if (common.isNegativeZero(object)) {
|
|
496
|
+
return "-0.0";
|
|
497
|
+
}
|
|
498
|
+
res = object.toString(10);
|
|
499
|
+
return SCIENTIFIC_WITHOUT_DOT.test(res) ? res.replace("e", ".e") : res;
|
|
500
|
+
};
|
|
501
|
+
isFloat = function(object) {
|
|
502
|
+
return Object.prototype.toString.call(object) === "[object Number]" && (object % 1 !== 0 || common.isNegativeZero(object));
|
|
503
|
+
};
|
|
504
|
+
resolveYamlTimestamp = function(data) {
|
|
505
|
+
if (data === null)
|
|
506
|
+
return false;
|
|
507
|
+
if (YAML_DATE_REGEXP.exec(data) !== null)
|
|
508
|
+
return true;
|
|
509
|
+
if (YAML_TIMESTAMP_REGEXP.exec(data) !== null)
|
|
510
|
+
return true;
|
|
511
|
+
return false;
|
|
512
|
+
};
|
|
513
|
+
constructYamlTimestamp = function(data) {
|
|
514
|
+
var match, year, month, day, hour, minute, second, fraction = 0, delta = null, tz_hour, tz_minute, date;
|
|
515
|
+
match = YAML_DATE_REGEXP.exec(data);
|
|
516
|
+
if (match === null)
|
|
517
|
+
match = YAML_TIMESTAMP_REGEXP.exec(data);
|
|
518
|
+
if (match === null)
|
|
519
|
+
throw new Error("Date resolve error");
|
|
520
|
+
year = +match[1];
|
|
521
|
+
month = +match[2] - 1;
|
|
522
|
+
day = +match[3];
|
|
523
|
+
if (!match[4]) {
|
|
524
|
+
return new Date(Date.UTC(year, month, day));
|
|
525
|
+
}
|
|
526
|
+
hour = +match[4];
|
|
527
|
+
minute = +match[5];
|
|
528
|
+
second = +match[6];
|
|
529
|
+
if (match[7]) {
|
|
530
|
+
fraction = match[7].slice(0, 3);
|
|
531
|
+
while (fraction.length < 3) {
|
|
532
|
+
fraction += "0";
|
|
533
|
+
}
|
|
534
|
+
fraction = +fraction;
|
|
535
|
+
}
|
|
536
|
+
if (match[9]) {
|
|
537
|
+
tz_hour = +match[10];
|
|
538
|
+
tz_minute = +(match[11] || 0);
|
|
539
|
+
delta = (tz_hour * 60 + tz_minute) * 60000;
|
|
540
|
+
if (match[9] === "-")
|
|
541
|
+
delta = -delta;
|
|
542
|
+
}
|
|
543
|
+
date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction));
|
|
544
|
+
if (delta)
|
|
545
|
+
date.setTime(date.getTime() - delta);
|
|
546
|
+
return date;
|
|
547
|
+
};
|
|
548
|
+
representYamlTimestamp = function(object) {
|
|
549
|
+
return object.toISOString();
|
|
550
|
+
};
|
|
551
|
+
resolveYamlMerge = function(data) {
|
|
552
|
+
return data === "<<" || data === null;
|
|
553
|
+
};
|
|
554
|
+
resolveYamlBinary = function(data) {
|
|
555
|
+
if (data === null)
|
|
556
|
+
return false;
|
|
557
|
+
var code, idx, bitlen = 0, max = data.length, map = BASE64_MAP;
|
|
558
|
+
for (idx = 0;idx < max; idx++) {
|
|
559
|
+
code = map.indexOf(data.charAt(idx));
|
|
560
|
+
if (code > 64)
|
|
561
|
+
continue;
|
|
562
|
+
if (code < 0)
|
|
563
|
+
return false;
|
|
564
|
+
bitlen += 6;
|
|
565
|
+
}
|
|
566
|
+
return bitlen % 8 === 0;
|
|
567
|
+
};
|
|
568
|
+
constructYamlBinary = function(data) {
|
|
569
|
+
var idx, tailbits, input = data.replace(/[\r\n=]/g, ""), max = input.length, map = BASE64_MAP, bits = 0, result = [];
|
|
570
|
+
for (idx = 0;idx < max; idx++) {
|
|
571
|
+
if (idx % 4 === 0 && idx) {
|
|
572
|
+
result.push(bits >> 16 & 255);
|
|
573
|
+
result.push(bits >> 8 & 255);
|
|
574
|
+
result.push(bits & 255);
|
|
575
|
+
}
|
|
576
|
+
bits = bits << 6 | map.indexOf(input.charAt(idx));
|
|
577
|
+
}
|
|
578
|
+
tailbits = max % 4 * 6;
|
|
579
|
+
if (tailbits === 0) {
|
|
580
|
+
result.push(bits >> 16 & 255);
|
|
581
|
+
result.push(bits >> 8 & 255);
|
|
582
|
+
result.push(bits & 255);
|
|
583
|
+
} else if (tailbits === 18) {
|
|
584
|
+
result.push(bits >> 10 & 255);
|
|
585
|
+
result.push(bits >> 2 & 255);
|
|
586
|
+
} else if (tailbits === 12) {
|
|
587
|
+
result.push(bits >> 4 & 255);
|
|
588
|
+
}
|
|
589
|
+
return new Uint8Array(result);
|
|
590
|
+
};
|
|
591
|
+
representYamlBinary = function(object) {
|
|
592
|
+
var result = "", bits = 0, idx, tail, max = object.length, map = BASE64_MAP;
|
|
593
|
+
for (idx = 0;idx < max; idx++) {
|
|
594
|
+
if (idx % 3 === 0 && idx) {
|
|
595
|
+
result += map[bits >> 18 & 63];
|
|
596
|
+
result += map[bits >> 12 & 63];
|
|
597
|
+
result += map[bits >> 6 & 63];
|
|
598
|
+
result += map[bits & 63];
|
|
599
|
+
}
|
|
600
|
+
bits = (bits << 8) + object[idx];
|
|
601
|
+
}
|
|
602
|
+
tail = max % 3;
|
|
603
|
+
if (tail === 0) {
|
|
604
|
+
result += map[bits >> 18 & 63];
|
|
605
|
+
result += map[bits >> 12 & 63];
|
|
606
|
+
result += map[bits >> 6 & 63];
|
|
607
|
+
result += map[bits & 63];
|
|
608
|
+
} else if (tail === 2) {
|
|
609
|
+
result += map[bits >> 10 & 63];
|
|
610
|
+
result += map[bits >> 4 & 63];
|
|
611
|
+
result += map[bits << 2 & 63];
|
|
612
|
+
result += map[64];
|
|
613
|
+
} else if (tail === 1) {
|
|
614
|
+
result += map[bits >> 2 & 63];
|
|
615
|
+
result += map[bits << 4 & 63];
|
|
616
|
+
result += map[64];
|
|
617
|
+
result += map[64];
|
|
618
|
+
}
|
|
619
|
+
return result;
|
|
620
|
+
};
|
|
621
|
+
isBinary = function(obj) {
|
|
622
|
+
return Object.prototype.toString.call(obj) === "[object Uint8Array]";
|
|
623
|
+
};
|
|
624
|
+
resolveYamlOmap = function(data) {
|
|
625
|
+
if (data === null)
|
|
626
|
+
return true;
|
|
627
|
+
var objectKeys = [], index, length, pair, pairKey, pairHasKey, object = data;
|
|
628
|
+
for (index = 0, length = object.length;index < length; index += 1) {
|
|
629
|
+
pair = object[index];
|
|
630
|
+
pairHasKey = false;
|
|
631
|
+
if (_toString$2.call(pair) !== "[object Object]")
|
|
632
|
+
return false;
|
|
633
|
+
for (pairKey in pair) {
|
|
634
|
+
if (_hasOwnProperty$3.call(pair, pairKey)) {
|
|
635
|
+
if (!pairHasKey)
|
|
636
|
+
pairHasKey = true;
|
|
637
|
+
else
|
|
638
|
+
return false;
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
if (!pairHasKey)
|
|
642
|
+
return false;
|
|
643
|
+
if (objectKeys.indexOf(pairKey) === -1)
|
|
644
|
+
objectKeys.push(pairKey);
|
|
645
|
+
else
|
|
646
|
+
return false;
|
|
647
|
+
}
|
|
648
|
+
return true;
|
|
649
|
+
};
|
|
650
|
+
constructYamlOmap = function(data) {
|
|
651
|
+
return data !== null ? data : [];
|
|
652
|
+
};
|
|
653
|
+
resolveYamlPairs = function(data) {
|
|
654
|
+
if (data === null)
|
|
655
|
+
return true;
|
|
656
|
+
var index, length, pair, keys, result, object = data;
|
|
657
|
+
result = new Array(object.length);
|
|
658
|
+
for (index = 0, length = object.length;index < length; index += 1) {
|
|
659
|
+
pair = object[index];
|
|
660
|
+
if (_toString$1.call(pair) !== "[object Object]")
|
|
661
|
+
return false;
|
|
662
|
+
keys = Object.keys(pair);
|
|
663
|
+
if (keys.length !== 1)
|
|
664
|
+
return false;
|
|
665
|
+
result[index] = [keys[0], pair[keys[0]]];
|
|
666
|
+
}
|
|
667
|
+
return true;
|
|
668
|
+
};
|
|
669
|
+
constructYamlPairs = function(data) {
|
|
670
|
+
if (data === null)
|
|
671
|
+
return [];
|
|
672
|
+
var index, length, pair, keys, result, object = data;
|
|
673
|
+
result = new Array(object.length);
|
|
674
|
+
for (index = 0, length = object.length;index < length; index += 1) {
|
|
675
|
+
pair = object[index];
|
|
676
|
+
keys = Object.keys(pair);
|
|
677
|
+
result[index] = [keys[0], pair[keys[0]]];
|
|
678
|
+
}
|
|
679
|
+
return result;
|
|
680
|
+
};
|
|
681
|
+
resolveYamlSet = function(data) {
|
|
682
|
+
if (data === null)
|
|
683
|
+
return true;
|
|
684
|
+
var key, object = data;
|
|
685
|
+
for (key in object) {
|
|
686
|
+
if (_hasOwnProperty$2.call(object, key)) {
|
|
687
|
+
if (object[key] !== null)
|
|
688
|
+
return false;
|
|
689
|
+
}
|
|
690
|
+
}
|
|
691
|
+
return true;
|
|
692
|
+
};
|
|
693
|
+
constructYamlSet = function(data) {
|
|
694
|
+
return data !== null ? data : {};
|
|
695
|
+
};
|
|
696
|
+
_class = function(obj) {
|
|
697
|
+
return Object.prototype.toString.call(obj);
|
|
698
|
+
};
|
|
699
|
+
is_EOL = function(c) {
|
|
700
|
+
return c === 10 || c === 13;
|
|
701
|
+
};
|
|
702
|
+
is_WHITE_SPACE = function(c) {
|
|
703
|
+
return c === 9 || c === 32;
|
|
704
|
+
};
|
|
705
|
+
is_WS_OR_EOL = function(c) {
|
|
706
|
+
return c === 9 || c === 32 || c === 10 || c === 13;
|
|
707
|
+
};
|
|
708
|
+
is_FLOW_INDICATOR = function(c) {
|
|
709
|
+
return c === 44 || c === 91 || c === 93 || c === 123 || c === 125;
|
|
710
|
+
};
|
|
711
|
+
fromHexCode = function(c) {
|
|
712
|
+
var lc;
|
|
713
|
+
if (48 <= c && c <= 57) {
|
|
714
|
+
return c - 48;
|
|
715
|
+
}
|
|
716
|
+
lc = c | 32;
|
|
717
|
+
if (97 <= lc && lc <= 102) {
|
|
718
|
+
return lc - 97 + 10;
|
|
719
|
+
}
|
|
720
|
+
return -1;
|
|
721
|
+
};
|
|
722
|
+
escapedHexLen = function(c) {
|
|
723
|
+
if (c === 120) {
|
|
724
|
+
return 2;
|
|
725
|
+
}
|
|
726
|
+
if (c === 117) {
|
|
727
|
+
return 4;
|
|
728
|
+
}
|
|
729
|
+
if (c === 85) {
|
|
730
|
+
return 8;
|
|
731
|
+
}
|
|
732
|
+
return 0;
|
|
733
|
+
};
|
|
734
|
+
fromDecimalCode = function(c) {
|
|
735
|
+
if (48 <= c && c <= 57) {
|
|
736
|
+
return c - 48;
|
|
737
|
+
}
|
|
738
|
+
return -1;
|
|
739
|
+
};
|
|
740
|
+
simpleEscapeSequence = function(c) {
|
|
741
|
+
return c === 48 ? "\0" : c === 97 ? "\x07" : c === 98 ? "\b" : c === 116 ? "\t" : c === 9 ? "\t" : c === 110 ? `
|
|
742
|
+
` : c === 118 ? "\v" : c === 102 ? "\f" : c === 114 ? `\r` : c === 101 ? "\x1B" : c === 32 ? " " : c === 34 ? '"' : c === 47 ? "/" : c === 92 ? "\\" : c === 78 ? "\x85" : c === 95 ? "\xA0" : c === 76 ? "\u2028" : c === 80 ? "\u2029" : "";
|
|
743
|
+
};
|
|
744
|
+
charFromCodepoint = function(c) {
|
|
745
|
+
if (c <= 65535) {
|
|
746
|
+
return String.fromCharCode(c);
|
|
747
|
+
}
|
|
748
|
+
return String.fromCharCode((c - 65536 >> 10) + 55296, (c - 65536 & 1023) + 56320);
|
|
749
|
+
};
|
|
750
|
+
State$1 = function(input, options) {
|
|
751
|
+
this.input = input;
|
|
752
|
+
this.filename = options["filename"] || null;
|
|
753
|
+
this.schema = options["schema"] || _default;
|
|
754
|
+
this.onWarning = options["onWarning"] || null;
|
|
755
|
+
this.legacy = options["legacy"] || false;
|
|
756
|
+
this.json = options["json"] || false;
|
|
757
|
+
this.listener = options["listener"] || null;
|
|
758
|
+
this.implicitTypes = this.schema.compiledImplicit;
|
|
759
|
+
this.typeMap = this.schema.compiledTypeMap;
|
|
760
|
+
this.length = input.length;
|
|
761
|
+
this.position = 0;
|
|
762
|
+
this.line = 0;
|
|
763
|
+
this.lineStart = 0;
|
|
764
|
+
this.lineIndent = 0;
|
|
765
|
+
this.firstTabInLine = -1;
|
|
766
|
+
this.documents = [];
|
|
767
|
+
};
|
|
768
|
+
generateError = function(state, message) {
|
|
769
|
+
var mark = {
|
|
770
|
+
name: state.filename,
|
|
771
|
+
buffer: state.input.slice(0, -1),
|
|
772
|
+
position: state.position,
|
|
773
|
+
line: state.line,
|
|
774
|
+
column: state.position - state.lineStart
|
|
775
|
+
};
|
|
776
|
+
mark.snippet = snippet(mark);
|
|
777
|
+
return new exception(message, mark);
|
|
778
|
+
};
|
|
779
|
+
throwError = function(state, message) {
|
|
780
|
+
throw generateError(state, message);
|
|
781
|
+
};
|
|
782
|
+
throwWarning = function(state, message) {
|
|
783
|
+
if (state.onWarning) {
|
|
784
|
+
state.onWarning.call(null, generateError(state, message));
|
|
785
|
+
}
|
|
786
|
+
};
|
|
787
|
+
captureSegment = function(state, start, end, checkJson) {
|
|
788
|
+
var _position, _length, _character, _result;
|
|
789
|
+
if (start < end) {
|
|
790
|
+
_result = state.input.slice(start, end);
|
|
791
|
+
if (checkJson) {
|
|
792
|
+
for (_position = 0, _length = _result.length;_position < _length; _position += 1) {
|
|
793
|
+
_character = _result.charCodeAt(_position);
|
|
794
|
+
if (!(_character === 9 || 32 <= _character && _character <= 1114111)) {
|
|
795
|
+
throwError(state, "expected valid JSON character");
|
|
796
|
+
}
|
|
797
|
+
}
|
|
798
|
+
} else if (PATTERN_NON_PRINTABLE.test(_result)) {
|
|
799
|
+
throwError(state, "the stream contains non-printable characters");
|
|
800
|
+
}
|
|
801
|
+
state.result += _result;
|
|
802
|
+
}
|
|
803
|
+
};
|
|
804
|
+
mergeMappings = function(state, destination, source, overridableKeys) {
|
|
805
|
+
var sourceKeys, key, index, quantity;
|
|
806
|
+
if (!common.isObject(source)) {
|
|
807
|
+
throwError(state, "cannot merge mappings; the provided source object is unacceptable");
|
|
808
|
+
}
|
|
809
|
+
sourceKeys = Object.keys(source);
|
|
810
|
+
for (index = 0, quantity = sourceKeys.length;index < quantity; index += 1) {
|
|
811
|
+
key = sourceKeys[index];
|
|
812
|
+
if (!_hasOwnProperty$1.call(destination, key)) {
|
|
813
|
+
destination[key] = source[key];
|
|
814
|
+
overridableKeys[key] = true;
|
|
815
|
+
}
|
|
816
|
+
}
|
|
817
|
+
};
|
|
818
|
+
storeMappingPair = function(state, _result, overridableKeys, keyTag, keyNode, valueNode, startLine, startLineStart, startPos) {
|
|
819
|
+
var index, quantity;
|
|
820
|
+
if (Array.isArray(keyNode)) {
|
|
821
|
+
keyNode = Array.prototype.slice.call(keyNode);
|
|
822
|
+
for (index = 0, quantity = keyNode.length;index < quantity; index += 1) {
|
|
823
|
+
if (Array.isArray(keyNode[index])) {
|
|
824
|
+
throwError(state, "nested arrays are not supported inside keys");
|
|
825
|
+
}
|
|
826
|
+
if (typeof keyNode === "object" && _class(keyNode[index]) === "[object Object]") {
|
|
827
|
+
keyNode[index] = "[object Object]";
|
|
828
|
+
}
|
|
829
|
+
}
|
|
830
|
+
}
|
|
831
|
+
if (typeof keyNode === "object" && _class(keyNode) === "[object Object]") {
|
|
832
|
+
keyNode = "[object Object]";
|
|
833
|
+
}
|
|
834
|
+
keyNode = String(keyNode);
|
|
835
|
+
if (_result === null) {
|
|
836
|
+
_result = {};
|
|
837
|
+
}
|
|
838
|
+
if (keyTag === "tag:yaml.org,2002:merge") {
|
|
839
|
+
if (Array.isArray(valueNode)) {
|
|
840
|
+
for (index = 0, quantity = valueNode.length;index < quantity; index += 1) {
|
|
841
|
+
mergeMappings(state, _result, valueNode[index], overridableKeys);
|
|
842
|
+
}
|
|
843
|
+
} else {
|
|
844
|
+
mergeMappings(state, _result, valueNode, overridableKeys);
|
|
845
|
+
}
|
|
846
|
+
} else {
|
|
847
|
+
if (!state.json && !_hasOwnProperty$1.call(overridableKeys, keyNode) && _hasOwnProperty$1.call(_result, keyNode)) {
|
|
848
|
+
state.line = startLine || state.line;
|
|
849
|
+
state.lineStart = startLineStart || state.lineStart;
|
|
850
|
+
state.position = startPos || state.position;
|
|
851
|
+
throwError(state, "duplicated mapping key");
|
|
852
|
+
}
|
|
853
|
+
if (keyNode === "__proto__") {
|
|
854
|
+
Object.defineProperty(_result, keyNode, {
|
|
855
|
+
configurable: true,
|
|
856
|
+
enumerable: true,
|
|
857
|
+
writable: true,
|
|
858
|
+
value: valueNode
|
|
859
|
+
});
|
|
860
|
+
} else {
|
|
861
|
+
_result[keyNode] = valueNode;
|
|
862
|
+
}
|
|
863
|
+
delete overridableKeys[keyNode];
|
|
864
|
+
}
|
|
865
|
+
return _result;
|
|
866
|
+
};
|
|
867
|
+
readLineBreak = function(state) {
|
|
868
|
+
var ch;
|
|
869
|
+
ch = state.input.charCodeAt(state.position);
|
|
870
|
+
if (ch === 10) {
|
|
871
|
+
state.position++;
|
|
872
|
+
} else if (ch === 13) {
|
|
873
|
+
state.position++;
|
|
874
|
+
if (state.input.charCodeAt(state.position) === 10) {
|
|
875
|
+
state.position++;
|
|
876
|
+
}
|
|
877
|
+
} else {
|
|
878
|
+
throwError(state, "a line break is expected");
|
|
879
|
+
}
|
|
880
|
+
state.line += 1;
|
|
881
|
+
state.lineStart = state.position;
|
|
882
|
+
state.firstTabInLine = -1;
|
|
883
|
+
};
|
|
884
|
+
skipSeparationSpace = function(state, allowComments, checkIndent) {
|
|
885
|
+
var lineBreaks = 0, ch = state.input.charCodeAt(state.position);
|
|
886
|
+
while (ch !== 0) {
|
|
887
|
+
while (is_WHITE_SPACE(ch)) {
|
|
888
|
+
if (ch === 9 && state.firstTabInLine === -1) {
|
|
889
|
+
state.firstTabInLine = state.position;
|
|
890
|
+
}
|
|
891
|
+
ch = state.input.charCodeAt(++state.position);
|
|
892
|
+
}
|
|
893
|
+
if (allowComments && ch === 35) {
|
|
894
|
+
do {
|
|
895
|
+
ch = state.input.charCodeAt(++state.position);
|
|
896
|
+
} while (ch !== 10 && ch !== 13 && ch !== 0);
|
|
897
|
+
}
|
|
898
|
+
if (is_EOL(ch)) {
|
|
899
|
+
readLineBreak(state);
|
|
900
|
+
ch = state.input.charCodeAt(state.position);
|
|
901
|
+
lineBreaks++;
|
|
902
|
+
state.lineIndent = 0;
|
|
903
|
+
while (ch === 32) {
|
|
904
|
+
state.lineIndent++;
|
|
905
|
+
ch = state.input.charCodeAt(++state.position);
|
|
906
|
+
}
|
|
907
|
+
} else {
|
|
908
|
+
break;
|
|
909
|
+
}
|
|
910
|
+
}
|
|
911
|
+
if (checkIndent !== -1 && lineBreaks !== 0 && state.lineIndent < checkIndent) {
|
|
912
|
+
throwWarning(state, "deficient indentation");
|
|
913
|
+
}
|
|
914
|
+
return lineBreaks;
|
|
915
|
+
};
|
|
916
|
+
testDocumentSeparator = function(state) {
|
|
917
|
+
var _position = state.position, ch;
|
|
918
|
+
ch = state.input.charCodeAt(_position);
|
|
919
|
+
if ((ch === 45 || ch === 46) && ch === state.input.charCodeAt(_position + 1) && ch === state.input.charCodeAt(_position + 2)) {
|
|
920
|
+
_position += 3;
|
|
921
|
+
ch = state.input.charCodeAt(_position);
|
|
922
|
+
if (ch === 0 || is_WS_OR_EOL(ch)) {
|
|
923
|
+
return true;
|
|
924
|
+
}
|
|
925
|
+
}
|
|
926
|
+
return false;
|
|
927
|
+
};
|
|
928
|
+
writeFoldedLines = function(state, count) {
|
|
929
|
+
if (count === 1) {
|
|
930
|
+
state.result += " ";
|
|
931
|
+
} else if (count > 1) {
|
|
932
|
+
state.result += common.repeat("\n", count - 1);
|
|
933
|
+
}
|
|
934
|
+
};
|
|
935
|
+
readPlainScalar = function(state, nodeIndent, withinFlowCollection) {
|
|
936
|
+
var preceding, following, captureStart, captureEnd, hasPendingContent, _line, _lineStart, _lineIndent, _kind = state.kind, _result = state.result, ch;
|
|
937
|
+
ch = state.input.charCodeAt(state.position);
|
|
938
|
+
if (is_WS_OR_EOL(ch) || is_FLOW_INDICATOR(ch) || ch === 35 || ch === 38 || ch === 42 || ch === 33 || ch === 124 || ch === 62 || ch === 39 || ch === 34 || ch === 37 || ch === 64 || ch === 96) {
|
|
939
|
+
return false;
|
|
940
|
+
}
|
|
941
|
+
if (ch === 63 || ch === 45) {
|
|
942
|
+
following = state.input.charCodeAt(state.position + 1);
|
|
943
|
+
if (is_WS_OR_EOL(following) || withinFlowCollection && is_FLOW_INDICATOR(following)) {
|
|
944
|
+
return false;
|
|
945
|
+
}
|
|
946
|
+
}
|
|
947
|
+
state.kind = "scalar";
|
|
948
|
+
state.result = "";
|
|
949
|
+
captureStart = captureEnd = state.position;
|
|
950
|
+
hasPendingContent = false;
|
|
951
|
+
while (ch !== 0) {
|
|
952
|
+
if (ch === 58) {
|
|
953
|
+
following = state.input.charCodeAt(state.position + 1);
|
|
954
|
+
if (is_WS_OR_EOL(following) || withinFlowCollection && is_FLOW_INDICATOR(following)) {
|
|
955
|
+
break;
|
|
956
|
+
}
|
|
957
|
+
} else if (ch === 35) {
|
|
958
|
+
preceding = state.input.charCodeAt(state.position - 1);
|
|
959
|
+
if (is_WS_OR_EOL(preceding)) {
|
|
960
|
+
break;
|
|
961
|
+
}
|
|
962
|
+
} else if (state.position === state.lineStart && testDocumentSeparator(state) || withinFlowCollection && is_FLOW_INDICATOR(ch)) {
|
|
963
|
+
break;
|
|
964
|
+
} else if (is_EOL(ch)) {
|
|
965
|
+
_line = state.line;
|
|
966
|
+
_lineStart = state.lineStart;
|
|
967
|
+
_lineIndent = state.lineIndent;
|
|
968
|
+
skipSeparationSpace(state, false, -1);
|
|
969
|
+
if (state.lineIndent >= nodeIndent) {
|
|
970
|
+
hasPendingContent = true;
|
|
971
|
+
ch = state.input.charCodeAt(state.position);
|
|
972
|
+
continue;
|
|
973
|
+
} else {
|
|
974
|
+
state.position = captureEnd;
|
|
975
|
+
state.line = _line;
|
|
976
|
+
state.lineStart = _lineStart;
|
|
977
|
+
state.lineIndent = _lineIndent;
|
|
978
|
+
break;
|
|
979
|
+
}
|
|
980
|
+
}
|
|
981
|
+
if (hasPendingContent) {
|
|
982
|
+
captureSegment(state, captureStart, captureEnd, false);
|
|
983
|
+
writeFoldedLines(state, state.line - _line);
|
|
984
|
+
captureStart = captureEnd = state.position;
|
|
985
|
+
hasPendingContent = false;
|
|
986
|
+
}
|
|
987
|
+
if (!is_WHITE_SPACE(ch)) {
|
|
988
|
+
captureEnd = state.position + 1;
|
|
989
|
+
}
|
|
990
|
+
ch = state.input.charCodeAt(++state.position);
|
|
991
|
+
}
|
|
992
|
+
captureSegment(state, captureStart, captureEnd, false);
|
|
993
|
+
if (state.result) {
|
|
994
|
+
return true;
|
|
995
|
+
}
|
|
996
|
+
state.kind = _kind;
|
|
997
|
+
state.result = _result;
|
|
998
|
+
return false;
|
|
999
|
+
};
|
|
1000
|
+
readSingleQuotedScalar = function(state, nodeIndent) {
|
|
1001
|
+
var ch, captureStart, captureEnd;
|
|
1002
|
+
ch = state.input.charCodeAt(state.position);
|
|
1003
|
+
if (ch !== 39) {
|
|
1004
|
+
return false;
|
|
1005
|
+
}
|
|
1006
|
+
state.kind = "scalar";
|
|
1007
|
+
state.result = "";
|
|
1008
|
+
state.position++;
|
|
1009
|
+
captureStart = captureEnd = state.position;
|
|
1010
|
+
while ((ch = state.input.charCodeAt(state.position)) !== 0) {
|
|
1011
|
+
if (ch === 39) {
|
|
1012
|
+
captureSegment(state, captureStart, state.position, true);
|
|
1013
|
+
ch = state.input.charCodeAt(++state.position);
|
|
1014
|
+
if (ch === 39) {
|
|
1015
|
+
captureStart = state.position;
|
|
1016
|
+
state.position++;
|
|
1017
|
+
captureEnd = state.position;
|
|
1018
|
+
} else {
|
|
1019
|
+
return true;
|
|
1020
|
+
}
|
|
1021
|
+
} else if (is_EOL(ch)) {
|
|
1022
|
+
captureSegment(state, captureStart, captureEnd, true);
|
|
1023
|
+
writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent));
|
|
1024
|
+
captureStart = captureEnd = state.position;
|
|
1025
|
+
} else if (state.position === state.lineStart && testDocumentSeparator(state)) {
|
|
1026
|
+
throwError(state, "unexpected end of the document within a single quoted scalar");
|
|
1027
|
+
} else {
|
|
1028
|
+
state.position++;
|
|
1029
|
+
captureEnd = state.position;
|
|
1030
|
+
}
|
|
1031
|
+
}
|
|
1032
|
+
throwError(state, "unexpected end of the stream within a single quoted scalar");
|
|
1033
|
+
};
|
|
1034
|
+
readDoubleQuotedScalar = function(state, nodeIndent) {
|
|
1035
|
+
var captureStart, captureEnd, hexLength, hexResult, tmp, ch;
|
|
1036
|
+
ch = state.input.charCodeAt(state.position);
|
|
1037
|
+
if (ch !== 34) {
|
|
1038
|
+
return false;
|
|
1039
|
+
}
|
|
1040
|
+
state.kind = "scalar";
|
|
1041
|
+
state.result = "";
|
|
1042
|
+
state.position++;
|
|
1043
|
+
captureStart = captureEnd = state.position;
|
|
1044
|
+
while ((ch = state.input.charCodeAt(state.position)) !== 0) {
|
|
1045
|
+
if (ch === 34) {
|
|
1046
|
+
captureSegment(state, captureStart, state.position, true);
|
|
1047
|
+
state.position++;
|
|
1048
|
+
return true;
|
|
1049
|
+
} else if (ch === 92) {
|
|
1050
|
+
captureSegment(state, captureStart, state.position, true);
|
|
1051
|
+
ch = state.input.charCodeAt(++state.position);
|
|
1052
|
+
if (is_EOL(ch)) {
|
|
1053
|
+
skipSeparationSpace(state, false, nodeIndent);
|
|
1054
|
+
} else if (ch < 256 && simpleEscapeCheck[ch]) {
|
|
1055
|
+
state.result += simpleEscapeMap[ch];
|
|
1056
|
+
state.position++;
|
|
1057
|
+
} else if ((tmp = escapedHexLen(ch)) > 0) {
|
|
1058
|
+
hexLength = tmp;
|
|
1059
|
+
hexResult = 0;
|
|
1060
|
+
for (;hexLength > 0; hexLength--) {
|
|
1061
|
+
ch = state.input.charCodeAt(++state.position);
|
|
1062
|
+
if ((tmp = fromHexCode(ch)) >= 0) {
|
|
1063
|
+
hexResult = (hexResult << 4) + tmp;
|
|
1064
|
+
} else {
|
|
1065
|
+
throwError(state, "expected hexadecimal character");
|
|
1066
|
+
}
|
|
1067
|
+
}
|
|
1068
|
+
state.result += charFromCodepoint(hexResult);
|
|
1069
|
+
state.position++;
|
|
1070
|
+
} else {
|
|
1071
|
+
throwError(state, "unknown escape sequence");
|
|
1072
|
+
}
|
|
1073
|
+
captureStart = captureEnd = state.position;
|
|
1074
|
+
} else if (is_EOL(ch)) {
|
|
1075
|
+
captureSegment(state, captureStart, captureEnd, true);
|
|
1076
|
+
writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent));
|
|
1077
|
+
captureStart = captureEnd = state.position;
|
|
1078
|
+
} else if (state.position === state.lineStart && testDocumentSeparator(state)) {
|
|
1079
|
+
throwError(state, "unexpected end of the document within a double quoted scalar");
|
|
1080
|
+
} else {
|
|
1081
|
+
state.position++;
|
|
1082
|
+
captureEnd = state.position;
|
|
1083
|
+
}
|
|
1084
|
+
}
|
|
1085
|
+
throwError(state, "unexpected end of the stream within a double quoted scalar");
|
|
1086
|
+
};
|
|
1087
|
+
readFlowCollection = function(state, nodeIndent) {
|
|
1088
|
+
var readNext = true, _line, _lineStart, _pos, _tag = state.tag, _result, _anchor = state.anchor, following, terminator, isPair, isExplicitPair, isMapping, overridableKeys = Object.create(null), keyNode, keyTag, valueNode, ch;
|
|
1089
|
+
ch = state.input.charCodeAt(state.position);
|
|
1090
|
+
if (ch === 91) {
|
|
1091
|
+
terminator = 93;
|
|
1092
|
+
isMapping = false;
|
|
1093
|
+
_result = [];
|
|
1094
|
+
} else if (ch === 123) {
|
|
1095
|
+
terminator = 125;
|
|
1096
|
+
isMapping = true;
|
|
1097
|
+
_result = {};
|
|
1098
|
+
} else {
|
|
1099
|
+
return false;
|
|
1100
|
+
}
|
|
1101
|
+
if (state.anchor !== null) {
|
|
1102
|
+
state.anchorMap[state.anchor] = _result;
|
|
1103
|
+
}
|
|
1104
|
+
ch = state.input.charCodeAt(++state.position);
|
|
1105
|
+
while (ch !== 0) {
|
|
1106
|
+
skipSeparationSpace(state, true, nodeIndent);
|
|
1107
|
+
ch = state.input.charCodeAt(state.position);
|
|
1108
|
+
if (ch === terminator) {
|
|
1109
|
+
state.position++;
|
|
1110
|
+
state.tag = _tag;
|
|
1111
|
+
state.anchor = _anchor;
|
|
1112
|
+
state.kind = isMapping ? "mapping" : "sequence";
|
|
1113
|
+
state.result = _result;
|
|
1114
|
+
return true;
|
|
1115
|
+
} else if (!readNext) {
|
|
1116
|
+
throwError(state, "missed comma between flow collection entries");
|
|
1117
|
+
} else if (ch === 44) {
|
|
1118
|
+
throwError(state, "expected the node content, but found ','");
|
|
1119
|
+
}
|
|
1120
|
+
keyTag = keyNode = valueNode = null;
|
|
1121
|
+
isPair = isExplicitPair = false;
|
|
1122
|
+
if (ch === 63) {
|
|
1123
|
+
following = state.input.charCodeAt(state.position + 1);
|
|
1124
|
+
if (is_WS_OR_EOL(following)) {
|
|
1125
|
+
isPair = isExplicitPair = true;
|
|
1126
|
+
state.position++;
|
|
1127
|
+
skipSeparationSpace(state, true, nodeIndent);
|
|
1128
|
+
}
|
|
1129
|
+
}
|
|
1130
|
+
_line = state.line;
|
|
1131
|
+
_lineStart = state.lineStart;
|
|
1132
|
+
_pos = state.position;
|
|
1133
|
+
composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true);
|
|
1134
|
+
keyTag = state.tag;
|
|
1135
|
+
keyNode = state.result;
|
|
1136
|
+
skipSeparationSpace(state, true, nodeIndent);
|
|
1137
|
+
ch = state.input.charCodeAt(state.position);
|
|
1138
|
+
if ((isExplicitPair || state.line === _line) && ch === 58) {
|
|
1139
|
+
isPair = true;
|
|
1140
|
+
ch = state.input.charCodeAt(++state.position);
|
|
1141
|
+
skipSeparationSpace(state, true, nodeIndent);
|
|
1142
|
+
composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true);
|
|
1143
|
+
valueNode = state.result;
|
|
1144
|
+
}
|
|
1145
|
+
if (isMapping) {
|
|
1146
|
+
storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos);
|
|
1147
|
+
} else if (isPair) {
|
|
1148
|
+
_result.push(storeMappingPair(state, null, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos));
|
|
1149
|
+
} else {
|
|
1150
|
+
_result.push(keyNode);
|
|
1151
|
+
}
|
|
1152
|
+
skipSeparationSpace(state, true, nodeIndent);
|
|
1153
|
+
ch = state.input.charCodeAt(state.position);
|
|
1154
|
+
if (ch === 44) {
|
|
1155
|
+
readNext = true;
|
|
1156
|
+
ch = state.input.charCodeAt(++state.position);
|
|
1157
|
+
} else {
|
|
1158
|
+
readNext = false;
|
|
1159
|
+
}
|
|
1160
|
+
}
|
|
1161
|
+
throwError(state, "unexpected end of the stream within a flow collection");
|
|
1162
|
+
};
|
|
1163
|
+
readBlockScalar = function(state, nodeIndent) {
|
|
1164
|
+
var captureStart, folding, chomping = CHOMPING_CLIP, didReadContent = false, detectedIndent = false, textIndent = nodeIndent, emptyLines = 0, atMoreIndented = false, tmp, ch;
|
|
1165
|
+
ch = state.input.charCodeAt(state.position);
|
|
1166
|
+
if (ch === 124) {
|
|
1167
|
+
folding = false;
|
|
1168
|
+
} else if (ch === 62) {
|
|
1169
|
+
folding = true;
|
|
1170
|
+
} else {
|
|
1171
|
+
return false;
|
|
1172
|
+
}
|
|
1173
|
+
state.kind = "scalar";
|
|
1174
|
+
state.result = "";
|
|
1175
|
+
while (ch !== 0) {
|
|
1176
|
+
ch = state.input.charCodeAt(++state.position);
|
|
1177
|
+
if (ch === 43 || ch === 45) {
|
|
1178
|
+
if (CHOMPING_CLIP === chomping) {
|
|
1179
|
+
chomping = ch === 43 ? CHOMPING_KEEP : CHOMPING_STRIP;
|
|
1180
|
+
} else {
|
|
1181
|
+
throwError(state, "repeat of a chomping mode identifier");
|
|
1182
|
+
}
|
|
1183
|
+
} else if ((tmp = fromDecimalCode(ch)) >= 0) {
|
|
1184
|
+
if (tmp === 0) {
|
|
1185
|
+
throwError(state, "bad explicit indentation width of a block scalar; it cannot be less than one");
|
|
1186
|
+
} else if (!detectedIndent) {
|
|
1187
|
+
textIndent = nodeIndent + tmp - 1;
|
|
1188
|
+
detectedIndent = true;
|
|
1189
|
+
} else {
|
|
1190
|
+
throwError(state, "repeat of an indentation width identifier");
|
|
1191
|
+
}
|
|
1192
|
+
} else {
|
|
1193
|
+
break;
|
|
1194
|
+
}
|
|
1195
|
+
}
|
|
1196
|
+
if (is_WHITE_SPACE(ch)) {
|
|
1197
|
+
do {
|
|
1198
|
+
ch = state.input.charCodeAt(++state.position);
|
|
1199
|
+
} while (is_WHITE_SPACE(ch));
|
|
1200
|
+
if (ch === 35) {
|
|
1201
|
+
do {
|
|
1202
|
+
ch = state.input.charCodeAt(++state.position);
|
|
1203
|
+
} while (!is_EOL(ch) && ch !== 0);
|
|
1204
|
+
}
|
|
1205
|
+
}
|
|
1206
|
+
while (ch !== 0) {
|
|
1207
|
+
readLineBreak(state);
|
|
1208
|
+
state.lineIndent = 0;
|
|
1209
|
+
ch = state.input.charCodeAt(state.position);
|
|
1210
|
+
while ((!detectedIndent || state.lineIndent < textIndent) && ch === 32) {
|
|
1211
|
+
state.lineIndent++;
|
|
1212
|
+
ch = state.input.charCodeAt(++state.position);
|
|
1213
|
+
}
|
|
1214
|
+
if (!detectedIndent && state.lineIndent > textIndent) {
|
|
1215
|
+
textIndent = state.lineIndent;
|
|
1216
|
+
}
|
|
1217
|
+
if (is_EOL(ch)) {
|
|
1218
|
+
emptyLines++;
|
|
1219
|
+
continue;
|
|
1220
|
+
}
|
|
1221
|
+
if (state.lineIndent < textIndent) {
|
|
1222
|
+
if (chomping === CHOMPING_KEEP) {
|
|
1223
|
+
state.result += common.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines);
|
|
1224
|
+
} else if (chomping === CHOMPING_CLIP) {
|
|
1225
|
+
if (didReadContent) {
|
|
1226
|
+
state.result += "\n";
|
|
1227
|
+
}
|
|
1228
|
+
}
|
|
1229
|
+
break;
|
|
1230
|
+
}
|
|
1231
|
+
if (folding) {
|
|
1232
|
+
if (is_WHITE_SPACE(ch)) {
|
|
1233
|
+
atMoreIndented = true;
|
|
1234
|
+
state.result += common.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines);
|
|
1235
|
+
} else if (atMoreIndented) {
|
|
1236
|
+
atMoreIndented = false;
|
|
1237
|
+
state.result += common.repeat("\n", emptyLines + 1);
|
|
1238
|
+
} else if (emptyLines === 0) {
|
|
1239
|
+
if (didReadContent) {
|
|
1240
|
+
state.result += " ";
|
|
1241
|
+
}
|
|
1242
|
+
} else {
|
|
1243
|
+
state.result += common.repeat("\n", emptyLines);
|
|
1244
|
+
}
|
|
1245
|
+
} else {
|
|
1246
|
+
state.result += common.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines);
|
|
1247
|
+
}
|
|
1248
|
+
didReadContent = true;
|
|
1249
|
+
detectedIndent = true;
|
|
1250
|
+
emptyLines = 0;
|
|
1251
|
+
captureStart = state.position;
|
|
1252
|
+
while (!is_EOL(ch) && ch !== 0) {
|
|
1253
|
+
ch = state.input.charCodeAt(++state.position);
|
|
1254
|
+
}
|
|
1255
|
+
captureSegment(state, captureStart, state.position, false);
|
|
1256
|
+
}
|
|
1257
|
+
return true;
|
|
1258
|
+
};
|
|
1259
|
+
readBlockSequence = function(state, nodeIndent) {
|
|
1260
|
+
var _line, _tag = state.tag, _anchor = state.anchor, _result = [], following, detected = false, ch;
|
|
1261
|
+
if (state.firstTabInLine !== -1)
|
|
1262
|
+
return false;
|
|
1263
|
+
if (state.anchor !== null) {
|
|
1264
|
+
state.anchorMap[state.anchor] = _result;
|
|
1265
|
+
}
|
|
1266
|
+
ch = state.input.charCodeAt(state.position);
|
|
1267
|
+
while (ch !== 0) {
|
|
1268
|
+
if (state.firstTabInLine !== -1) {
|
|
1269
|
+
state.position = state.firstTabInLine;
|
|
1270
|
+
throwError(state, "tab characters must not be used in indentation");
|
|
1271
|
+
}
|
|
1272
|
+
if (ch !== 45) {
|
|
1273
|
+
break;
|
|
1274
|
+
}
|
|
1275
|
+
following = state.input.charCodeAt(state.position + 1);
|
|
1276
|
+
if (!is_WS_OR_EOL(following)) {
|
|
1277
|
+
break;
|
|
1278
|
+
}
|
|
1279
|
+
detected = true;
|
|
1280
|
+
state.position++;
|
|
1281
|
+
if (skipSeparationSpace(state, true, -1)) {
|
|
1282
|
+
if (state.lineIndent <= nodeIndent) {
|
|
1283
|
+
_result.push(null);
|
|
1284
|
+
ch = state.input.charCodeAt(state.position);
|
|
1285
|
+
continue;
|
|
1286
|
+
}
|
|
1287
|
+
}
|
|
1288
|
+
_line = state.line;
|
|
1289
|
+
composeNode(state, nodeIndent, CONTEXT_BLOCK_IN, false, true);
|
|
1290
|
+
_result.push(state.result);
|
|
1291
|
+
skipSeparationSpace(state, true, -1);
|
|
1292
|
+
ch = state.input.charCodeAt(state.position);
|
|
1293
|
+
if ((state.line === _line || state.lineIndent > nodeIndent) && ch !== 0) {
|
|
1294
|
+
throwError(state, "bad indentation of a sequence entry");
|
|
1295
|
+
} else if (state.lineIndent < nodeIndent) {
|
|
1296
|
+
break;
|
|
1297
|
+
}
|
|
1298
|
+
}
|
|
1299
|
+
if (detected) {
|
|
1300
|
+
state.tag = _tag;
|
|
1301
|
+
state.anchor = _anchor;
|
|
1302
|
+
state.kind = "sequence";
|
|
1303
|
+
state.result = _result;
|
|
1304
|
+
return true;
|
|
1305
|
+
}
|
|
1306
|
+
return false;
|
|
1307
|
+
};
|
|
1308
|
+
readBlockMapping = function(state, nodeIndent, flowIndent) {
|
|
1309
|
+
var following, allowCompact, _line, _keyLine, _keyLineStart, _keyPos, _tag = state.tag, _anchor = state.anchor, _result = {}, overridableKeys = Object.create(null), keyTag = null, keyNode = null, valueNode = null, atExplicitKey = false, detected = false, ch;
|
|
1310
|
+
if (state.firstTabInLine !== -1)
|
|
1311
|
+
return false;
|
|
1312
|
+
if (state.anchor !== null) {
|
|
1313
|
+
state.anchorMap[state.anchor] = _result;
|
|
1314
|
+
}
|
|
1315
|
+
ch = state.input.charCodeAt(state.position);
|
|
1316
|
+
while (ch !== 0) {
|
|
1317
|
+
if (!atExplicitKey && state.firstTabInLine !== -1) {
|
|
1318
|
+
state.position = state.firstTabInLine;
|
|
1319
|
+
throwError(state, "tab characters must not be used in indentation");
|
|
1320
|
+
}
|
|
1321
|
+
following = state.input.charCodeAt(state.position + 1);
|
|
1322
|
+
_line = state.line;
|
|
1323
|
+
if ((ch === 63 || ch === 58) && is_WS_OR_EOL(following)) {
|
|
1324
|
+
if (ch === 63) {
|
|
1325
|
+
if (atExplicitKey) {
|
|
1326
|
+
storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos);
|
|
1327
|
+
keyTag = keyNode = valueNode = null;
|
|
1328
|
+
}
|
|
1329
|
+
detected = true;
|
|
1330
|
+
atExplicitKey = true;
|
|
1331
|
+
allowCompact = true;
|
|
1332
|
+
} else if (atExplicitKey) {
|
|
1333
|
+
atExplicitKey = false;
|
|
1334
|
+
allowCompact = true;
|
|
1335
|
+
} else {
|
|
1336
|
+
throwError(state, "incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line");
|
|
1337
|
+
}
|
|
1338
|
+
state.position += 1;
|
|
1339
|
+
ch = following;
|
|
1340
|
+
} else {
|
|
1341
|
+
_keyLine = state.line;
|
|
1342
|
+
_keyLineStart = state.lineStart;
|
|
1343
|
+
_keyPos = state.position;
|
|
1344
|
+
if (!composeNode(state, flowIndent, CONTEXT_FLOW_OUT, false, true)) {
|
|
1345
|
+
break;
|
|
1346
|
+
}
|
|
1347
|
+
if (state.line === _line) {
|
|
1348
|
+
ch = state.input.charCodeAt(state.position);
|
|
1349
|
+
while (is_WHITE_SPACE(ch)) {
|
|
1350
|
+
ch = state.input.charCodeAt(++state.position);
|
|
1351
|
+
}
|
|
1352
|
+
if (ch === 58) {
|
|
1353
|
+
ch = state.input.charCodeAt(++state.position);
|
|
1354
|
+
if (!is_WS_OR_EOL(ch)) {
|
|
1355
|
+
throwError(state, "a whitespace character is expected after the key-value separator within a block mapping");
|
|
1356
|
+
}
|
|
1357
|
+
if (atExplicitKey) {
|
|
1358
|
+
storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos);
|
|
1359
|
+
keyTag = keyNode = valueNode = null;
|
|
1360
|
+
}
|
|
1361
|
+
detected = true;
|
|
1362
|
+
atExplicitKey = false;
|
|
1363
|
+
allowCompact = false;
|
|
1364
|
+
keyTag = state.tag;
|
|
1365
|
+
keyNode = state.result;
|
|
1366
|
+
} else if (detected) {
|
|
1367
|
+
throwError(state, "can not read an implicit mapping pair; a colon is missed");
|
|
1368
|
+
} else {
|
|
1369
|
+
state.tag = _tag;
|
|
1370
|
+
state.anchor = _anchor;
|
|
1371
|
+
return true;
|
|
1372
|
+
}
|
|
1373
|
+
} else if (detected) {
|
|
1374
|
+
throwError(state, "can not read a block mapping entry; a multiline key may not be an implicit key");
|
|
1375
|
+
} else {
|
|
1376
|
+
state.tag = _tag;
|
|
1377
|
+
state.anchor = _anchor;
|
|
1378
|
+
return true;
|
|
1379
|
+
}
|
|
1380
|
+
}
|
|
1381
|
+
if (state.line === _line || state.lineIndent > nodeIndent) {
|
|
1382
|
+
if (atExplicitKey) {
|
|
1383
|
+
_keyLine = state.line;
|
|
1384
|
+
_keyLineStart = state.lineStart;
|
|
1385
|
+
_keyPos = state.position;
|
|
1386
|
+
}
|
|
1387
|
+
if (composeNode(state, nodeIndent, CONTEXT_BLOCK_OUT, true, allowCompact)) {
|
|
1388
|
+
if (atExplicitKey) {
|
|
1389
|
+
keyNode = state.result;
|
|
1390
|
+
} else {
|
|
1391
|
+
valueNode = state.result;
|
|
1392
|
+
}
|
|
1393
|
+
}
|
|
1394
|
+
if (!atExplicitKey) {
|
|
1395
|
+
storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _keyLine, _keyLineStart, _keyPos);
|
|
1396
|
+
keyTag = keyNode = valueNode = null;
|
|
1397
|
+
}
|
|
1398
|
+
skipSeparationSpace(state, true, -1);
|
|
1399
|
+
ch = state.input.charCodeAt(state.position);
|
|
1400
|
+
}
|
|
1401
|
+
if ((state.line === _line || state.lineIndent > nodeIndent) && ch !== 0) {
|
|
1402
|
+
throwError(state, "bad indentation of a mapping entry");
|
|
1403
|
+
} else if (state.lineIndent < nodeIndent) {
|
|
1404
|
+
break;
|
|
1405
|
+
}
|
|
1406
|
+
}
|
|
1407
|
+
if (atExplicitKey) {
|
|
1408
|
+
storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos);
|
|
1409
|
+
}
|
|
1410
|
+
if (detected) {
|
|
1411
|
+
state.tag = _tag;
|
|
1412
|
+
state.anchor = _anchor;
|
|
1413
|
+
state.kind = "mapping";
|
|
1414
|
+
state.result = _result;
|
|
1415
|
+
}
|
|
1416
|
+
return detected;
|
|
1417
|
+
};
|
|
1418
|
+
readTagProperty = function(state) {
|
|
1419
|
+
var _position, isVerbatim = false, isNamed = false, tagHandle, tagName, ch;
|
|
1420
|
+
ch = state.input.charCodeAt(state.position);
|
|
1421
|
+
if (ch !== 33)
|
|
1422
|
+
return false;
|
|
1423
|
+
if (state.tag !== null) {
|
|
1424
|
+
throwError(state, "duplication of a tag property");
|
|
1425
|
+
}
|
|
1426
|
+
ch = state.input.charCodeAt(++state.position);
|
|
1427
|
+
if (ch === 60) {
|
|
1428
|
+
isVerbatim = true;
|
|
1429
|
+
ch = state.input.charCodeAt(++state.position);
|
|
1430
|
+
} else if (ch === 33) {
|
|
1431
|
+
isNamed = true;
|
|
1432
|
+
tagHandle = "!!";
|
|
1433
|
+
ch = state.input.charCodeAt(++state.position);
|
|
1434
|
+
} else {
|
|
1435
|
+
tagHandle = "!";
|
|
1436
|
+
}
|
|
1437
|
+
_position = state.position;
|
|
1438
|
+
if (isVerbatim) {
|
|
1439
|
+
do {
|
|
1440
|
+
ch = state.input.charCodeAt(++state.position);
|
|
1441
|
+
} while (ch !== 0 && ch !== 62);
|
|
1442
|
+
if (state.position < state.length) {
|
|
1443
|
+
tagName = state.input.slice(_position, state.position);
|
|
1444
|
+
ch = state.input.charCodeAt(++state.position);
|
|
1445
|
+
} else {
|
|
1446
|
+
throwError(state, "unexpected end of the stream within a verbatim tag");
|
|
1447
|
+
}
|
|
1448
|
+
} else {
|
|
1449
|
+
while (ch !== 0 && !is_WS_OR_EOL(ch)) {
|
|
1450
|
+
if (ch === 33) {
|
|
1451
|
+
if (!isNamed) {
|
|
1452
|
+
tagHandle = state.input.slice(_position - 1, state.position + 1);
|
|
1453
|
+
if (!PATTERN_TAG_HANDLE.test(tagHandle)) {
|
|
1454
|
+
throwError(state, "named tag handle cannot contain such characters");
|
|
1455
|
+
}
|
|
1456
|
+
isNamed = true;
|
|
1457
|
+
_position = state.position + 1;
|
|
1458
|
+
} else {
|
|
1459
|
+
throwError(state, "tag suffix cannot contain exclamation marks");
|
|
1460
|
+
}
|
|
1461
|
+
}
|
|
1462
|
+
ch = state.input.charCodeAt(++state.position);
|
|
1463
|
+
}
|
|
1464
|
+
tagName = state.input.slice(_position, state.position);
|
|
1465
|
+
if (PATTERN_FLOW_INDICATORS.test(tagName)) {
|
|
1466
|
+
throwError(state, "tag suffix cannot contain flow indicator characters");
|
|
1467
|
+
}
|
|
1468
|
+
}
|
|
1469
|
+
if (tagName && !PATTERN_TAG_URI.test(tagName)) {
|
|
1470
|
+
throwError(state, "tag name cannot contain such characters: " + tagName);
|
|
1471
|
+
}
|
|
1472
|
+
try {
|
|
1473
|
+
tagName = decodeURIComponent(tagName);
|
|
1474
|
+
} catch (err) {
|
|
1475
|
+
throwError(state, "tag name is malformed: " + tagName);
|
|
1476
|
+
}
|
|
1477
|
+
if (isVerbatim) {
|
|
1478
|
+
state.tag = tagName;
|
|
1479
|
+
} else if (_hasOwnProperty$1.call(state.tagMap, tagHandle)) {
|
|
1480
|
+
state.tag = state.tagMap[tagHandle] + tagName;
|
|
1481
|
+
} else if (tagHandle === "!") {
|
|
1482
|
+
state.tag = "!" + tagName;
|
|
1483
|
+
} else if (tagHandle === "!!") {
|
|
1484
|
+
state.tag = "tag:yaml.org,2002:" + tagName;
|
|
1485
|
+
} else {
|
|
1486
|
+
throwError(state, 'undeclared tag handle "' + tagHandle + '"');
|
|
1487
|
+
}
|
|
1488
|
+
return true;
|
|
1489
|
+
};
|
|
1490
|
+
readAnchorProperty = function(state) {
|
|
1491
|
+
var _position, ch;
|
|
1492
|
+
ch = state.input.charCodeAt(state.position);
|
|
1493
|
+
if (ch !== 38)
|
|
1494
|
+
return false;
|
|
1495
|
+
if (state.anchor !== null) {
|
|
1496
|
+
throwError(state, "duplication of an anchor property");
|
|
1497
|
+
}
|
|
1498
|
+
ch = state.input.charCodeAt(++state.position);
|
|
1499
|
+
_position = state.position;
|
|
1500
|
+
while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) {
|
|
1501
|
+
ch = state.input.charCodeAt(++state.position);
|
|
1502
|
+
}
|
|
1503
|
+
if (state.position === _position) {
|
|
1504
|
+
throwError(state, "name of an anchor node must contain at least one character");
|
|
1505
|
+
}
|
|
1506
|
+
state.anchor = state.input.slice(_position, state.position);
|
|
1507
|
+
return true;
|
|
1508
|
+
};
|
|
1509
|
+
readAlias = function(state) {
|
|
1510
|
+
var _position, alias, ch;
|
|
1511
|
+
ch = state.input.charCodeAt(state.position);
|
|
1512
|
+
if (ch !== 42)
|
|
1513
|
+
return false;
|
|
1514
|
+
ch = state.input.charCodeAt(++state.position);
|
|
1515
|
+
_position = state.position;
|
|
1516
|
+
while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) {
|
|
1517
|
+
ch = state.input.charCodeAt(++state.position);
|
|
1518
|
+
}
|
|
1519
|
+
if (state.position === _position) {
|
|
1520
|
+
throwError(state, "name of an alias node must contain at least one character");
|
|
1521
|
+
}
|
|
1522
|
+
alias = state.input.slice(_position, state.position);
|
|
1523
|
+
if (!_hasOwnProperty$1.call(state.anchorMap, alias)) {
|
|
1524
|
+
throwError(state, 'unidentified alias "' + alias + '"');
|
|
1525
|
+
}
|
|
1526
|
+
state.result = state.anchorMap[alias];
|
|
1527
|
+
skipSeparationSpace(state, true, -1);
|
|
1528
|
+
return true;
|
|
1529
|
+
};
|
|
1530
|
+
composeNode = function(state, parentIndent, nodeContext, allowToSeek, allowCompact) {
|
|
1531
|
+
var allowBlockStyles, allowBlockScalars, allowBlockCollections, indentStatus = 1, atNewLine = false, hasContent = false, typeIndex, typeQuantity, typeList, type, flowIndent, blockIndent;
|
|
1532
|
+
if (state.listener !== null) {
|
|
1533
|
+
state.listener("open", state);
|
|
1534
|
+
}
|
|
1535
|
+
state.tag = null;
|
|
1536
|
+
state.anchor = null;
|
|
1537
|
+
state.kind = null;
|
|
1538
|
+
state.result = null;
|
|
1539
|
+
allowBlockStyles = allowBlockScalars = allowBlockCollections = CONTEXT_BLOCK_OUT === nodeContext || CONTEXT_BLOCK_IN === nodeContext;
|
|
1540
|
+
if (allowToSeek) {
|
|
1541
|
+
if (skipSeparationSpace(state, true, -1)) {
|
|
1542
|
+
atNewLine = true;
|
|
1543
|
+
if (state.lineIndent > parentIndent) {
|
|
1544
|
+
indentStatus = 1;
|
|
1545
|
+
} else if (state.lineIndent === parentIndent) {
|
|
1546
|
+
indentStatus = 0;
|
|
1547
|
+
} else if (state.lineIndent < parentIndent) {
|
|
1548
|
+
indentStatus = -1;
|
|
1549
|
+
}
|
|
1550
|
+
}
|
|
1551
|
+
}
|
|
1552
|
+
if (indentStatus === 1) {
|
|
1553
|
+
while (readTagProperty(state) || readAnchorProperty(state)) {
|
|
1554
|
+
if (skipSeparationSpace(state, true, -1)) {
|
|
1555
|
+
atNewLine = true;
|
|
1556
|
+
allowBlockCollections = allowBlockStyles;
|
|
1557
|
+
if (state.lineIndent > parentIndent) {
|
|
1558
|
+
indentStatus = 1;
|
|
1559
|
+
} else if (state.lineIndent === parentIndent) {
|
|
1560
|
+
indentStatus = 0;
|
|
1561
|
+
} else if (state.lineIndent < parentIndent) {
|
|
1562
|
+
indentStatus = -1;
|
|
1563
|
+
}
|
|
1564
|
+
} else {
|
|
1565
|
+
allowBlockCollections = false;
|
|
1566
|
+
}
|
|
1567
|
+
}
|
|
1568
|
+
}
|
|
1569
|
+
if (allowBlockCollections) {
|
|
1570
|
+
allowBlockCollections = atNewLine || allowCompact;
|
|
1571
|
+
}
|
|
1572
|
+
if (indentStatus === 1 || CONTEXT_BLOCK_OUT === nodeContext) {
|
|
1573
|
+
if (CONTEXT_FLOW_IN === nodeContext || CONTEXT_FLOW_OUT === nodeContext) {
|
|
1574
|
+
flowIndent = parentIndent;
|
|
1575
|
+
} else {
|
|
1576
|
+
flowIndent = parentIndent + 1;
|
|
1577
|
+
}
|
|
1578
|
+
blockIndent = state.position - state.lineStart;
|
|
1579
|
+
if (indentStatus === 1) {
|
|
1580
|
+
if (allowBlockCollections && (readBlockSequence(state, blockIndent) || readBlockMapping(state, blockIndent, flowIndent)) || readFlowCollection(state, flowIndent)) {
|
|
1581
|
+
hasContent = true;
|
|
1582
|
+
} else {
|
|
1583
|
+
if (allowBlockScalars && readBlockScalar(state, flowIndent) || readSingleQuotedScalar(state, flowIndent) || readDoubleQuotedScalar(state, flowIndent)) {
|
|
1584
|
+
hasContent = true;
|
|
1585
|
+
} else if (readAlias(state)) {
|
|
1586
|
+
hasContent = true;
|
|
1587
|
+
if (state.tag !== null || state.anchor !== null) {
|
|
1588
|
+
throwError(state, "alias node should not have any properties");
|
|
1589
|
+
}
|
|
1590
|
+
} else if (readPlainScalar(state, flowIndent, CONTEXT_FLOW_IN === nodeContext)) {
|
|
1591
|
+
hasContent = true;
|
|
1592
|
+
if (state.tag === null) {
|
|
1593
|
+
state.tag = "?";
|
|
1594
|
+
}
|
|
1595
|
+
}
|
|
1596
|
+
if (state.anchor !== null) {
|
|
1597
|
+
state.anchorMap[state.anchor] = state.result;
|
|
1598
|
+
}
|
|
1599
|
+
}
|
|
1600
|
+
} else if (indentStatus === 0) {
|
|
1601
|
+
hasContent = allowBlockCollections && readBlockSequence(state, blockIndent);
|
|
1602
|
+
}
|
|
1603
|
+
}
|
|
1604
|
+
if (state.tag === null) {
|
|
1605
|
+
if (state.anchor !== null) {
|
|
1606
|
+
state.anchorMap[state.anchor] = state.result;
|
|
1607
|
+
}
|
|
1608
|
+
} else if (state.tag === "?") {
|
|
1609
|
+
if (state.result !== null && state.kind !== "scalar") {
|
|
1610
|
+
throwError(state, 'unacceptable node kind for !<?> tag; it should be "scalar", not "' + state.kind + '"');
|
|
1611
|
+
}
|
|
1612
|
+
for (typeIndex = 0, typeQuantity = state.implicitTypes.length;typeIndex < typeQuantity; typeIndex += 1) {
|
|
1613
|
+
type = state.implicitTypes[typeIndex];
|
|
1614
|
+
if (type.resolve(state.result)) {
|
|
1615
|
+
state.result = type.construct(state.result);
|
|
1616
|
+
state.tag = type.tag;
|
|
1617
|
+
if (state.anchor !== null) {
|
|
1618
|
+
state.anchorMap[state.anchor] = state.result;
|
|
1619
|
+
}
|
|
1620
|
+
break;
|
|
1621
|
+
}
|
|
1622
|
+
}
|
|
1623
|
+
} else if (state.tag !== "!") {
|
|
1624
|
+
if (_hasOwnProperty$1.call(state.typeMap[state.kind || "fallback"], state.tag)) {
|
|
1625
|
+
type = state.typeMap[state.kind || "fallback"][state.tag];
|
|
1626
|
+
} else {
|
|
1627
|
+
type = null;
|
|
1628
|
+
typeList = state.typeMap.multi[state.kind || "fallback"];
|
|
1629
|
+
for (typeIndex = 0, typeQuantity = typeList.length;typeIndex < typeQuantity; typeIndex += 1) {
|
|
1630
|
+
if (state.tag.slice(0, typeList[typeIndex].tag.length) === typeList[typeIndex].tag) {
|
|
1631
|
+
type = typeList[typeIndex];
|
|
1632
|
+
break;
|
|
1633
|
+
}
|
|
1634
|
+
}
|
|
1635
|
+
}
|
|
1636
|
+
if (!type) {
|
|
1637
|
+
throwError(state, "unknown tag !<" + state.tag + ">");
|
|
1638
|
+
}
|
|
1639
|
+
if (state.result !== null && type.kind !== state.kind) {
|
|
1640
|
+
throwError(state, "unacceptable node kind for !<" + state.tag + '> tag; it should be "' + type.kind + '", not "' + state.kind + '"');
|
|
1641
|
+
}
|
|
1642
|
+
if (!type.resolve(state.result, state.tag)) {
|
|
1643
|
+
throwError(state, "cannot resolve a node with !<" + state.tag + "> explicit tag");
|
|
1644
|
+
} else {
|
|
1645
|
+
state.result = type.construct(state.result, state.tag);
|
|
1646
|
+
if (state.anchor !== null) {
|
|
1647
|
+
state.anchorMap[state.anchor] = state.result;
|
|
1648
|
+
}
|
|
1649
|
+
}
|
|
1650
|
+
}
|
|
1651
|
+
if (state.listener !== null) {
|
|
1652
|
+
state.listener("close", state);
|
|
1653
|
+
}
|
|
1654
|
+
return state.tag !== null || state.anchor !== null || hasContent;
|
|
1655
|
+
};
|
|
1656
|
+
readDocument = function(state) {
|
|
1657
|
+
var documentStart = state.position, _position, directiveName, directiveArgs, hasDirectives = false, ch;
|
|
1658
|
+
state.version = null;
|
|
1659
|
+
state.checkLineBreaks = state.legacy;
|
|
1660
|
+
state.tagMap = Object.create(null);
|
|
1661
|
+
state.anchorMap = Object.create(null);
|
|
1662
|
+
while ((ch = state.input.charCodeAt(state.position)) !== 0) {
|
|
1663
|
+
skipSeparationSpace(state, true, -1);
|
|
1664
|
+
ch = state.input.charCodeAt(state.position);
|
|
1665
|
+
if (state.lineIndent > 0 || ch !== 37) {
|
|
1666
|
+
break;
|
|
1667
|
+
}
|
|
1668
|
+
hasDirectives = true;
|
|
1669
|
+
ch = state.input.charCodeAt(++state.position);
|
|
1670
|
+
_position = state.position;
|
|
1671
|
+
while (ch !== 0 && !is_WS_OR_EOL(ch)) {
|
|
1672
|
+
ch = state.input.charCodeAt(++state.position);
|
|
1673
|
+
}
|
|
1674
|
+
directiveName = state.input.slice(_position, state.position);
|
|
1675
|
+
directiveArgs = [];
|
|
1676
|
+
if (directiveName.length < 1) {
|
|
1677
|
+
throwError(state, "directive name must not be less than one character in length");
|
|
1678
|
+
}
|
|
1679
|
+
while (ch !== 0) {
|
|
1680
|
+
while (is_WHITE_SPACE(ch)) {
|
|
1681
|
+
ch = state.input.charCodeAt(++state.position);
|
|
1682
|
+
}
|
|
1683
|
+
if (ch === 35) {
|
|
1684
|
+
do {
|
|
1685
|
+
ch = state.input.charCodeAt(++state.position);
|
|
1686
|
+
} while (ch !== 0 && !is_EOL(ch));
|
|
1687
|
+
break;
|
|
1688
|
+
}
|
|
1689
|
+
if (is_EOL(ch))
|
|
1690
|
+
break;
|
|
1691
|
+
_position = state.position;
|
|
1692
|
+
while (ch !== 0 && !is_WS_OR_EOL(ch)) {
|
|
1693
|
+
ch = state.input.charCodeAt(++state.position);
|
|
1694
|
+
}
|
|
1695
|
+
directiveArgs.push(state.input.slice(_position, state.position));
|
|
1696
|
+
}
|
|
1697
|
+
if (ch !== 0)
|
|
1698
|
+
readLineBreak(state);
|
|
1699
|
+
if (_hasOwnProperty$1.call(directiveHandlers, directiveName)) {
|
|
1700
|
+
directiveHandlers[directiveName](state, directiveName, directiveArgs);
|
|
1701
|
+
} else {
|
|
1702
|
+
throwWarning(state, 'unknown document directive "' + directiveName + '"');
|
|
1703
|
+
}
|
|
1704
|
+
}
|
|
1705
|
+
skipSeparationSpace(state, true, -1);
|
|
1706
|
+
if (state.lineIndent === 0 && state.input.charCodeAt(state.position) === 45 && state.input.charCodeAt(state.position + 1) === 45 && state.input.charCodeAt(state.position + 2) === 45) {
|
|
1707
|
+
state.position += 3;
|
|
1708
|
+
skipSeparationSpace(state, true, -1);
|
|
1709
|
+
} else if (hasDirectives) {
|
|
1710
|
+
throwError(state, "directives end mark is expected");
|
|
1711
|
+
}
|
|
1712
|
+
composeNode(state, state.lineIndent - 1, CONTEXT_BLOCK_OUT, false, true);
|
|
1713
|
+
skipSeparationSpace(state, true, -1);
|
|
1714
|
+
if (state.checkLineBreaks && PATTERN_NON_ASCII_LINE_BREAKS.test(state.input.slice(documentStart, state.position))) {
|
|
1715
|
+
throwWarning(state, "non-ASCII line breaks are interpreted as content");
|
|
1716
|
+
}
|
|
1717
|
+
state.documents.push(state.result);
|
|
1718
|
+
if (state.position === state.lineStart && testDocumentSeparator(state)) {
|
|
1719
|
+
if (state.input.charCodeAt(state.position) === 46) {
|
|
1720
|
+
state.position += 3;
|
|
1721
|
+
skipSeparationSpace(state, true, -1);
|
|
1722
|
+
}
|
|
1723
|
+
return;
|
|
1724
|
+
}
|
|
1725
|
+
if (state.position < state.length - 1) {
|
|
1726
|
+
throwError(state, "end of the stream or a document separator is expected");
|
|
1727
|
+
} else {
|
|
1728
|
+
return;
|
|
1729
|
+
}
|
|
1730
|
+
};
|
|
1731
|
+
loadDocuments = function(input, options) {
|
|
1732
|
+
input = String(input);
|
|
1733
|
+
options = options || {};
|
|
1734
|
+
if (input.length !== 0) {
|
|
1735
|
+
if (input.charCodeAt(input.length - 1) !== 10 && input.charCodeAt(input.length - 1) !== 13) {
|
|
1736
|
+
input += "\n";
|
|
1737
|
+
}
|
|
1738
|
+
if (input.charCodeAt(0) === 65279) {
|
|
1739
|
+
input = input.slice(1);
|
|
1740
|
+
}
|
|
1741
|
+
}
|
|
1742
|
+
var state = new State$1(input, options);
|
|
1743
|
+
var nullpos = input.indexOf("\0");
|
|
1744
|
+
if (nullpos !== -1) {
|
|
1745
|
+
state.position = nullpos;
|
|
1746
|
+
throwError(state, "null byte is not allowed in input");
|
|
1747
|
+
}
|
|
1748
|
+
state.input += "\0";
|
|
1749
|
+
while (state.input.charCodeAt(state.position) === 32) {
|
|
1750
|
+
state.lineIndent += 1;
|
|
1751
|
+
state.position += 1;
|
|
1752
|
+
}
|
|
1753
|
+
while (state.position < state.length - 1) {
|
|
1754
|
+
readDocument(state);
|
|
1755
|
+
}
|
|
1756
|
+
return state.documents;
|
|
1757
|
+
};
|
|
1758
|
+
loadAll$1 = function(input, iterator, options) {
|
|
1759
|
+
if (iterator !== null && typeof iterator === "object" && typeof options === "undefined") {
|
|
1760
|
+
options = iterator;
|
|
1761
|
+
iterator = null;
|
|
1762
|
+
}
|
|
1763
|
+
var documents = loadDocuments(input, options);
|
|
1764
|
+
if (typeof iterator !== "function") {
|
|
1765
|
+
return documents;
|
|
1766
|
+
}
|
|
1767
|
+
for (var index = 0, length = documents.length;index < length; index += 1) {
|
|
1768
|
+
iterator(documents[index]);
|
|
1769
|
+
}
|
|
1770
|
+
};
|
|
1771
|
+
load$1 = function(input, options) {
|
|
1772
|
+
var documents = loadDocuments(input, options);
|
|
1773
|
+
if (documents.length === 0) {
|
|
1774
|
+
return;
|
|
1775
|
+
} else if (documents.length === 1) {
|
|
1776
|
+
return documents[0];
|
|
1777
|
+
}
|
|
1778
|
+
throw new exception("expected a single document in the stream, but found more");
|
|
1779
|
+
};
|
|
1780
|
+
compileStyleMap = function(schema, map) {
|
|
1781
|
+
var result, keys, index, length, tag, style, type;
|
|
1782
|
+
if (map === null)
|
|
1783
|
+
return {};
|
|
1784
|
+
result = {};
|
|
1785
|
+
keys = Object.keys(map);
|
|
1786
|
+
for (index = 0, length = keys.length;index < length; index += 1) {
|
|
1787
|
+
tag = keys[index];
|
|
1788
|
+
style = String(map[tag]);
|
|
1789
|
+
if (tag.slice(0, 2) === "!!") {
|
|
1790
|
+
tag = "tag:yaml.org,2002:" + tag.slice(2);
|
|
1791
|
+
}
|
|
1792
|
+
type = schema.compiledTypeMap["fallback"][tag];
|
|
1793
|
+
if (type && _hasOwnProperty.call(type.styleAliases, style)) {
|
|
1794
|
+
style = type.styleAliases[style];
|
|
1795
|
+
}
|
|
1796
|
+
result[tag] = style;
|
|
1797
|
+
}
|
|
1798
|
+
return result;
|
|
1799
|
+
};
|
|
1800
|
+
encodeHex = function(character) {
|
|
1801
|
+
var string, handle, length;
|
|
1802
|
+
string = character.toString(16).toUpperCase();
|
|
1803
|
+
if (character <= 255) {
|
|
1804
|
+
handle = "x";
|
|
1805
|
+
length = 2;
|
|
1806
|
+
} else if (character <= 65535) {
|
|
1807
|
+
handle = "u";
|
|
1808
|
+
length = 4;
|
|
1809
|
+
} else if (character <= 4294967295) {
|
|
1810
|
+
handle = "U";
|
|
1811
|
+
length = 8;
|
|
1812
|
+
} else {
|
|
1813
|
+
throw new exception("code point within a string may not be greater than 0xFFFFFFFF");
|
|
1814
|
+
}
|
|
1815
|
+
return "\\" + handle + common.repeat("0", length - string.length) + string;
|
|
1816
|
+
};
|
|
1817
|
+
State = function(options) {
|
|
1818
|
+
this.schema = options["schema"] || _default;
|
|
1819
|
+
this.indent = Math.max(1, options["indent"] || 2);
|
|
1820
|
+
this.noArrayIndent = options["noArrayIndent"] || false;
|
|
1821
|
+
this.skipInvalid = options["skipInvalid"] || false;
|
|
1822
|
+
this.flowLevel = common.isNothing(options["flowLevel"]) ? -1 : options["flowLevel"];
|
|
1823
|
+
this.styleMap = compileStyleMap(this.schema, options["styles"] || null);
|
|
1824
|
+
this.sortKeys = options["sortKeys"] || false;
|
|
1825
|
+
this.lineWidth = options["lineWidth"] || 80;
|
|
1826
|
+
this.noRefs = options["noRefs"] || false;
|
|
1827
|
+
this.noCompatMode = options["noCompatMode"] || false;
|
|
1828
|
+
this.condenseFlow = options["condenseFlow"] || false;
|
|
1829
|
+
this.quotingType = options["quotingType"] === '"' ? QUOTING_TYPE_DOUBLE : QUOTING_TYPE_SINGLE;
|
|
1830
|
+
this.forceQuotes = options["forceQuotes"] || false;
|
|
1831
|
+
this.replacer = typeof options["replacer"] === "function" ? options["replacer"] : null;
|
|
1832
|
+
this.implicitTypes = this.schema.compiledImplicit;
|
|
1833
|
+
this.explicitTypes = this.schema.compiledExplicit;
|
|
1834
|
+
this.tag = null;
|
|
1835
|
+
this.result = "";
|
|
1836
|
+
this.duplicates = [];
|
|
1837
|
+
this.usedDuplicates = null;
|
|
1838
|
+
};
|
|
1839
|
+
indentString = function(string, spaces) {
|
|
1840
|
+
var ind = common.repeat(" ", spaces), position = 0, next = -1, result = "", line, length = string.length;
|
|
1841
|
+
while (position < length) {
|
|
1842
|
+
next = string.indexOf("\n", position);
|
|
1843
|
+
if (next === -1) {
|
|
1844
|
+
line = string.slice(position);
|
|
1845
|
+
position = length;
|
|
1846
|
+
} else {
|
|
1847
|
+
line = string.slice(position, next + 1);
|
|
1848
|
+
position = next + 1;
|
|
1849
|
+
}
|
|
1850
|
+
if (line.length && line !== "\n")
|
|
1851
|
+
result += ind;
|
|
1852
|
+
result += line;
|
|
1853
|
+
}
|
|
1854
|
+
return result;
|
|
1855
|
+
};
|
|
1856
|
+
generateNextLine = function(state, level) {
|
|
1857
|
+
return "\n" + common.repeat(" ", state.indent * level);
|
|
1858
|
+
};
|
|
1859
|
+
testImplicitResolving = function(state, str) {
|
|
1860
|
+
var index, length, type;
|
|
1861
|
+
for (index = 0, length = state.implicitTypes.length;index < length; index += 1) {
|
|
1862
|
+
type = state.implicitTypes[index];
|
|
1863
|
+
if (type.resolve(str)) {
|
|
1864
|
+
return true;
|
|
1865
|
+
}
|
|
1866
|
+
}
|
|
1867
|
+
return false;
|
|
1868
|
+
};
|
|
1869
|
+
isWhitespace = function(c) {
|
|
1870
|
+
return c === CHAR_SPACE || c === CHAR_TAB;
|
|
1871
|
+
};
|
|
1872
|
+
isPrintable = function(c) {
|
|
1873
|
+
return 32 <= c && c <= 126 || 161 <= c && c <= 55295 && c !== 8232 && c !== 8233 || 57344 <= c && c <= 65533 && c !== CHAR_BOM || 65536 <= c && c <= 1114111;
|
|
1874
|
+
};
|
|
1875
|
+
isNsCharOrWhitespace = function(c) {
|
|
1876
|
+
return isPrintable(c) && c !== CHAR_BOM && c !== CHAR_CARRIAGE_RETURN && c !== CHAR_LINE_FEED;
|
|
1877
|
+
};
|
|
1878
|
+
isPlainSafe = function(c, prev, inblock) {
|
|
1879
|
+
var cIsNsCharOrWhitespace = isNsCharOrWhitespace(c);
|
|
1880
|
+
var cIsNsChar = cIsNsCharOrWhitespace && !isWhitespace(c);
|
|
1881
|
+
return (inblock ? cIsNsCharOrWhitespace : cIsNsCharOrWhitespace && c !== CHAR_COMMA && c !== CHAR_LEFT_SQUARE_BRACKET && c !== CHAR_RIGHT_SQUARE_BRACKET && c !== CHAR_LEFT_CURLY_BRACKET && c !== CHAR_RIGHT_CURLY_BRACKET) && c !== CHAR_SHARP && !(prev === CHAR_COLON && !cIsNsChar) || isNsCharOrWhitespace(prev) && !isWhitespace(prev) && c === CHAR_SHARP || prev === CHAR_COLON && cIsNsChar;
|
|
1882
|
+
};
|
|
1883
|
+
isPlainSafeFirst = function(c) {
|
|
1884
|
+
return isPrintable(c) && c !== CHAR_BOM && !isWhitespace(c) && c !== CHAR_MINUS && c !== CHAR_QUESTION && c !== CHAR_COLON && c !== CHAR_COMMA && c !== CHAR_LEFT_SQUARE_BRACKET && c !== CHAR_RIGHT_SQUARE_BRACKET && c !== CHAR_LEFT_CURLY_BRACKET && c !== CHAR_RIGHT_CURLY_BRACKET && c !== CHAR_SHARP && c !== CHAR_AMPERSAND && c !== CHAR_ASTERISK && c !== CHAR_EXCLAMATION && c !== CHAR_VERTICAL_LINE && c !== CHAR_EQUALS && c !== CHAR_GREATER_THAN && c !== CHAR_SINGLE_QUOTE && c !== CHAR_DOUBLE_QUOTE && c !== CHAR_PERCENT && c !== CHAR_COMMERCIAL_AT && c !== CHAR_GRAVE_ACCENT;
|
|
1885
|
+
};
|
|
1886
|
+
isPlainSafeLast = function(c) {
|
|
1887
|
+
return !isWhitespace(c) && c !== CHAR_COLON;
|
|
1888
|
+
};
|
|
1889
|
+
codePointAt = function(string, pos) {
|
|
1890
|
+
var first = string.charCodeAt(pos), second;
|
|
1891
|
+
if (first >= 55296 && first <= 56319 && pos + 1 < string.length) {
|
|
1892
|
+
second = string.charCodeAt(pos + 1);
|
|
1893
|
+
if (second >= 56320 && second <= 57343) {
|
|
1894
|
+
return (first - 55296) * 1024 + second - 56320 + 65536;
|
|
1895
|
+
}
|
|
1896
|
+
}
|
|
1897
|
+
return first;
|
|
1898
|
+
};
|
|
1899
|
+
needIndentIndicator = function(string) {
|
|
1900
|
+
var leadingSpaceRe = /^\n* /;
|
|
1901
|
+
return leadingSpaceRe.test(string);
|
|
1902
|
+
};
|
|
1903
|
+
chooseScalarStyle = function(string, singleLineOnly, indentPerLevel, lineWidth, testAmbiguousType, quotingType, forceQuotes, inblock) {
|
|
1904
|
+
var i;
|
|
1905
|
+
var char = 0;
|
|
1906
|
+
var prevChar = null;
|
|
1907
|
+
var hasLineBreak = false;
|
|
1908
|
+
var hasFoldableLine = false;
|
|
1909
|
+
var shouldTrackWidth = lineWidth !== -1;
|
|
1910
|
+
var previousLineBreak = -1;
|
|
1911
|
+
var plain = isPlainSafeFirst(codePointAt(string, 0)) && isPlainSafeLast(codePointAt(string, string.length - 1));
|
|
1912
|
+
if (singleLineOnly || forceQuotes) {
|
|
1913
|
+
for (i = 0;i < string.length; char >= 65536 ? i += 2 : i++) {
|
|
1914
|
+
char = codePointAt(string, i);
|
|
1915
|
+
if (!isPrintable(char)) {
|
|
1916
|
+
return STYLE_DOUBLE;
|
|
1917
|
+
}
|
|
1918
|
+
plain = plain && isPlainSafe(char, prevChar, inblock);
|
|
1919
|
+
prevChar = char;
|
|
1920
|
+
}
|
|
1921
|
+
} else {
|
|
1922
|
+
for (i = 0;i < string.length; char >= 65536 ? i += 2 : i++) {
|
|
1923
|
+
char = codePointAt(string, i);
|
|
1924
|
+
if (char === CHAR_LINE_FEED) {
|
|
1925
|
+
hasLineBreak = true;
|
|
1926
|
+
if (shouldTrackWidth) {
|
|
1927
|
+
hasFoldableLine = hasFoldableLine || i - previousLineBreak - 1 > lineWidth && string[previousLineBreak + 1] !== " ";
|
|
1928
|
+
previousLineBreak = i;
|
|
1929
|
+
}
|
|
1930
|
+
} else if (!isPrintable(char)) {
|
|
1931
|
+
return STYLE_DOUBLE;
|
|
1932
|
+
}
|
|
1933
|
+
plain = plain && isPlainSafe(char, prevChar, inblock);
|
|
1934
|
+
prevChar = char;
|
|
1935
|
+
}
|
|
1936
|
+
hasFoldableLine = hasFoldableLine || shouldTrackWidth && (i - previousLineBreak - 1 > lineWidth && string[previousLineBreak + 1] !== " ");
|
|
1937
|
+
}
|
|
1938
|
+
if (!hasLineBreak && !hasFoldableLine) {
|
|
1939
|
+
if (plain && !forceQuotes && !testAmbiguousType(string)) {
|
|
1940
|
+
return STYLE_PLAIN;
|
|
1941
|
+
}
|
|
1942
|
+
return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : STYLE_SINGLE;
|
|
1943
|
+
}
|
|
1944
|
+
if (indentPerLevel > 9 && needIndentIndicator(string)) {
|
|
1945
|
+
return STYLE_DOUBLE;
|
|
1946
|
+
}
|
|
1947
|
+
if (!forceQuotes) {
|
|
1948
|
+
return hasFoldableLine ? STYLE_FOLDED : STYLE_LITERAL;
|
|
1949
|
+
}
|
|
1950
|
+
return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : STYLE_SINGLE;
|
|
1951
|
+
};
|
|
1952
|
+
writeScalar = function(state, string, level, iskey, inblock) {
|
|
1953
|
+
state.dump = function() {
|
|
1954
|
+
if (string.length === 0) {
|
|
1955
|
+
return state.quotingType === QUOTING_TYPE_DOUBLE ? '""' : "''";
|
|
1956
|
+
}
|
|
1957
|
+
if (!state.noCompatMode) {
|
|
1958
|
+
if (DEPRECATED_BOOLEANS_SYNTAX.indexOf(string) !== -1 || DEPRECATED_BASE60_SYNTAX.test(string)) {
|
|
1959
|
+
return state.quotingType === QUOTING_TYPE_DOUBLE ? '"' + string + '"' : "'" + string + "'";
|
|
1960
|
+
}
|
|
1961
|
+
}
|
|
1962
|
+
var indent = state.indent * Math.max(1, level);
|
|
1963
|
+
var lineWidth = state.lineWidth === -1 ? -1 : Math.max(Math.min(state.lineWidth, 40), state.lineWidth - indent);
|
|
1964
|
+
var singleLineOnly = iskey || state.flowLevel > -1 && level >= state.flowLevel;
|
|
1965
|
+
function testAmbiguity(string2) {
|
|
1966
|
+
return testImplicitResolving(state, string2);
|
|
1967
|
+
}
|
|
1968
|
+
switch (chooseScalarStyle(string, singleLineOnly, state.indent, lineWidth, testAmbiguity, state.quotingType, state.forceQuotes && !iskey, inblock)) {
|
|
1969
|
+
case STYLE_PLAIN:
|
|
1970
|
+
return string;
|
|
1971
|
+
case STYLE_SINGLE:
|
|
1972
|
+
return "'" + string.replace(/'/g, "''") + "'";
|
|
1973
|
+
case STYLE_LITERAL:
|
|
1974
|
+
return "|" + blockHeader(string, state.indent) + dropEndingNewline(indentString(string, indent));
|
|
1975
|
+
case STYLE_FOLDED:
|
|
1976
|
+
return ">" + blockHeader(string, state.indent) + dropEndingNewline(indentString(foldString(string, lineWidth), indent));
|
|
1977
|
+
case STYLE_DOUBLE:
|
|
1978
|
+
return '"' + escapeString(string) + '"';
|
|
1979
|
+
default:
|
|
1980
|
+
throw new exception("impossible error: invalid scalar style");
|
|
1981
|
+
}
|
|
1982
|
+
}();
|
|
1983
|
+
};
|
|
1984
|
+
blockHeader = function(string, indentPerLevel) {
|
|
1985
|
+
var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : "";
|
|
1986
|
+
var clip = string[string.length - 1] === "\n";
|
|
1987
|
+
var keep = clip && (string[string.length - 2] === "\n" || string === "\n");
|
|
1988
|
+
var chomp = keep ? "+" : clip ? "" : "-";
|
|
1989
|
+
return indentIndicator + chomp + "\n";
|
|
1990
|
+
};
|
|
1991
|
+
dropEndingNewline = function(string) {
|
|
1992
|
+
return string[string.length - 1] === "\n" ? string.slice(0, -1) : string;
|
|
1993
|
+
};
|
|
1994
|
+
foldString = function(string, width) {
|
|
1995
|
+
var lineRe = /(\n+)([^\n]*)/g;
|
|
1996
|
+
var result = function() {
|
|
1997
|
+
var nextLF = string.indexOf("\n");
|
|
1998
|
+
nextLF = nextLF !== -1 ? nextLF : string.length;
|
|
1999
|
+
lineRe.lastIndex = nextLF;
|
|
2000
|
+
return foldLine(string.slice(0, nextLF), width);
|
|
2001
|
+
}();
|
|
2002
|
+
var prevMoreIndented = string[0] === "\n" || string[0] === " ";
|
|
2003
|
+
var moreIndented;
|
|
2004
|
+
var match;
|
|
2005
|
+
while (match = lineRe.exec(string)) {
|
|
2006
|
+
var prefix = match[1], line = match[2];
|
|
2007
|
+
moreIndented = line[0] === " ";
|
|
2008
|
+
result += prefix + (!prevMoreIndented && !moreIndented && line !== "" ? "\n" : "") + foldLine(line, width);
|
|
2009
|
+
prevMoreIndented = moreIndented;
|
|
2010
|
+
}
|
|
2011
|
+
return result;
|
|
2012
|
+
};
|
|
2013
|
+
foldLine = function(line, width) {
|
|
2014
|
+
if (line === "" || line[0] === " ")
|
|
2015
|
+
return line;
|
|
2016
|
+
var breakRe = / [^ ]/g;
|
|
2017
|
+
var match;
|
|
2018
|
+
var start = 0, end, curr = 0, next = 0;
|
|
2019
|
+
var result = "";
|
|
2020
|
+
while (match = breakRe.exec(line)) {
|
|
2021
|
+
next = match.index;
|
|
2022
|
+
if (next - start > width) {
|
|
2023
|
+
end = curr > start ? curr : next;
|
|
2024
|
+
result += "\n" + line.slice(start, end);
|
|
2025
|
+
start = end + 1;
|
|
2026
|
+
}
|
|
2027
|
+
curr = next;
|
|
2028
|
+
}
|
|
2029
|
+
result += "\n";
|
|
2030
|
+
if (line.length - start > width && curr > start) {
|
|
2031
|
+
result += line.slice(start, curr) + "\n" + line.slice(curr + 1);
|
|
2032
|
+
} else {
|
|
2033
|
+
result += line.slice(start);
|
|
2034
|
+
}
|
|
2035
|
+
return result.slice(1);
|
|
2036
|
+
};
|
|
2037
|
+
escapeString = function(string) {
|
|
2038
|
+
var result = "";
|
|
2039
|
+
var char = 0;
|
|
2040
|
+
var escapeSeq;
|
|
2041
|
+
for (var i = 0;i < string.length; char >= 65536 ? i += 2 : i++) {
|
|
2042
|
+
char = codePointAt(string, i);
|
|
2043
|
+
escapeSeq = ESCAPE_SEQUENCES[char];
|
|
2044
|
+
if (!escapeSeq && isPrintable(char)) {
|
|
2045
|
+
result += string[i];
|
|
2046
|
+
if (char >= 65536)
|
|
2047
|
+
result += string[i + 1];
|
|
2048
|
+
} else {
|
|
2049
|
+
result += escapeSeq || encodeHex(char);
|
|
2050
|
+
}
|
|
2051
|
+
}
|
|
2052
|
+
return result;
|
|
2053
|
+
};
|
|
2054
|
+
writeFlowSequence = function(state, level, object) {
|
|
2055
|
+
var _result = "", _tag = state.tag, index, length, value;
|
|
2056
|
+
for (index = 0, length = object.length;index < length; index += 1) {
|
|
2057
|
+
value = object[index];
|
|
2058
|
+
if (state.replacer) {
|
|
2059
|
+
value = state.replacer.call(object, String(index), value);
|
|
2060
|
+
}
|
|
2061
|
+
if (writeNode(state, level, value, false, false) || typeof value === "undefined" && writeNode(state, level, null, false, false)) {
|
|
2062
|
+
if (_result !== "")
|
|
2063
|
+
_result += "," + (!state.condenseFlow ? " " : "");
|
|
2064
|
+
_result += state.dump;
|
|
2065
|
+
}
|
|
2066
|
+
}
|
|
2067
|
+
state.tag = _tag;
|
|
2068
|
+
state.dump = "[" + _result + "]";
|
|
2069
|
+
};
|
|
2070
|
+
writeBlockSequence = function(state, level, object, compact) {
|
|
2071
|
+
var _result = "", _tag = state.tag, index, length, value;
|
|
2072
|
+
for (index = 0, length = object.length;index < length; index += 1) {
|
|
2073
|
+
value = object[index];
|
|
2074
|
+
if (state.replacer) {
|
|
2075
|
+
value = state.replacer.call(object, String(index), value);
|
|
2076
|
+
}
|
|
2077
|
+
if (writeNode(state, level + 1, value, true, true, false, true) || typeof value === "undefined" && writeNode(state, level + 1, null, true, true, false, true)) {
|
|
2078
|
+
if (!compact || _result !== "") {
|
|
2079
|
+
_result += generateNextLine(state, level);
|
|
2080
|
+
}
|
|
2081
|
+
if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
|
|
2082
|
+
_result += "-";
|
|
2083
|
+
} else {
|
|
2084
|
+
_result += "- ";
|
|
2085
|
+
}
|
|
2086
|
+
_result += state.dump;
|
|
2087
|
+
}
|
|
2088
|
+
}
|
|
2089
|
+
state.tag = _tag;
|
|
2090
|
+
state.dump = _result || "[]";
|
|
2091
|
+
};
|
|
2092
|
+
writeFlowMapping = function(state, level, object) {
|
|
2093
|
+
var _result = "", _tag = state.tag, objectKeyList = Object.keys(object), index, length, objectKey, objectValue, pairBuffer;
|
|
2094
|
+
for (index = 0, length = objectKeyList.length;index < length; index += 1) {
|
|
2095
|
+
pairBuffer = "";
|
|
2096
|
+
if (_result !== "")
|
|
2097
|
+
pairBuffer += ", ";
|
|
2098
|
+
if (state.condenseFlow)
|
|
2099
|
+
pairBuffer += '"';
|
|
2100
|
+
objectKey = objectKeyList[index];
|
|
2101
|
+
objectValue = object[objectKey];
|
|
2102
|
+
if (state.replacer) {
|
|
2103
|
+
objectValue = state.replacer.call(object, objectKey, objectValue);
|
|
2104
|
+
}
|
|
2105
|
+
if (!writeNode(state, level, objectKey, false, false)) {
|
|
2106
|
+
continue;
|
|
2107
|
+
}
|
|
2108
|
+
if (state.dump.length > 1024)
|
|
2109
|
+
pairBuffer += "? ";
|
|
2110
|
+
pairBuffer += state.dump + (state.condenseFlow ? '"' : "") + ":" + (state.condenseFlow ? "" : " ");
|
|
2111
|
+
if (!writeNode(state, level, objectValue, false, false)) {
|
|
2112
|
+
continue;
|
|
2113
|
+
}
|
|
2114
|
+
pairBuffer += state.dump;
|
|
2115
|
+
_result += pairBuffer;
|
|
2116
|
+
}
|
|
2117
|
+
state.tag = _tag;
|
|
2118
|
+
state.dump = "{" + _result + "}";
|
|
2119
|
+
};
|
|
2120
|
+
writeBlockMapping = function(state, level, object, compact) {
|
|
2121
|
+
var _result = "", _tag = state.tag, objectKeyList = Object.keys(object), index, length, objectKey, objectValue, explicitPair, pairBuffer;
|
|
2122
|
+
if (state.sortKeys === true) {
|
|
2123
|
+
objectKeyList.sort();
|
|
2124
|
+
} else if (typeof state.sortKeys === "function") {
|
|
2125
|
+
objectKeyList.sort(state.sortKeys);
|
|
2126
|
+
} else if (state.sortKeys) {
|
|
2127
|
+
throw new exception("sortKeys must be a boolean or a function");
|
|
2128
|
+
}
|
|
2129
|
+
for (index = 0, length = objectKeyList.length;index < length; index += 1) {
|
|
2130
|
+
pairBuffer = "";
|
|
2131
|
+
if (!compact || _result !== "") {
|
|
2132
|
+
pairBuffer += generateNextLine(state, level);
|
|
2133
|
+
}
|
|
2134
|
+
objectKey = objectKeyList[index];
|
|
2135
|
+
objectValue = object[objectKey];
|
|
2136
|
+
if (state.replacer) {
|
|
2137
|
+
objectValue = state.replacer.call(object, objectKey, objectValue);
|
|
2138
|
+
}
|
|
2139
|
+
if (!writeNode(state, level + 1, objectKey, true, true, true)) {
|
|
2140
|
+
continue;
|
|
2141
|
+
}
|
|
2142
|
+
explicitPair = state.tag !== null && state.tag !== "?" || state.dump && state.dump.length > 1024;
|
|
2143
|
+
if (explicitPair) {
|
|
2144
|
+
if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
|
|
2145
|
+
pairBuffer += "?";
|
|
2146
|
+
} else {
|
|
2147
|
+
pairBuffer += "? ";
|
|
2148
|
+
}
|
|
2149
|
+
}
|
|
2150
|
+
pairBuffer += state.dump;
|
|
2151
|
+
if (explicitPair) {
|
|
2152
|
+
pairBuffer += generateNextLine(state, level);
|
|
2153
|
+
}
|
|
2154
|
+
if (!writeNode(state, level + 1, objectValue, true, explicitPair)) {
|
|
2155
|
+
continue;
|
|
2156
|
+
}
|
|
2157
|
+
if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
|
|
2158
|
+
pairBuffer += ":";
|
|
2159
|
+
} else {
|
|
2160
|
+
pairBuffer += ": ";
|
|
2161
|
+
}
|
|
2162
|
+
pairBuffer += state.dump;
|
|
2163
|
+
_result += pairBuffer;
|
|
2164
|
+
}
|
|
2165
|
+
state.tag = _tag;
|
|
2166
|
+
state.dump = _result || "{}";
|
|
2167
|
+
};
|
|
2168
|
+
detectType = function(state, object, explicit) {
|
|
2169
|
+
var _result, typeList, index, length, type, style;
|
|
2170
|
+
typeList = explicit ? state.explicitTypes : state.implicitTypes;
|
|
2171
|
+
for (index = 0, length = typeList.length;index < length; index += 1) {
|
|
2172
|
+
type = typeList[index];
|
|
2173
|
+
if ((type.instanceOf || type.predicate) && (!type.instanceOf || typeof object === "object" && object instanceof type.instanceOf) && (!type.predicate || type.predicate(object))) {
|
|
2174
|
+
if (explicit) {
|
|
2175
|
+
if (type.multi && type.representName) {
|
|
2176
|
+
state.tag = type.representName(object);
|
|
2177
|
+
} else {
|
|
2178
|
+
state.tag = type.tag;
|
|
2179
|
+
}
|
|
2180
|
+
} else {
|
|
2181
|
+
state.tag = "?";
|
|
2182
|
+
}
|
|
2183
|
+
if (type.represent) {
|
|
2184
|
+
style = state.styleMap[type.tag] || type.defaultStyle;
|
|
2185
|
+
if (_toString.call(type.represent) === "[object Function]") {
|
|
2186
|
+
_result = type.represent(object, style);
|
|
2187
|
+
} else if (_hasOwnProperty.call(type.represent, style)) {
|
|
2188
|
+
_result = type.represent[style](object, style);
|
|
2189
|
+
} else {
|
|
2190
|
+
throw new exception("!<" + type.tag + '> tag resolver accepts not "' + style + '" style');
|
|
2191
|
+
}
|
|
2192
|
+
state.dump = _result;
|
|
2193
|
+
}
|
|
2194
|
+
return true;
|
|
2195
|
+
}
|
|
2196
|
+
}
|
|
2197
|
+
return false;
|
|
2198
|
+
};
|
|
2199
|
+
writeNode = function(state, level, object, block, compact, iskey, isblockseq) {
|
|
2200
|
+
state.tag = null;
|
|
2201
|
+
state.dump = object;
|
|
2202
|
+
if (!detectType(state, object, false)) {
|
|
2203
|
+
detectType(state, object, true);
|
|
2204
|
+
}
|
|
2205
|
+
var type = _toString.call(state.dump);
|
|
2206
|
+
var inblock = block;
|
|
2207
|
+
var tagStr;
|
|
2208
|
+
if (block) {
|
|
2209
|
+
block = state.flowLevel < 0 || state.flowLevel > level;
|
|
2210
|
+
}
|
|
2211
|
+
var objectOrArray = type === "[object Object]" || type === "[object Array]", duplicateIndex, duplicate;
|
|
2212
|
+
if (objectOrArray) {
|
|
2213
|
+
duplicateIndex = state.duplicates.indexOf(object);
|
|
2214
|
+
duplicate = duplicateIndex !== -1;
|
|
2215
|
+
}
|
|
2216
|
+
if (state.tag !== null && state.tag !== "?" || duplicate || state.indent !== 2 && level > 0) {
|
|
2217
|
+
compact = false;
|
|
2218
|
+
}
|
|
2219
|
+
if (duplicate && state.usedDuplicates[duplicateIndex]) {
|
|
2220
|
+
state.dump = "*ref_" + duplicateIndex;
|
|
2221
|
+
} else {
|
|
2222
|
+
if (objectOrArray && duplicate && !state.usedDuplicates[duplicateIndex]) {
|
|
2223
|
+
state.usedDuplicates[duplicateIndex] = true;
|
|
2224
|
+
}
|
|
2225
|
+
if (type === "[object Object]") {
|
|
2226
|
+
if (block && Object.keys(state.dump).length !== 0) {
|
|
2227
|
+
writeBlockMapping(state, level, state.dump, compact);
|
|
2228
|
+
if (duplicate) {
|
|
2229
|
+
state.dump = "&ref_" + duplicateIndex + state.dump;
|
|
2230
|
+
}
|
|
2231
|
+
} else {
|
|
2232
|
+
writeFlowMapping(state, level, state.dump);
|
|
2233
|
+
if (duplicate) {
|
|
2234
|
+
state.dump = "&ref_" + duplicateIndex + " " + state.dump;
|
|
2235
|
+
}
|
|
2236
|
+
}
|
|
2237
|
+
} else if (type === "[object Array]") {
|
|
2238
|
+
if (block && state.dump.length !== 0) {
|
|
2239
|
+
if (state.noArrayIndent && !isblockseq && level > 0) {
|
|
2240
|
+
writeBlockSequence(state, level - 1, state.dump, compact);
|
|
2241
|
+
} else {
|
|
2242
|
+
writeBlockSequence(state, level, state.dump, compact);
|
|
2243
|
+
}
|
|
2244
|
+
if (duplicate) {
|
|
2245
|
+
state.dump = "&ref_" + duplicateIndex + state.dump;
|
|
2246
|
+
}
|
|
2247
|
+
} else {
|
|
2248
|
+
writeFlowSequence(state, level, state.dump);
|
|
2249
|
+
if (duplicate) {
|
|
2250
|
+
state.dump = "&ref_" + duplicateIndex + " " + state.dump;
|
|
2251
|
+
}
|
|
2252
|
+
}
|
|
2253
|
+
} else if (type === "[object String]") {
|
|
2254
|
+
if (state.tag !== "?") {
|
|
2255
|
+
writeScalar(state, state.dump, level, iskey, inblock);
|
|
2256
|
+
}
|
|
2257
|
+
} else if (type === "[object Undefined]") {
|
|
2258
|
+
return false;
|
|
2259
|
+
} else {
|
|
2260
|
+
if (state.skipInvalid)
|
|
2261
|
+
return false;
|
|
2262
|
+
throw new exception("unacceptable kind of an object to dump " + type);
|
|
2263
|
+
}
|
|
2264
|
+
if (state.tag !== null && state.tag !== "?") {
|
|
2265
|
+
tagStr = encodeURI(state.tag[0] === "!" ? state.tag.slice(1) : state.tag).replace(/!/g, "%21");
|
|
2266
|
+
if (state.tag[0] === "!") {
|
|
2267
|
+
tagStr = "!" + tagStr;
|
|
2268
|
+
} else if (tagStr.slice(0, 18) === "tag:yaml.org,2002:") {
|
|
2269
|
+
tagStr = "!!" + tagStr.slice(18);
|
|
2270
|
+
} else {
|
|
2271
|
+
tagStr = "!<" + tagStr + ">";
|
|
2272
|
+
}
|
|
2273
|
+
state.dump = tagStr + " " + state.dump;
|
|
2274
|
+
}
|
|
2275
|
+
}
|
|
2276
|
+
return true;
|
|
2277
|
+
};
|
|
2278
|
+
getDuplicateReferences = function(object, state) {
|
|
2279
|
+
var objects = [], duplicatesIndexes = [], index, length;
|
|
2280
|
+
inspectNode(object, objects, duplicatesIndexes);
|
|
2281
|
+
for (index = 0, length = duplicatesIndexes.length;index < length; index += 1) {
|
|
2282
|
+
state.duplicates.push(objects[duplicatesIndexes[index]]);
|
|
2283
|
+
}
|
|
2284
|
+
state.usedDuplicates = new Array(length);
|
|
2285
|
+
};
|
|
2286
|
+
inspectNode = function(object, objects, duplicatesIndexes) {
|
|
2287
|
+
var objectKeyList, index, length;
|
|
2288
|
+
if (object !== null && typeof object === "object") {
|
|
2289
|
+
index = objects.indexOf(object);
|
|
2290
|
+
if (index !== -1) {
|
|
2291
|
+
if (duplicatesIndexes.indexOf(index) === -1) {
|
|
2292
|
+
duplicatesIndexes.push(index);
|
|
2293
|
+
}
|
|
2294
|
+
} else {
|
|
2295
|
+
objects.push(object);
|
|
2296
|
+
if (Array.isArray(object)) {
|
|
2297
|
+
for (index = 0, length = object.length;index < length; index += 1) {
|
|
2298
|
+
inspectNode(object[index], objects, duplicatesIndexes);
|
|
2299
|
+
}
|
|
2300
|
+
} else {
|
|
2301
|
+
objectKeyList = Object.keys(object);
|
|
2302
|
+
for (index = 0, length = objectKeyList.length;index < length; index += 1) {
|
|
2303
|
+
inspectNode(object[objectKeyList[index]], objects, duplicatesIndexes);
|
|
2304
|
+
}
|
|
2305
|
+
}
|
|
2306
|
+
}
|
|
2307
|
+
}
|
|
2308
|
+
};
|
|
2309
|
+
dump$1 = function(input, options) {
|
|
2310
|
+
options = options || {};
|
|
2311
|
+
var state = new State(options);
|
|
2312
|
+
if (!state.noRefs)
|
|
2313
|
+
getDuplicateReferences(input, state);
|
|
2314
|
+
var value = input;
|
|
2315
|
+
if (state.replacer) {
|
|
2316
|
+
value = state.replacer.call({ "": value }, "", value);
|
|
2317
|
+
}
|
|
2318
|
+
if (writeNode(state, 0, value, true, true))
|
|
2319
|
+
return state.dump + "\n";
|
|
2320
|
+
return "";
|
|
2321
|
+
};
|
|
2322
|
+
renamed = function(from, to) {
|
|
2323
|
+
return function() {
|
|
2324
|
+
throw new Error("Function yaml." + from + " is removed in js-yaml 4. Use yaml." + to + " instead, which is now safe by default.");
|
|
2325
|
+
};
|
|
2326
|
+
};
|
|
2327
|
+
/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */
|
|
2328
|
+
isNothing_1 = isNothing;
|
|
2329
|
+
isObject_1 = isObject;
|
|
2330
|
+
toArray_1 = toArray;
|
|
2331
|
+
repeat_1 = repeat;
|
|
2332
|
+
isNegativeZero_1 = isNegativeZero;
|
|
2333
|
+
extend_1 = extend;
|
|
2334
|
+
common = {
|
|
2335
|
+
isNothing: isNothing_1,
|
|
2336
|
+
isObject: isObject_1,
|
|
2337
|
+
toArray: toArray_1,
|
|
2338
|
+
repeat: repeat_1,
|
|
2339
|
+
isNegativeZero: isNegativeZero_1,
|
|
2340
|
+
extend: extend_1
|
|
2341
|
+
};
|
|
2342
|
+
YAMLException$1.prototype = Object.create(Error.prototype);
|
|
2343
|
+
YAMLException$1.prototype.constructor = YAMLException$1;
|
|
2344
|
+
YAMLException$1.prototype.toString = function toString(compact) {
|
|
2345
|
+
return this.name + ": " + formatError(this, compact);
|
|
2346
|
+
};
|
|
2347
|
+
exception = YAMLException$1;
|
|
2348
|
+
snippet = makeSnippet;
|
|
2349
|
+
TYPE_CONSTRUCTOR_OPTIONS = [
|
|
2350
|
+
"kind",
|
|
2351
|
+
"multi",
|
|
2352
|
+
"resolve",
|
|
2353
|
+
"construct",
|
|
2354
|
+
"instanceOf",
|
|
2355
|
+
"predicate",
|
|
2356
|
+
"represent",
|
|
2357
|
+
"representName",
|
|
2358
|
+
"defaultStyle",
|
|
2359
|
+
"styleAliases"
|
|
2360
|
+
];
|
|
2361
|
+
YAML_NODE_KINDS = [
|
|
2362
|
+
"scalar",
|
|
2363
|
+
"sequence",
|
|
2364
|
+
"mapping"
|
|
2365
|
+
];
|
|
2366
|
+
type = Type$1;
|
|
2367
|
+
Schema$1.prototype.extend = function extend2(definition) {
|
|
2368
|
+
var implicit = [];
|
|
2369
|
+
var explicit = [];
|
|
2370
|
+
if (definition instanceof type) {
|
|
2371
|
+
explicit.push(definition);
|
|
2372
|
+
} else if (Array.isArray(definition)) {
|
|
2373
|
+
explicit = explicit.concat(definition);
|
|
2374
|
+
} else if (definition && (Array.isArray(definition.implicit) || Array.isArray(definition.explicit))) {
|
|
2375
|
+
if (definition.implicit)
|
|
2376
|
+
implicit = implicit.concat(definition.implicit);
|
|
2377
|
+
if (definition.explicit)
|
|
2378
|
+
explicit = explicit.concat(definition.explicit);
|
|
2379
|
+
} else {
|
|
2380
|
+
throw new exception("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");
|
|
2381
|
+
}
|
|
2382
|
+
implicit.forEach(function(type$1) {
|
|
2383
|
+
if (!(type$1 instanceof type)) {
|
|
2384
|
+
throw new exception("Specified list of YAML types (or a single Type object) contains a non-Type object.");
|
|
2385
|
+
}
|
|
2386
|
+
if (type$1.loadKind && type$1.loadKind !== "scalar") {
|
|
2387
|
+
throw new exception("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");
|
|
2388
|
+
}
|
|
2389
|
+
if (type$1.multi) {
|
|
2390
|
+
throw new exception("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.");
|
|
2391
|
+
}
|
|
2392
|
+
});
|
|
2393
|
+
explicit.forEach(function(type$1) {
|
|
2394
|
+
if (!(type$1 instanceof type)) {
|
|
2395
|
+
throw new exception("Specified list of YAML types (or a single Type object) contains a non-Type object.");
|
|
2396
|
+
}
|
|
2397
|
+
});
|
|
2398
|
+
var result = Object.create(Schema$1.prototype);
|
|
2399
|
+
result.implicit = (this.implicit || []).concat(implicit);
|
|
2400
|
+
result.explicit = (this.explicit || []).concat(explicit);
|
|
2401
|
+
result.compiledImplicit = compileList(result, "implicit");
|
|
2402
|
+
result.compiledExplicit = compileList(result, "explicit");
|
|
2403
|
+
result.compiledTypeMap = compileMap(result.compiledImplicit, result.compiledExplicit);
|
|
2404
|
+
return result;
|
|
2405
|
+
};
|
|
2406
|
+
schema = Schema$1;
|
|
2407
|
+
str = new type("tag:yaml.org,2002:str", {
|
|
2408
|
+
kind: "scalar",
|
|
2409
|
+
construct: function(data) {
|
|
2410
|
+
return data !== null ? data : "";
|
|
2411
|
+
}
|
|
2412
|
+
});
|
|
2413
|
+
seq = new type("tag:yaml.org,2002:seq", {
|
|
2414
|
+
kind: "sequence",
|
|
2415
|
+
construct: function(data) {
|
|
2416
|
+
return data !== null ? data : [];
|
|
2417
|
+
}
|
|
2418
|
+
});
|
|
2419
|
+
map = new type("tag:yaml.org,2002:map", {
|
|
2420
|
+
kind: "mapping",
|
|
2421
|
+
construct: function(data) {
|
|
2422
|
+
return data !== null ? data : {};
|
|
2423
|
+
}
|
|
2424
|
+
});
|
|
2425
|
+
failsafe = new schema({
|
|
2426
|
+
explicit: [
|
|
2427
|
+
str,
|
|
2428
|
+
seq,
|
|
2429
|
+
map
|
|
2430
|
+
]
|
|
2431
|
+
});
|
|
2432
|
+
_null = new type("tag:yaml.org,2002:null", {
|
|
2433
|
+
kind: "scalar",
|
|
2434
|
+
resolve: resolveYamlNull,
|
|
2435
|
+
construct: constructYamlNull,
|
|
2436
|
+
predicate: isNull,
|
|
2437
|
+
represent: {
|
|
2438
|
+
canonical: function() {
|
|
2439
|
+
return "~";
|
|
2440
|
+
},
|
|
2441
|
+
lowercase: function() {
|
|
2442
|
+
return "null";
|
|
2443
|
+
},
|
|
2444
|
+
uppercase: function() {
|
|
2445
|
+
return "NULL";
|
|
2446
|
+
},
|
|
2447
|
+
camelcase: function() {
|
|
2448
|
+
return "Null";
|
|
2449
|
+
},
|
|
2450
|
+
empty: function() {
|
|
2451
|
+
return "";
|
|
2452
|
+
}
|
|
2453
|
+
},
|
|
2454
|
+
defaultStyle: "lowercase"
|
|
2455
|
+
});
|
|
2456
|
+
bool = new type("tag:yaml.org,2002:bool", {
|
|
2457
|
+
kind: "scalar",
|
|
2458
|
+
resolve: resolveYamlBoolean,
|
|
2459
|
+
construct: constructYamlBoolean,
|
|
2460
|
+
predicate: isBoolean,
|
|
2461
|
+
represent: {
|
|
2462
|
+
lowercase: function(object) {
|
|
2463
|
+
return object ? "true" : "false";
|
|
2464
|
+
},
|
|
2465
|
+
uppercase: function(object) {
|
|
2466
|
+
return object ? "TRUE" : "FALSE";
|
|
2467
|
+
},
|
|
2468
|
+
camelcase: function(object) {
|
|
2469
|
+
return object ? "True" : "False";
|
|
2470
|
+
}
|
|
2471
|
+
},
|
|
2472
|
+
defaultStyle: "lowercase"
|
|
2473
|
+
});
|
|
2474
|
+
int = new type("tag:yaml.org,2002:int", {
|
|
2475
|
+
kind: "scalar",
|
|
2476
|
+
resolve: resolveYamlInteger,
|
|
2477
|
+
construct: constructYamlInteger,
|
|
2478
|
+
predicate: isInteger,
|
|
2479
|
+
represent: {
|
|
2480
|
+
binary: function(obj) {
|
|
2481
|
+
return obj >= 0 ? "0b" + obj.toString(2) : "-0b" + obj.toString(2).slice(1);
|
|
2482
|
+
},
|
|
2483
|
+
octal: function(obj) {
|
|
2484
|
+
return obj >= 0 ? "0o" + obj.toString(8) : "-0o" + obj.toString(8).slice(1);
|
|
2485
|
+
},
|
|
2486
|
+
decimal: function(obj) {
|
|
2487
|
+
return obj.toString(10);
|
|
2488
|
+
},
|
|
2489
|
+
hexadecimal: function(obj) {
|
|
2490
|
+
return obj >= 0 ? "0x" + obj.toString(16).toUpperCase() : "-0x" + obj.toString(16).toUpperCase().slice(1);
|
|
2491
|
+
}
|
|
2492
|
+
},
|
|
2493
|
+
defaultStyle: "decimal",
|
|
2494
|
+
styleAliases: {
|
|
2495
|
+
binary: [2, "bin"],
|
|
2496
|
+
octal: [8, "oct"],
|
|
2497
|
+
decimal: [10, "dec"],
|
|
2498
|
+
hexadecimal: [16, "hex"]
|
|
2499
|
+
}
|
|
2500
|
+
});
|
|
2501
|
+
YAML_FLOAT_PATTERN = new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");
|
|
2502
|
+
SCIENTIFIC_WITHOUT_DOT = /^[-+]?[0-9]+e/;
|
|
2503
|
+
float = new type("tag:yaml.org,2002:float", {
|
|
2504
|
+
kind: "scalar",
|
|
2505
|
+
resolve: resolveYamlFloat,
|
|
2506
|
+
construct: constructYamlFloat,
|
|
2507
|
+
predicate: isFloat,
|
|
2508
|
+
represent: representYamlFloat,
|
|
2509
|
+
defaultStyle: "lowercase"
|
|
2510
|
+
});
|
|
2511
|
+
json = failsafe.extend({
|
|
2512
|
+
implicit: [
|
|
2513
|
+
_null,
|
|
2514
|
+
bool,
|
|
2515
|
+
int,
|
|
2516
|
+
float
|
|
2517
|
+
]
|
|
2518
|
+
});
|
|
2519
|
+
core = json;
|
|
2520
|
+
YAML_DATE_REGEXP = new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$");
|
|
2521
|
+
YAML_TIMESTAMP_REGEXP = new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");
|
|
2522
|
+
timestamp = new type("tag:yaml.org,2002:timestamp", {
|
|
2523
|
+
kind: "scalar",
|
|
2524
|
+
resolve: resolveYamlTimestamp,
|
|
2525
|
+
construct: constructYamlTimestamp,
|
|
2526
|
+
instanceOf: Date,
|
|
2527
|
+
represent: representYamlTimestamp
|
|
2528
|
+
});
|
|
2529
|
+
merge = new type("tag:yaml.org,2002:merge", {
|
|
2530
|
+
kind: "scalar",
|
|
2531
|
+
resolve: resolveYamlMerge
|
|
2532
|
+
});
|
|
2533
|
+
BASE64_MAP = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";
|
|
2534
|
+
binary = new type("tag:yaml.org,2002:binary", {
|
|
2535
|
+
kind: "scalar",
|
|
2536
|
+
resolve: resolveYamlBinary,
|
|
2537
|
+
construct: constructYamlBinary,
|
|
2538
|
+
predicate: isBinary,
|
|
2539
|
+
represent: representYamlBinary
|
|
2540
|
+
});
|
|
2541
|
+
_hasOwnProperty$3 = Object.prototype.hasOwnProperty;
|
|
2542
|
+
_toString$2 = Object.prototype.toString;
|
|
2543
|
+
omap = new type("tag:yaml.org,2002:omap", {
|
|
2544
|
+
kind: "sequence",
|
|
2545
|
+
resolve: resolveYamlOmap,
|
|
2546
|
+
construct: constructYamlOmap
|
|
2547
|
+
});
|
|
2548
|
+
_toString$1 = Object.prototype.toString;
|
|
2549
|
+
pairs = new type("tag:yaml.org,2002:pairs", {
|
|
2550
|
+
kind: "sequence",
|
|
2551
|
+
resolve: resolveYamlPairs,
|
|
2552
|
+
construct: constructYamlPairs
|
|
2553
|
+
});
|
|
2554
|
+
_hasOwnProperty$2 = Object.prototype.hasOwnProperty;
|
|
2555
|
+
set = new type("tag:yaml.org,2002:set", {
|
|
2556
|
+
kind: "mapping",
|
|
2557
|
+
resolve: resolveYamlSet,
|
|
2558
|
+
construct: constructYamlSet
|
|
2559
|
+
});
|
|
2560
|
+
_default = core.extend({
|
|
2561
|
+
implicit: [
|
|
2562
|
+
timestamp,
|
|
2563
|
+
merge
|
|
2564
|
+
],
|
|
2565
|
+
explicit: [
|
|
2566
|
+
binary,
|
|
2567
|
+
omap,
|
|
2568
|
+
pairs,
|
|
2569
|
+
set
|
|
2570
|
+
]
|
|
2571
|
+
});
|
|
2572
|
+
_hasOwnProperty$1 = Object.prototype.hasOwnProperty;
|
|
2573
|
+
CONTEXT_FLOW_IN = 1;
|
|
2574
|
+
CONTEXT_FLOW_OUT = 2;
|
|
2575
|
+
CONTEXT_BLOCK_IN = 3;
|
|
2576
|
+
CONTEXT_BLOCK_OUT = 4;
|
|
2577
|
+
CHOMPING_CLIP = 1;
|
|
2578
|
+
CHOMPING_STRIP = 2;
|
|
2579
|
+
CHOMPING_KEEP = 3;
|
|
2580
|
+
PATTERN_NON_PRINTABLE = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;
|
|
2581
|
+
PATTERN_NON_ASCII_LINE_BREAKS = /[\x85\u2028\u2029]/;
|
|
2582
|
+
PATTERN_FLOW_INDICATORS = /[,\[\]\{\}]/;
|
|
2583
|
+
PATTERN_TAG_HANDLE = /^(?:!|!!|![a-z\-]+!)$/i;
|
|
2584
|
+
PATTERN_TAG_URI = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;
|
|
2585
|
+
simpleEscapeCheck = new Array(256);
|
|
2586
|
+
simpleEscapeMap = new Array(256);
|
|
2587
|
+
for (i = 0;i < 256; i++) {
|
|
2588
|
+
simpleEscapeCheck[i] = simpleEscapeSequence(i) ? 1 : 0;
|
|
2589
|
+
simpleEscapeMap[i] = simpleEscapeSequence(i);
|
|
2590
|
+
}
|
|
2591
|
+
directiveHandlers = {
|
|
2592
|
+
YAML: function handleYamlDirective(state, name, args) {
|
|
2593
|
+
var match, major, minor;
|
|
2594
|
+
if (state.version !== null) {
|
|
2595
|
+
throwError(state, "duplication of %YAML directive");
|
|
2596
|
+
}
|
|
2597
|
+
if (args.length !== 1) {
|
|
2598
|
+
throwError(state, "YAML directive accepts exactly one argument");
|
|
2599
|
+
}
|
|
2600
|
+
match = /^([0-9]+)\.([0-9]+)$/.exec(args[0]);
|
|
2601
|
+
if (match === null) {
|
|
2602
|
+
throwError(state, "ill-formed argument of the YAML directive");
|
|
2603
|
+
}
|
|
2604
|
+
major = parseInt(match[1], 10);
|
|
2605
|
+
minor = parseInt(match[2], 10);
|
|
2606
|
+
if (major !== 1) {
|
|
2607
|
+
throwError(state, "unacceptable YAML version of the document");
|
|
2608
|
+
}
|
|
2609
|
+
state.version = args[0];
|
|
2610
|
+
state.checkLineBreaks = minor < 2;
|
|
2611
|
+
if (minor !== 1 && minor !== 2) {
|
|
2612
|
+
throwWarning(state, "unsupported YAML version of the document");
|
|
2613
|
+
}
|
|
2614
|
+
},
|
|
2615
|
+
TAG: function handleTagDirective(state, name, args) {
|
|
2616
|
+
var handle, prefix;
|
|
2617
|
+
if (args.length !== 2) {
|
|
2618
|
+
throwError(state, "TAG directive accepts exactly two arguments");
|
|
2619
|
+
}
|
|
2620
|
+
handle = args[0];
|
|
2621
|
+
prefix = args[1];
|
|
2622
|
+
if (!PATTERN_TAG_HANDLE.test(handle)) {
|
|
2623
|
+
throwError(state, "ill-formed tag handle (first argument) of the TAG directive");
|
|
2624
|
+
}
|
|
2625
|
+
if (_hasOwnProperty$1.call(state.tagMap, handle)) {
|
|
2626
|
+
throwError(state, 'there is a previously declared suffix for "' + handle + '" tag handle');
|
|
2627
|
+
}
|
|
2628
|
+
if (!PATTERN_TAG_URI.test(prefix)) {
|
|
2629
|
+
throwError(state, "ill-formed tag prefix (second argument) of the TAG directive");
|
|
2630
|
+
}
|
|
2631
|
+
try {
|
|
2632
|
+
prefix = decodeURIComponent(prefix);
|
|
2633
|
+
} catch (err) {
|
|
2634
|
+
throwError(state, "tag prefix is malformed: " + prefix);
|
|
2635
|
+
}
|
|
2636
|
+
state.tagMap[handle] = prefix;
|
|
2637
|
+
}
|
|
2638
|
+
};
|
|
2639
|
+
loadAll_1 = loadAll$1;
|
|
2640
|
+
load_1 = load$1;
|
|
2641
|
+
loader = {
|
|
2642
|
+
loadAll: loadAll_1,
|
|
2643
|
+
load: load_1
|
|
2644
|
+
};
|
|
2645
|
+
_toString = Object.prototype.toString;
|
|
2646
|
+
_hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
2647
|
+
CHAR_BOM = 65279;
|
|
2648
|
+
CHAR_TAB = 9;
|
|
2649
|
+
CHAR_LINE_FEED = 10;
|
|
2650
|
+
CHAR_CARRIAGE_RETURN = 13;
|
|
2651
|
+
CHAR_SPACE = 32;
|
|
2652
|
+
CHAR_EXCLAMATION = 33;
|
|
2653
|
+
CHAR_DOUBLE_QUOTE = 34;
|
|
2654
|
+
CHAR_SHARP = 35;
|
|
2655
|
+
CHAR_PERCENT = 37;
|
|
2656
|
+
CHAR_AMPERSAND = 38;
|
|
2657
|
+
CHAR_SINGLE_QUOTE = 39;
|
|
2658
|
+
CHAR_ASTERISK = 42;
|
|
2659
|
+
CHAR_COMMA = 44;
|
|
2660
|
+
CHAR_MINUS = 45;
|
|
2661
|
+
CHAR_COLON = 58;
|
|
2662
|
+
CHAR_EQUALS = 61;
|
|
2663
|
+
CHAR_GREATER_THAN = 62;
|
|
2664
|
+
CHAR_QUESTION = 63;
|
|
2665
|
+
CHAR_COMMERCIAL_AT = 64;
|
|
2666
|
+
CHAR_LEFT_SQUARE_BRACKET = 91;
|
|
2667
|
+
CHAR_RIGHT_SQUARE_BRACKET = 93;
|
|
2668
|
+
CHAR_GRAVE_ACCENT = 96;
|
|
2669
|
+
CHAR_LEFT_CURLY_BRACKET = 123;
|
|
2670
|
+
CHAR_VERTICAL_LINE = 124;
|
|
2671
|
+
CHAR_RIGHT_CURLY_BRACKET = 125;
|
|
2672
|
+
ESCAPE_SEQUENCES = {};
|
|
2673
|
+
ESCAPE_SEQUENCES[0] = "\\0";
|
|
2674
|
+
ESCAPE_SEQUENCES[7] = "\\a";
|
|
2675
|
+
ESCAPE_SEQUENCES[8] = "\\b";
|
|
2676
|
+
ESCAPE_SEQUENCES[9] = "\\t";
|
|
2677
|
+
ESCAPE_SEQUENCES[10] = "\\n";
|
|
2678
|
+
ESCAPE_SEQUENCES[11] = "\\v";
|
|
2679
|
+
ESCAPE_SEQUENCES[12] = "\\f";
|
|
2680
|
+
ESCAPE_SEQUENCES[13] = "\\r";
|
|
2681
|
+
ESCAPE_SEQUENCES[27] = "\\e";
|
|
2682
|
+
ESCAPE_SEQUENCES[34] = '\\"';
|
|
2683
|
+
ESCAPE_SEQUENCES[92] = "\\\\";
|
|
2684
|
+
ESCAPE_SEQUENCES[133] = "\\N";
|
|
2685
|
+
ESCAPE_SEQUENCES[160] = "\\_";
|
|
2686
|
+
ESCAPE_SEQUENCES[8232] = "\\L";
|
|
2687
|
+
ESCAPE_SEQUENCES[8233] = "\\P";
|
|
2688
|
+
DEPRECATED_BOOLEANS_SYNTAX = [
|
|
2689
|
+
"y",
|
|
2690
|
+
"Y",
|
|
2691
|
+
"yes",
|
|
2692
|
+
"Yes",
|
|
2693
|
+
"YES",
|
|
2694
|
+
"on",
|
|
2695
|
+
"On",
|
|
2696
|
+
"ON",
|
|
2697
|
+
"n",
|
|
2698
|
+
"N",
|
|
2699
|
+
"no",
|
|
2700
|
+
"No",
|
|
2701
|
+
"NO",
|
|
2702
|
+
"off",
|
|
2703
|
+
"Off",
|
|
2704
|
+
"OFF"
|
|
2705
|
+
];
|
|
2706
|
+
DEPRECATED_BASE60_SYNTAX = /^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;
|
|
2707
|
+
QUOTING_TYPE_SINGLE = 1;
|
|
2708
|
+
QUOTING_TYPE_DOUBLE = 2;
|
|
2709
|
+
STYLE_PLAIN = 1;
|
|
2710
|
+
STYLE_SINGLE = 2;
|
|
2711
|
+
STYLE_LITERAL = 3;
|
|
2712
|
+
STYLE_FOLDED = 4;
|
|
2713
|
+
STYLE_DOUBLE = 5;
|
|
2714
|
+
dump_1 = dump$1;
|
|
2715
|
+
dumper = {
|
|
2716
|
+
dump: dump_1
|
|
2717
|
+
};
|
|
2718
|
+
Type = type;
|
|
2719
|
+
Schema = schema;
|
|
2720
|
+
FAILSAFE_SCHEMA = failsafe;
|
|
2721
|
+
JSON_SCHEMA = json;
|
|
2722
|
+
CORE_SCHEMA = core;
|
|
2723
|
+
DEFAULT_SCHEMA = _default;
|
|
2724
|
+
load = loader.load;
|
|
2725
|
+
loadAll = loader.loadAll;
|
|
2726
|
+
dump = dumper.dump;
|
|
2727
|
+
YAMLException = exception;
|
|
2728
|
+
types = {
|
|
2729
|
+
binary,
|
|
2730
|
+
float,
|
|
2731
|
+
map,
|
|
2732
|
+
null: _null,
|
|
2733
|
+
pairs,
|
|
2734
|
+
set,
|
|
2735
|
+
timestamp,
|
|
2736
|
+
bool,
|
|
2737
|
+
int,
|
|
2738
|
+
merge,
|
|
2739
|
+
omap,
|
|
2740
|
+
seq,
|
|
2741
|
+
str
|
|
2742
|
+
};
|
|
2743
|
+
safeLoad = renamed("safeLoad", "load");
|
|
2744
|
+
safeLoadAll = renamed("safeLoadAll", "loadAll");
|
|
2745
|
+
safeDump = renamed("safeDump", "dump");
|
|
2746
|
+
jsYaml = {
|
|
2747
|
+
Type,
|
|
2748
|
+
Schema,
|
|
2749
|
+
FAILSAFE_SCHEMA,
|
|
2750
|
+
JSON_SCHEMA,
|
|
2751
|
+
CORE_SCHEMA,
|
|
2752
|
+
DEFAULT_SCHEMA,
|
|
2753
|
+
load,
|
|
2754
|
+
loadAll,
|
|
2755
|
+
dump,
|
|
2756
|
+
YAMLException,
|
|
2757
|
+
types,
|
|
2758
|
+
safeLoad,
|
|
2759
|
+
safeLoadAll,
|
|
2760
|
+
safeDump
|
|
2761
|
+
};
|
|
2762
|
+
js_yaml_default = jsYaml;
|
|
2763
|
+
});
|
|
2764
|
+
|
|
2765
|
+
// src/index.ts
|
|
2766
|
+
var {plugin } = globalThis.Bun;
|
|
2767
|
+
plugin({
|
|
2768
|
+
name: "YAML",
|
|
2769
|
+
async setup(build) {
|
|
2770
|
+
const { load: load2 } = await Promise.resolve().then(() => (init_js_yaml(), exports_js_yaml));
|
|
2771
|
+
const { readFileSync } = await import("fs");
|
|
2772
|
+
build.onLoad({ filter: /\.(yaml|yml)$/ }, (args) => {
|
|
2773
|
+
const text = readFileSync(args.path, "utf8");
|
|
2774
|
+
const exports = load2(text);
|
|
2775
|
+
return {
|
|
2776
|
+
exports,
|
|
2777
|
+
loader: "object"
|
|
2778
|
+
};
|
|
2779
|
+
});
|
|
2780
|
+
}
|
|
2781
|
+
});
|