stackscan 0.1.6
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/LICENSE +21 -0
- package/README.md +222 -0
- package/dist/add.d.mts +3 -0
- package/dist/add.d.ts +3 -0
- package/dist/add.js +83 -0
- package/dist/add.mjs +7 -0
- package/dist/batch-import.d.mts +6 -0
- package/dist/batch-import.d.ts +6 -0
- package/dist/batch-import.js +5724 -0
- package/dist/batch-import.mjs +12 -0
- package/dist/chunk-22J2UHU7.mjs +1980 -0
- package/dist/chunk-2KG7JDHY.mjs +19 -0
- package/dist/chunk-2O2NMD7M.mjs +127 -0
- package/dist/chunk-3HEYJTUE.mjs +157 -0
- package/dist/chunk-3LPZV7KA.mjs +15 -0
- package/dist/chunk-3O2C34CJ.mjs +174 -0
- package/dist/chunk-3R4TXOZA.mjs +179 -0
- package/dist/chunk-3RJHZIII.mjs +174 -0
- package/dist/chunk-3XKWCBY6.mjs +105 -0
- package/dist/chunk-4OMBB3R6.mjs +52 -0
- package/dist/chunk-4THN5TT4.mjs +185 -0
- package/dist/chunk-4WCVZS6B.mjs +178 -0
- package/dist/chunk-5MNAT56X.mjs +23 -0
- package/dist/chunk-5VH7N3X6.mjs +109 -0
- package/dist/chunk-6A4WEZDZ.mjs +14 -0
- package/dist/chunk-6MIRBLO4.mjs +15 -0
- package/dist/chunk-6RCTNUF4.mjs +17 -0
- package/dist/chunk-7F4KWGMM.mjs +45 -0
- package/dist/chunk-7KF2HEU2.mjs +56 -0
- package/dist/chunk-7KONWCSX.mjs +15 -0
- package/dist/chunk-7TIXAYVC.mjs +10122 -0
- package/dist/chunk-ADMVFPX7.mjs +150 -0
- package/dist/chunk-AFJCX5SK.mjs +22 -0
- package/dist/chunk-ATNEVZPV.mjs +25 -0
- package/dist/chunk-BBP27ZGZ.mjs +4841 -0
- package/dist/chunk-BGT3PANW.mjs +64 -0
- package/dist/chunk-BJIQZNKU.mjs +184 -0
- package/dist/chunk-BKQW4ZNZ.mjs +19 -0
- package/dist/chunk-BMQTYZOD.mjs +144 -0
- package/dist/chunk-CZADURZD.mjs +674 -0
- package/dist/chunk-D2DOGM2Y.mjs +19 -0
- package/dist/chunk-D32C3FU6.mjs +45 -0
- package/dist/chunk-D6FFDX4P.mjs +158 -0
- package/dist/chunk-DUAFJVBN.mjs +44 -0
- package/dist/chunk-E24PAHCZ.mjs +146 -0
- package/dist/chunk-E3OD2BXY.mjs +14 -0
- package/dist/chunk-E4K5XYFI.mjs +210767 -0
- package/dist/chunk-EH2SEQZP.mjs +10119 -0
- package/dist/chunk-EH4FWTP5.mjs +21 -0
- package/dist/chunk-EOKQCSHI.mjs +10 -0
- package/dist/chunk-EQ4WRCPP.mjs +16 -0
- package/dist/chunk-EYXTSAAW.mjs +64 -0
- package/dist/chunk-F6Z4WXOF.mjs +146 -0
- package/dist/chunk-FM5BCBKT.mjs +77 -0
- package/dist/chunk-GXKIDBAX.mjs +146 -0
- package/dist/chunk-H6HA3IZE.mjs +1980 -0
- package/dist/chunk-H7WNQ3SS.mjs +23 -0
- package/dist/chunk-HBJEQ63D.mjs +205 -0
- package/dist/chunk-HTTDBNRT.mjs +146 -0
- package/dist/chunk-HYUKJUPF.mjs +177 -0
- package/dist/chunk-IFEEO473.mjs +49 -0
- package/dist/chunk-IILZ43EE.mjs +25 -0
- package/dist/chunk-ITGRHGUT.mjs +158 -0
- package/dist/chunk-J5JVDMED.mjs +45 -0
- package/dist/chunk-JH3SW4KH.mjs +4896 -0
- package/dist/chunk-JHVWSHNY.mjs +32 -0
- package/dist/chunk-JLFOQXQG.mjs +26 -0
- package/dist/chunk-K4BNSVJP.mjs +16 -0
- package/dist/chunk-KCDUZXVN.mjs +157 -0
- package/dist/chunk-KMDEPBKS.mjs +685 -0
- package/dist/chunk-L4AQWDD2.mjs +92 -0
- package/dist/chunk-L7I4UC35.mjs +158 -0
- package/dist/chunk-LB3L25FS.mjs +1980 -0
- package/dist/chunk-LDA354A3.mjs +158 -0
- package/dist/chunk-LSUI3VI4.mjs +19 -0
- package/dist/chunk-MB2X3DXF.mjs +45 -0
- package/dist/chunk-MBL4CIFG.mjs +28 -0
- package/dist/chunk-MLAUEAUQ.mjs +27 -0
- package/dist/chunk-NGEKE4DQ.mjs +23 -0
- package/dist/chunk-NJ4FK5BO.mjs +19 -0
- package/dist/chunk-OJZZPNXQ.mjs +1985 -0
- package/dist/chunk-P24PKCUA.mjs +25 -0
- package/dist/chunk-PFQIKEIL.mjs +15 -0
- package/dist/chunk-Q5ASM7HE.mjs +45 -0
- package/dist/chunk-Q7X2R7N7.mjs +16 -0
- package/dist/chunk-QAIJCQWH.mjs +157 -0
- package/dist/chunk-QQAUZGVG.mjs +2166 -0
- package/dist/chunk-QUIF3FJ2.mjs +55 -0
- package/dist/chunk-RDFZ4GVM.mjs +23 -0
- package/dist/chunk-RFRKMUNA.mjs +49 -0
- package/dist/chunk-RIIQA6S6.mjs +2204 -0
- package/dist/chunk-SGOSAU2P.mjs +51 -0
- package/dist/chunk-SLYSEMYE.mjs +21 -0
- package/dist/chunk-SNKLZ7VB.mjs +36 -0
- package/dist/chunk-TKKUEAN6.mjs +45 -0
- package/dist/chunk-TMH7EUXF.mjs +179 -0
- package/dist/chunk-TP55TF47.mjs +1980 -0
- package/dist/chunk-U4AFTAZI.mjs +1980 -0
- package/dist/chunk-U4EXCWGR.mjs +174 -0
- package/dist/chunk-U4OINWJM.mjs +42 -0
- package/dist/chunk-U63TGBAS.mjs +179 -0
- package/dist/chunk-UESFH6US.mjs +210773 -0
- package/dist/chunk-UITLHBZA.mjs +164 -0
- package/dist/chunk-VFD26CTJ.mjs +16 -0
- package/dist/chunk-VSWWWPO7.mjs +205 -0
- package/dist/chunk-VUVPGH7A.mjs +157 -0
- package/dist/chunk-W34IFT2J.mjs +45 -0
- package/dist/chunk-WPSGF5DK.mjs +92 -0
- package/dist/chunk-WPU2XV5B.mjs +25 -0
- package/dist/chunk-WTPR7TOE.mjs +146 -0
- package/dist/chunk-X3ATBJ5Q.mjs +14 -0
- package/dist/chunk-XMZATJRD.mjs +23 -0
- package/dist/chunk-Y2Y225MR.mjs +117 -0
- package/dist/chunk-YNDKJ5QJ.mjs +89 -0
- package/dist/chunk-YPQNYUP3.mjs +92 -0
- package/dist/chunk-ZH22D4SN.mjs +179 -0
- package/dist/chunk-ZSJJGBQR.mjs +39 -0
- package/dist/chunk-ZSMMBZHO.mjs +64 -0
- package/dist/chunk-ZTXCA3NN.mjs +74 -0
- package/dist/chunk-ZYMQR24Z.mjs +145 -0
- package/dist/cli.d.mts +1 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +5770 -0
- package/dist/cli.mjs +25 -0
- package/dist/config.d.mts +5 -0
- package/dist/config.d.ts +5 -0
- package/dist/config.js +41 -0
- package/dist/config.mjs +7 -0
- package/dist/defaults.d.mts +3 -0
- package/dist/defaults.d.ts +3 -0
- package/dist/defaults.js +47 -0
- package/dist/defaults.mjs +7 -0
- package/dist/detectors/ci.d.mts +5 -0
- package/dist/detectors/ci.d.ts +5 -0
- package/dist/detectors/ci.js +59 -0
- package/dist/detectors/ci.mjs +7 -0
- package/dist/detectors/docker.d.mts +5 -0
- package/dist/detectors/docker.d.ts +5 -0
- package/dist/detectors/docker.js +50 -0
- package/dist/detectors/docker.mjs +7 -0
- package/dist/detectors/next.d.mts +7 -0
- package/dist/detectors/next.d.ts +7 -0
- package/dist/detectors/next.js +49 -0
- package/dist/detectors/next.mjs +7 -0
- package/dist/detectors/prisma.d.mts +7 -0
- package/dist/detectors/prisma.d.ts +7 -0
- package/dist/detectors/prisma.js +48 -0
- package/dist/detectors/prisma.mjs +7 -0
- package/dist/import.d.mts +2 -0
- package/dist/import.d.ts +2 -0
- package/dist/import.js +2062 -0
- package/dist/import.mjs +53 -0
- package/dist/output.d.mts +7 -0
- package/dist/output.d.ts +7 -0
- package/dist/output.js +3619 -0
- package/dist/output.mjs +13 -0
- package/dist/scan.d.mts +7 -0
- package/dist/scan.d.ts +7 -0
- package/dist/scan.js +5725 -0
- package/dist/scan.mjs +12 -0
- package/dist/scanner.d.mts +5 -0
- package/dist/scanner.d.ts +5 -0
- package/dist/scanner.js +5514 -0
- package/dist/scanner.mjs +14 -0
- package/dist/simple-icons-hex.d.mts +6751 -0
- package/dist/simple-icons-hex.d.ts +6751 -0
- package/dist/simple-icons-hex.js +10118 -0
- package/dist/simple-icons-hex.mjs +6736 -0
- package/dist/sync.d.mts +7 -0
- package/dist/sync.d.ts +7 -0
- package/dist/sync.js +5725 -0
- package/dist/sync.mjs +160 -0
- package/dist/techDefinitions.d.mts +5 -0
- package/dist/techDefinitions.d.ts +5 -0
- package/dist/techDefinitions.js +2004 -0
- package/dist/techDefinitions.mjs +7 -0
- package/dist/techMap.d.mts +5 -0
- package/dist/techMap.d.ts +5 -0
- package/dist/techMap.js +2018 -0
- package/dist/techMap.mjs +8 -0
- package/dist/types.d.mts +24 -0
- package/dist/types.d.ts +24 -0
- package/dist/types.js +18 -0
- package/dist/types.mjs +1 -0
- package/dist/typescript-7Q5RIVZY.mjs +6 -0
- package/dist/typescript-T5HXSZZS.mjs +5 -0
- package/dist/watch.d.mts +3 -0
- package/dist/watch.d.ts +3 -0
- package/dist/watch.js +2122 -0
- package/dist/watch.mjs +13 -0
- package/package.json +57 -0
- package/public/assets/logos/ai/huggingface.svg +1 -0
- package/public/assets/logos/ai/langchain.svg +1 -0
- package/public/assets/logos/ai/openai.svg +1 -0
- package/public/assets/logos/ai/replicate.svg +1 -0
- package/public/assets/logos/ai/tensorflow.svg +1 -0
- package/public/assets/logos/api/apollographql.svg +1 -0
- package/public/assets/logos/api/graphql.svg +1 -0
- package/public/assets/logos/api/relay.svg +1 -0
- package/public/assets/logos/api/trpc.svg +1 -0
- package/public/assets/logos/auth/argo.svg +1 -0
- package/public/assets/logos/auth/auth0.svg +1 -0
- package/public/assets/logos/auth/authjs.svg +73 -0
- package/public/assets/logos/auth/clerk.svg +1 -0
- package/public/assets/logos/auth/firebase.svg +1 -0
- package/public/assets/logos/auth/jsonwebtokens.svg +1 -0
- package/public/assets/logos/auth/keycloak.svg +1 -0
- package/public/assets/logos/auth/passport.svg +1 -0
- package/public/assets/logos/automation/lerna.svg +1 -0
- package/public/assets/logos/automation/nx.svg +1 -0
- package/public/assets/logos/automation/turborepo.svg +1 -0
- package/public/assets/logos/backend/adonisjs.svg +1 -0
- package/public/assets/logos/backend/express.svg +1 -0
- package/public/assets/logos/backend/fastify.svg +1 -0
- package/public/assets/logos/backend/koa.svg +1 -0
- package/public/assets/logos/backend/nestjs.svg +1 -0
- package/public/assets/logos/build/babel.svg +1 -0
- package/public/assets/logos/build/esbuild.svg +1 -0
- package/public/assets/logos/build/rollupdotjs.svg +1 -0
- package/public/assets/logos/build/snowpack.svg +1 -0
- package/public/assets/logos/build/swc.svg +1 -0
- package/public/assets/logos/build/vite.svg +15 -0
- package/public/assets/logos/build/webpack.svg +1 -0
- package/public/assets/logos/ci/circleci.svg +1 -0
- package/public/assets/logos/ci/githubactions.svg +1 -0
- package/public/assets/logos/ci/gitlab.svg +1 -0
- package/public/assets/logos/ci/jenkins.svg +1 -0
- package/public/assets/logos/ci/travisci.svg +1 -0
- package/public/assets/logos/cloud/cloudflare.svg +1 -0
- package/public/assets/logos/cloud/googlecloud.svg +1 -0
- package/public/assets/logos/cloud/microsoftazure.svg +1 -0
- package/public/assets/logos/cms/contentful.svg +1 -0
- package/public/assets/logos/cms/directus.svg +1 -0
- package/public/assets/logos/cms/ghost.svg +1 -0
- package/public/assets/logos/cms/keystone.svg +1 -0
- package/public/assets/logos/cms/sanity.svg +1 -0
- package/public/assets/logos/cms/shopify.svg +1 -0
- package/public/assets/logos/cms/strapi.svg +1 -0
- package/public/assets/logos/cms/wordpress.svg +1 -0
- package/public/assets/logos/container/docker.svg +1 -0
- package/public/assets/logos/container/kubernetes.svg +1 -0
- package/public/assets/logos/css/antdesign.svg +1 -0
- package/public/assets/logos/css/bootstrap.svg +1 -0
- package/public/assets/logos/css/bulma.svg +1 -0
- package/public/assets/logos/css/chakraui.svg +1 -0
- package/public/assets/logos/css/daisyui.svg +1 -0
- package/public/assets/logos/css/fallback/mantine-logo.svg +1 -0
- package/public/assets/logos/css/fallback/shadcnui.svg +1 -0
- package/public/assets/logos/css/foundation.svg +1 -0
- package/public/assets/logos/css/headlessui.svg +1 -0
- package/public/assets/logos/css/less.svg +1 -0
- package/public/assets/logos/css/mui.svg +1 -0
- package/public/assets/logos/css/postcss.svg +1 -0
- package/public/assets/logos/css/radixui.svg +1 -0
- package/public/assets/logos/css/sass.svg +1 -0
- package/public/assets/logos/css/shadcnui.svg +1 -0
- package/public/assets/logos/css/styledcomponents.svg +1 -0
- package/public/assets/logos/css/tailwindcss.svg +1 -0
- package/public/assets/logos/database/amazondynamodb.svg +1 -0
- package/public/assets/logos/database/apachecassandra.svg +1 -0
- package/public/assets/logos/database/cockroachlabs.svg +1 -0
- package/public/assets/logos/database/duckdb.svg +1 -0
- package/public/assets/logos/database/elasticsearch.svg +1 -0
- package/public/assets/logos/database/fauna.svg +3 -0
- package/public/assets/logos/database/mariadb.svg +1 -0
- package/public/assets/logos/database/mongodb.svg +1 -0
- package/public/assets/logos/database/mysql.svg +1 -0
- package/public/assets/logos/database/planetscale.svg +1 -0
- package/public/assets/logos/database/postgresql.svg +1 -0
- package/public/assets/logos/database/redis.svg +1 -0
- package/public/assets/logos/database/sqlite.svg +1 -0
- package/public/assets/logos/database/supabase.svg +1 -0
- package/public/assets/logos/database/surrealdb.svg +1 -0
- package/public/assets/logos/devops/ansible.svg +1 -0
- package/public/assets/logos/devops/pulumi.svg +1 -0
- package/public/assets/logos/devops/serverless.svg +1 -0
- package/public/assets/logos/devops/terraform.svg +1 -0
- package/public/assets/logos/fallback/31557565.svg +32 -0
- package/public/assets/logos/fallback/Drizzle--Streamline-Simple-Icons.svg +7 -0
- package/public/assets/logos/fallback/changesets.svg +43 -0
- package/public/assets/logos/fallback/lemonsqueezy.svg +8 -0
- package/public/assets/logos/fallback/mantine-logo.svg +1 -0
- package/public/assets/logos/fallback/reactquery.svg +12 -0
- package/public/assets/logos/fallback/shadcnui.svg +21 -0
- package/public/assets/logos/fallback/stitches.svg +10 -0
- package/public/assets/logos/format/prettier.svg +1 -0
- package/public/assets/logos/frontend/alpinedotjs.svg +1 -0
- package/public/assets/logos/frontend/angular.svg +1 -0
- package/public/assets/logos/frontend/astro.svg +1 -0
- package/public/assets/logos/frontend/backbone.svg +1 -0
- package/public/assets/logos/frontend/emberdotjs.svg +1 -0
- package/public/assets/logos/frontend/htmx.svg +1 -0
- package/public/assets/logos/frontend/lit.svg +1 -0
- package/public/assets/logos/frontend/nextdotjs.svg +1 -0
- package/public/assets/logos/frontend/nuxt.svg +1 -0
- package/public/assets/logos/frontend/preact.svg +1 -0
- package/public/assets/logos/frontend/qwik.svg +1 -0
- package/public/assets/logos/frontend/react.svg +1 -0
- package/public/assets/logos/frontend/remix.svg +1 -0
- package/public/assets/logos/frontend/solid.svg +1 -0
- package/public/assets/logos/frontend/svelte.svg +1 -0
- package/public/assets/logos/frontend/vuedotjs.svg +1 -0
- package/public/assets/logos/hosting/netlify.svg +1 -0
- package/public/assets/logos/hosting/railway.svg +1 -0
- package/public/assets/logos/hosting/render.svg +1 -0
- package/public/assets/logos/hosting/vercel.svg +1 -0
- package/public/assets/logos/language/csharp.svg +1 -0
- package/public/assets/logos/language/go.svg +1 -0
- package/public/assets/logos/language/javascript.svg +1 -0
- package/public/assets/logos/language/openjdk.svg +1 -0
- package/public/assets/logos/language/php.svg +1 -0
- package/public/assets/logos/language/python.svg +1 -0
- package/public/assets/logos/language/ruby.svg +1 -0
- package/public/assets/logos/language/rust.svg +1 -0
- package/public/assets/logos/language/typescript.svg +1 -0
- package/public/assets/logos/lint/commitlint.svg +1 -0
- package/public/assets/logos/lint/eslint.svg +1 -0
- package/public/assets/logos/lint/husky.svg +3 -0
- package/public/assets/logos/lint/lintstaged.svg +3 -0
- package/public/assets/logos/mobile/capacitor.svg +1 -0
- package/public/assets/logos/mobile/expo.svg +1 -0
- package/public/assets/logos/mobile/flutter.svg +1 -0
- package/public/assets/logos/mobile/ionic.svg +1 -0
- package/public/assets/logos/mobile/react.svg +1 -0
- package/public/assets/logos/network/axios.svg +1 -0
- package/public/assets/logos/network/brandfetch.svg +1 -0
- package/public/assets/logos/network/grpc.svg +1 -0
- package/public/assets/logos/network/openapiinitiative.svg +1 -0
- package/public/assets/logos/network/swr.svg +1 -0
- package/public/assets/logos/orm/drizzle.svg +1 -0
- package/public/assets/logos/orm/mongoose.svg +1 -0
- package/public/assets/logos/orm/prisma.svg +1 -0
- package/public/assets/logos/orm/typeorm.svg +1 -0
- package/public/assets/logos/package/npm.svg +1 -0
- package/public/assets/logos/package/pnpm.svg +1 -0
- package/public/assets/logos/package/yarn.svg +1 -0
- package/public/assets/logos/payment/fallback/lemonsqueezy.svg +1 -0
- package/public/assets/logos/payment/paypal.svg +1 -0
- package/public/assets/logos/payment/stripe.svg +1 -0
- package/public/assets/logos/runtime/bun.svg +1 -0
- package/public/assets/logos/runtime/deno.svg +1 -0
- package/public/assets/logos/ssg/eleventy.svg +1 -0
- package/public/assets/logos/ssg/gatsby.svg +1 -0
- package/public/assets/logos/ssg/hugo.svg +1 -0
- package/public/assets/logos/ssg/jekyll.svg +1 -0
- package/public/assets/logos/state/mobx.svg +1 -0
- package/public/assets/logos/state/recoil.svg +1 -0
- package/public/assets/logos/state/redux.svg +1 -0
- package/public/assets/logos/state/xstate.svg +1 -0
- package/public/assets/logos/state/zustand.svg +1 -0
- package/public/assets/logos/testing/chai.svg +1 -0
- package/public/assets/logos/testing/cypress.svg +1 -0
- package/public/assets/logos/testing/jasmine.svg +1 -0
- package/public/assets/logos/testing/jest.svg +1 -0
- package/public/assets/logos/testing/mocha.svg +1 -0
- package/public/assets/logos/testing/playwright.svg +1 -0
- package/public/assets/logos/testing/puppeteer.svg +1 -0
- package/public/assets/logos/testing/storybook.svg +1 -0
- package/public/assets/logos/testing/testinglibrary.svg +1 -0
- package/public/assets/logos/testing/vitest.svg +1 -0
- package/public/assets/logos/utility/d3.svg +1 -0
- package/public/assets/logos/utility/leaflet.svg +1 -0
- package/public/assets/logos/utility/lodash.svg +1 -0
- package/public/assets/logos/utility/pyup.svg +1 -0
- package/public/assets/logos/utility/reactivex.svg +1 -0
- package/public/assets/logos/utility/threedotjs.svg +1 -0
- package/public/assets/logos/utility/zod.svg +1 -0
- package/public/stackscan-white.svg +26 -0
- package/public/stackscan.svg +26 -0
|
@@ -0,0 +1,4896 @@
|
|
|
1
|
+
import {
|
|
2
|
+
require_typescript
|
|
3
|
+
} from "./chunk-UESFH6US.mjs";
|
|
4
|
+
import {
|
|
5
|
+
__dirname,
|
|
6
|
+
__filename,
|
|
7
|
+
init_esm_shims
|
|
8
|
+
} from "./chunk-RDFZ4GVM.mjs";
|
|
9
|
+
import {
|
|
10
|
+
__commonJS,
|
|
11
|
+
__privateAdd,
|
|
12
|
+
__privateGet,
|
|
13
|
+
__privateMethod,
|
|
14
|
+
__privateSet,
|
|
15
|
+
__publicField,
|
|
16
|
+
__require,
|
|
17
|
+
__toESM
|
|
18
|
+
} from "./chunk-7KF2HEU2.mjs";
|
|
19
|
+
|
|
20
|
+
// node_modules/resolve-from/index.js
|
|
21
|
+
var require_resolve_from = __commonJS({
|
|
22
|
+
"node_modules/resolve-from/index.js"(exports, module) {
|
|
23
|
+
"use strict";
|
|
24
|
+
init_esm_shims();
|
|
25
|
+
var path = __require("path");
|
|
26
|
+
var Module = __require("module");
|
|
27
|
+
var fs = __require("fs");
|
|
28
|
+
var resolveFrom = (fromDir, moduleId, silent) => {
|
|
29
|
+
if (typeof fromDir !== "string") {
|
|
30
|
+
throw new TypeError(`Expected \`fromDir\` to be of type \`string\`, got \`${typeof fromDir}\``);
|
|
31
|
+
}
|
|
32
|
+
if (typeof moduleId !== "string") {
|
|
33
|
+
throw new TypeError(`Expected \`moduleId\` to be of type \`string\`, got \`${typeof moduleId}\``);
|
|
34
|
+
}
|
|
35
|
+
try {
|
|
36
|
+
fromDir = fs.realpathSync(fromDir);
|
|
37
|
+
} catch (err) {
|
|
38
|
+
if (err.code === "ENOENT") {
|
|
39
|
+
fromDir = path.resolve(fromDir);
|
|
40
|
+
} else if (silent) {
|
|
41
|
+
return null;
|
|
42
|
+
} else {
|
|
43
|
+
throw err;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
const fromFile = path.join(fromDir, "noop.js");
|
|
47
|
+
const resolveFileName = () => Module._resolveFilename(moduleId, {
|
|
48
|
+
id: fromFile,
|
|
49
|
+
filename: fromFile,
|
|
50
|
+
paths: Module._nodeModulePaths(fromDir)
|
|
51
|
+
});
|
|
52
|
+
if (silent) {
|
|
53
|
+
try {
|
|
54
|
+
return resolveFileName();
|
|
55
|
+
} catch (err) {
|
|
56
|
+
return null;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return resolveFileName();
|
|
60
|
+
};
|
|
61
|
+
module.exports = (fromDir, moduleId) => resolveFrom(fromDir, moduleId);
|
|
62
|
+
module.exports.silent = (fromDir, moduleId) => resolveFrom(fromDir, moduleId, true);
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
// node_modules/callsites/index.js
|
|
67
|
+
var require_callsites = __commonJS({
|
|
68
|
+
"node_modules/callsites/index.js"(exports, module) {
|
|
69
|
+
"use strict";
|
|
70
|
+
init_esm_shims();
|
|
71
|
+
var callsites = () => {
|
|
72
|
+
const _prepareStackTrace = Error.prepareStackTrace;
|
|
73
|
+
Error.prepareStackTrace = (_, stack2) => stack2;
|
|
74
|
+
const stack = new Error().stack.slice(1);
|
|
75
|
+
Error.prepareStackTrace = _prepareStackTrace;
|
|
76
|
+
return stack;
|
|
77
|
+
};
|
|
78
|
+
module.exports = callsites;
|
|
79
|
+
module.exports.default = callsites;
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
// node_modules/parent-module/index.js
|
|
84
|
+
var require_parent_module = __commonJS({
|
|
85
|
+
"node_modules/parent-module/index.js"(exports, module) {
|
|
86
|
+
"use strict";
|
|
87
|
+
init_esm_shims();
|
|
88
|
+
var callsites = require_callsites();
|
|
89
|
+
module.exports = (filepath) => {
|
|
90
|
+
const stacks = callsites();
|
|
91
|
+
if (!filepath) {
|
|
92
|
+
return stacks[2].getFileName();
|
|
93
|
+
}
|
|
94
|
+
let seenVal = false;
|
|
95
|
+
stacks.shift();
|
|
96
|
+
for (const stack of stacks) {
|
|
97
|
+
const parentFilepath = stack.getFileName();
|
|
98
|
+
if (typeof parentFilepath !== "string") {
|
|
99
|
+
continue;
|
|
100
|
+
}
|
|
101
|
+
if (parentFilepath === filepath) {
|
|
102
|
+
seenVal = true;
|
|
103
|
+
continue;
|
|
104
|
+
}
|
|
105
|
+
if (parentFilepath === "module.js") {
|
|
106
|
+
continue;
|
|
107
|
+
}
|
|
108
|
+
if (seenVal && parentFilepath !== filepath) {
|
|
109
|
+
return parentFilepath;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
// node_modules/import-fresh/index.js
|
|
117
|
+
var require_import_fresh = __commonJS({
|
|
118
|
+
"node_modules/import-fresh/index.js"(exports, module) {
|
|
119
|
+
"use strict";
|
|
120
|
+
init_esm_shims();
|
|
121
|
+
var path = __require("path");
|
|
122
|
+
var resolveFrom = require_resolve_from();
|
|
123
|
+
var parentModule = require_parent_module();
|
|
124
|
+
module.exports = (moduleId) => {
|
|
125
|
+
if (typeof moduleId !== "string") {
|
|
126
|
+
throw new TypeError("Expected a string");
|
|
127
|
+
}
|
|
128
|
+
const parentPath = parentModule(__filename);
|
|
129
|
+
const cwd = parentPath ? path.dirname(parentPath) : __dirname;
|
|
130
|
+
const filePath = resolveFrom(cwd, moduleId);
|
|
131
|
+
const oldModule = __require.cache[filePath];
|
|
132
|
+
if (oldModule && oldModule.parent) {
|
|
133
|
+
let i = oldModule.parent.children.length;
|
|
134
|
+
while (i--) {
|
|
135
|
+
if (oldModule.parent.children[i].id === filePath) {
|
|
136
|
+
oldModule.parent.children.splice(i, 1);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
delete __require.cache[filePath];
|
|
141
|
+
const parent = __require.cache[parentPath];
|
|
142
|
+
return parent === void 0 || parent.require === void 0 ? __require(filePath) : parent.require(filePath);
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
// node_modules/is-arrayish/index.js
|
|
148
|
+
var require_is_arrayish = __commonJS({
|
|
149
|
+
"node_modules/is-arrayish/index.js"(exports, module) {
|
|
150
|
+
"use strict";
|
|
151
|
+
init_esm_shims();
|
|
152
|
+
module.exports = function isArrayish(obj) {
|
|
153
|
+
if (!obj) {
|
|
154
|
+
return false;
|
|
155
|
+
}
|
|
156
|
+
return obj instanceof Array || Array.isArray(obj) || obj.length >= 0 && obj.splice instanceof Function;
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
|
|
161
|
+
// node_modules/error-ex/index.js
|
|
162
|
+
var require_error_ex = __commonJS({
|
|
163
|
+
"node_modules/error-ex/index.js"(exports, module) {
|
|
164
|
+
"use strict";
|
|
165
|
+
init_esm_shims();
|
|
166
|
+
var util = __require("util");
|
|
167
|
+
var isArrayish = require_is_arrayish();
|
|
168
|
+
var errorEx = function errorEx2(name, properties) {
|
|
169
|
+
if (!name || name.constructor !== String) {
|
|
170
|
+
properties = name || {};
|
|
171
|
+
name = Error.name;
|
|
172
|
+
}
|
|
173
|
+
var errorExError = function ErrorEXError(message) {
|
|
174
|
+
if (!this) {
|
|
175
|
+
return new ErrorEXError(message);
|
|
176
|
+
}
|
|
177
|
+
message = message instanceof Error ? message.message : message || this.message;
|
|
178
|
+
Error.call(this, message);
|
|
179
|
+
Error.captureStackTrace(this, errorExError);
|
|
180
|
+
this.name = name;
|
|
181
|
+
Object.defineProperty(this, "message", {
|
|
182
|
+
configurable: true,
|
|
183
|
+
enumerable: false,
|
|
184
|
+
get: function() {
|
|
185
|
+
var newMessage = message.split(/\r?\n/g);
|
|
186
|
+
for (var key in properties) {
|
|
187
|
+
if (!properties.hasOwnProperty(key)) {
|
|
188
|
+
continue;
|
|
189
|
+
}
|
|
190
|
+
var modifier = properties[key];
|
|
191
|
+
if ("message" in modifier) {
|
|
192
|
+
newMessage = modifier.message(this[key], newMessage) || newMessage;
|
|
193
|
+
if (!isArrayish(newMessage)) {
|
|
194
|
+
newMessage = [newMessage];
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
return newMessage.join("\n");
|
|
199
|
+
},
|
|
200
|
+
set: function(v) {
|
|
201
|
+
message = v;
|
|
202
|
+
}
|
|
203
|
+
});
|
|
204
|
+
var overwrittenStack = null;
|
|
205
|
+
var stackDescriptor = Object.getOwnPropertyDescriptor(this, "stack");
|
|
206
|
+
var stackGetter = stackDescriptor.get;
|
|
207
|
+
var stackValue = stackDescriptor.value;
|
|
208
|
+
delete stackDescriptor.value;
|
|
209
|
+
delete stackDescriptor.writable;
|
|
210
|
+
stackDescriptor.set = function(newstack) {
|
|
211
|
+
overwrittenStack = newstack;
|
|
212
|
+
};
|
|
213
|
+
stackDescriptor.get = function() {
|
|
214
|
+
var stack = (overwrittenStack || (stackGetter ? stackGetter.call(this) : stackValue)).split(/\r?\n+/g);
|
|
215
|
+
if (!overwrittenStack) {
|
|
216
|
+
stack[0] = this.name + ": " + this.message;
|
|
217
|
+
}
|
|
218
|
+
var lineCount = 1;
|
|
219
|
+
for (var key in properties) {
|
|
220
|
+
if (!properties.hasOwnProperty(key)) {
|
|
221
|
+
continue;
|
|
222
|
+
}
|
|
223
|
+
var modifier = properties[key];
|
|
224
|
+
if ("line" in modifier) {
|
|
225
|
+
var line = modifier.line(this[key]);
|
|
226
|
+
if (line) {
|
|
227
|
+
stack.splice(lineCount++, 0, " " + line);
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
if ("stack" in modifier) {
|
|
231
|
+
modifier.stack(this[key], stack);
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
return stack.join("\n");
|
|
235
|
+
};
|
|
236
|
+
Object.defineProperty(this, "stack", stackDescriptor);
|
|
237
|
+
};
|
|
238
|
+
if (Object.setPrototypeOf) {
|
|
239
|
+
Object.setPrototypeOf(errorExError.prototype, Error.prototype);
|
|
240
|
+
Object.setPrototypeOf(errorExError, Error);
|
|
241
|
+
} else {
|
|
242
|
+
util.inherits(errorExError, Error);
|
|
243
|
+
}
|
|
244
|
+
return errorExError;
|
|
245
|
+
};
|
|
246
|
+
errorEx.append = function(str, def) {
|
|
247
|
+
return {
|
|
248
|
+
message: function(v, message) {
|
|
249
|
+
v = v || def;
|
|
250
|
+
if (v) {
|
|
251
|
+
message[0] += " " + str.replace("%s", v.toString());
|
|
252
|
+
}
|
|
253
|
+
return message;
|
|
254
|
+
}
|
|
255
|
+
};
|
|
256
|
+
};
|
|
257
|
+
errorEx.line = function(str, def) {
|
|
258
|
+
return {
|
|
259
|
+
line: function(v) {
|
|
260
|
+
v = v || def;
|
|
261
|
+
if (v) {
|
|
262
|
+
return str.replace("%s", v.toString());
|
|
263
|
+
}
|
|
264
|
+
return null;
|
|
265
|
+
}
|
|
266
|
+
};
|
|
267
|
+
};
|
|
268
|
+
module.exports = errorEx;
|
|
269
|
+
}
|
|
270
|
+
});
|
|
271
|
+
|
|
272
|
+
// node_modules/json-parse-even-better-errors/index.js
|
|
273
|
+
var require_json_parse_even_better_errors = __commonJS({
|
|
274
|
+
"node_modules/json-parse-even-better-errors/index.js"(exports, module) {
|
|
275
|
+
"use strict";
|
|
276
|
+
init_esm_shims();
|
|
277
|
+
var hexify = (char) => {
|
|
278
|
+
const h = char.charCodeAt(0).toString(16).toUpperCase();
|
|
279
|
+
return "0x" + (h.length % 2 ? "0" : "") + h;
|
|
280
|
+
};
|
|
281
|
+
var parseError = (e, txt, context) => {
|
|
282
|
+
if (!txt) {
|
|
283
|
+
return {
|
|
284
|
+
message: e.message + " while parsing empty string",
|
|
285
|
+
position: 0
|
|
286
|
+
};
|
|
287
|
+
}
|
|
288
|
+
const badToken = e.message.match(/^Unexpected token (.) .*position\s+(\d+)/i);
|
|
289
|
+
const errIdx = badToken ? +badToken[2] : e.message.match(/^Unexpected end of JSON.*/i) ? txt.length - 1 : null;
|
|
290
|
+
const msg = badToken ? e.message.replace(/^Unexpected token ./, `Unexpected token ${JSON.stringify(badToken[1])} (${hexify(badToken[1])})`) : e.message;
|
|
291
|
+
if (errIdx !== null && errIdx !== void 0) {
|
|
292
|
+
const start = errIdx <= context ? 0 : errIdx - context;
|
|
293
|
+
const end = errIdx + context >= txt.length ? txt.length : errIdx + context;
|
|
294
|
+
const slice = (start === 0 ? "" : "...") + txt.slice(start, end) + (end === txt.length ? "" : "...");
|
|
295
|
+
const near = txt === slice ? "" : "near ";
|
|
296
|
+
return {
|
|
297
|
+
message: msg + ` while parsing ${near}${JSON.stringify(slice)}`,
|
|
298
|
+
position: errIdx
|
|
299
|
+
};
|
|
300
|
+
} else {
|
|
301
|
+
return {
|
|
302
|
+
message: msg + ` while parsing '${txt.slice(0, context * 2)}'`,
|
|
303
|
+
position: 0
|
|
304
|
+
};
|
|
305
|
+
}
|
|
306
|
+
};
|
|
307
|
+
var JSONParseError = class extends SyntaxError {
|
|
308
|
+
constructor(er, txt, context, caller) {
|
|
309
|
+
context = context || 20;
|
|
310
|
+
const metadata = parseError(er, txt, context);
|
|
311
|
+
super(metadata.message);
|
|
312
|
+
Object.assign(this, metadata);
|
|
313
|
+
this.code = "EJSONPARSE";
|
|
314
|
+
this.systemError = er;
|
|
315
|
+
Error.captureStackTrace(this, caller || this.constructor);
|
|
316
|
+
}
|
|
317
|
+
get name() {
|
|
318
|
+
return this.constructor.name;
|
|
319
|
+
}
|
|
320
|
+
set name(n) {
|
|
321
|
+
}
|
|
322
|
+
get [Symbol.toStringTag]() {
|
|
323
|
+
return this.constructor.name;
|
|
324
|
+
}
|
|
325
|
+
};
|
|
326
|
+
var kIndent = Symbol.for("indent");
|
|
327
|
+
var kNewline = Symbol.for("newline");
|
|
328
|
+
var formatRE = /^\s*[{\[]((?:\r?\n)+)([\s\t]*)/;
|
|
329
|
+
var emptyRE = /^(?:\{\}|\[\])((?:\r?\n)+)?$/;
|
|
330
|
+
var parseJson = (txt, reviver, context) => {
|
|
331
|
+
const parseText = stripBOM(txt);
|
|
332
|
+
context = context || 20;
|
|
333
|
+
try {
|
|
334
|
+
const [, newline = "\n", indent = " "] = parseText.match(emptyRE) || parseText.match(formatRE) || [, "", ""];
|
|
335
|
+
const result = JSON.parse(parseText, reviver);
|
|
336
|
+
if (result && typeof result === "object") {
|
|
337
|
+
result[kNewline] = newline;
|
|
338
|
+
result[kIndent] = indent;
|
|
339
|
+
}
|
|
340
|
+
return result;
|
|
341
|
+
} catch (e) {
|
|
342
|
+
if (typeof txt !== "string" && !Buffer.isBuffer(txt)) {
|
|
343
|
+
const isEmptyArray = Array.isArray(txt) && txt.length === 0;
|
|
344
|
+
throw Object.assign(new TypeError(
|
|
345
|
+
`Cannot parse ${isEmptyArray ? "an empty array" : String(txt)}`
|
|
346
|
+
), {
|
|
347
|
+
code: "EJSONPARSE",
|
|
348
|
+
systemError: e
|
|
349
|
+
});
|
|
350
|
+
}
|
|
351
|
+
throw new JSONParseError(e, parseText, context, parseJson);
|
|
352
|
+
}
|
|
353
|
+
};
|
|
354
|
+
var stripBOM = (txt) => String(txt).replace(/^\uFEFF/, "");
|
|
355
|
+
module.exports = parseJson;
|
|
356
|
+
parseJson.JSONParseError = JSONParseError;
|
|
357
|
+
parseJson.noExceptions = (txt, reviver) => {
|
|
358
|
+
try {
|
|
359
|
+
return JSON.parse(stripBOM(txt), reviver);
|
|
360
|
+
} catch (e) {
|
|
361
|
+
}
|
|
362
|
+
};
|
|
363
|
+
}
|
|
364
|
+
});
|
|
365
|
+
|
|
366
|
+
// node_modules/lines-and-columns/build/index.js
|
|
367
|
+
var require_build = __commonJS({
|
|
368
|
+
"node_modules/lines-and-columns/build/index.js"(exports) {
|
|
369
|
+
"use strict";
|
|
370
|
+
init_esm_shims();
|
|
371
|
+
exports.__esModule = true;
|
|
372
|
+
exports.LinesAndColumns = void 0;
|
|
373
|
+
var LF = "\n";
|
|
374
|
+
var CR = "\r";
|
|
375
|
+
var LinesAndColumns = (
|
|
376
|
+
/** @class */
|
|
377
|
+
(function() {
|
|
378
|
+
function LinesAndColumns2(string) {
|
|
379
|
+
this.string = string;
|
|
380
|
+
var offsets = [0];
|
|
381
|
+
for (var offset = 0; offset < string.length; ) {
|
|
382
|
+
switch (string[offset]) {
|
|
383
|
+
case LF:
|
|
384
|
+
offset += LF.length;
|
|
385
|
+
offsets.push(offset);
|
|
386
|
+
break;
|
|
387
|
+
case CR:
|
|
388
|
+
offset += CR.length;
|
|
389
|
+
if (string[offset] === LF) {
|
|
390
|
+
offset += LF.length;
|
|
391
|
+
}
|
|
392
|
+
offsets.push(offset);
|
|
393
|
+
break;
|
|
394
|
+
default:
|
|
395
|
+
offset++;
|
|
396
|
+
break;
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
this.offsets = offsets;
|
|
400
|
+
}
|
|
401
|
+
LinesAndColumns2.prototype.locationForIndex = function(index) {
|
|
402
|
+
if (index < 0 || index > this.string.length) {
|
|
403
|
+
return null;
|
|
404
|
+
}
|
|
405
|
+
var line = 0;
|
|
406
|
+
var offsets = this.offsets;
|
|
407
|
+
while (offsets[line + 1] <= index) {
|
|
408
|
+
line++;
|
|
409
|
+
}
|
|
410
|
+
var column = index - offsets[line];
|
|
411
|
+
return { line, column };
|
|
412
|
+
};
|
|
413
|
+
LinesAndColumns2.prototype.indexForLocation = function(location) {
|
|
414
|
+
var line = location.line, column = location.column;
|
|
415
|
+
if (line < 0 || line >= this.offsets.length) {
|
|
416
|
+
return null;
|
|
417
|
+
}
|
|
418
|
+
if (column < 0 || column > this.lengthOfLine(line)) {
|
|
419
|
+
return null;
|
|
420
|
+
}
|
|
421
|
+
return this.offsets[line] + column;
|
|
422
|
+
};
|
|
423
|
+
LinesAndColumns2.prototype.lengthOfLine = function(line) {
|
|
424
|
+
var offset = this.offsets[line];
|
|
425
|
+
var nextOffset = line === this.offsets.length - 1 ? this.string.length : this.offsets[line + 1];
|
|
426
|
+
return nextOffset - offset;
|
|
427
|
+
};
|
|
428
|
+
return LinesAndColumns2;
|
|
429
|
+
})()
|
|
430
|
+
);
|
|
431
|
+
exports.LinesAndColumns = LinesAndColumns;
|
|
432
|
+
exports["default"] = LinesAndColumns;
|
|
433
|
+
}
|
|
434
|
+
});
|
|
435
|
+
|
|
436
|
+
// node_modules/picocolors/picocolors.js
|
|
437
|
+
var require_picocolors = __commonJS({
|
|
438
|
+
"node_modules/picocolors/picocolors.js"(exports, module) {
|
|
439
|
+
"use strict";
|
|
440
|
+
init_esm_shims();
|
|
441
|
+
var p = process || {};
|
|
442
|
+
var argv = p.argv || [];
|
|
443
|
+
var env = p.env || {};
|
|
444
|
+
var isColorSupported = !(!!env.NO_COLOR || argv.includes("--no-color")) && (!!env.FORCE_COLOR || argv.includes("--color") || p.platform === "win32" || (p.stdout || {}).isTTY && env.TERM !== "dumb" || !!env.CI);
|
|
445
|
+
var formatter = (open, close, replace = open) => (input) => {
|
|
446
|
+
let string = "" + input, index = string.indexOf(close, open.length);
|
|
447
|
+
return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
|
|
448
|
+
};
|
|
449
|
+
var replaceClose = (string, close, replace, index) => {
|
|
450
|
+
let result = "", cursor = 0;
|
|
451
|
+
do {
|
|
452
|
+
result += string.substring(cursor, index) + replace;
|
|
453
|
+
cursor = index + close.length;
|
|
454
|
+
index = string.indexOf(close, cursor);
|
|
455
|
+
} while (~index);
|
|
456
|
+
return result + string.substring(cursor);
|
|
457
|
+
};
|
|
458
|
+
var createColors = (enabled = isColorSupported) => {
|
|
459
|
+
let f = enabled ? formatter : () => String;
|
|
460
|
+
return {
|
|
461
|
+
isColorSupported: enabled,
|
|
462
|
+
reset: f("\x1B[0m", "\x1B[0m"),
|
|
463
|
+
bold: f("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"),
|
|
464
|
+
dim: f("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"),
|
|
465
|
+
italic: f("\x1B[3m", "\x1B[23m"),
|
|
466
|
+
underline: f("\x1B[4m", "\x1B[24m"),
|
|
467
|
+
inverse: f("\x1B[7m", "\x1B[27m"),
|
|
468
|
+
hidden: f("\x1B[8m", "\x1B[28m"),
|
|
469
|
+
strikethrough: f("\x1B[9m", "\x1B[29m"),
|
|
470
|
+
black: f("\x1B[30m", "\x1B[39m"),
|
|
471
|
+
red: f("\x1B[31m", "\x1B[39m"),
|
|
472
|
+
green: f("\x1B[32m", "\x1B[39m"),
|
|
473
|
+
yellow: f("\x1B[33m", "\x1B[39m"),
|
|
474
|
+
blue: f("\x1B[34m", "\x1B[39m"),
|
|
475
|
+
magenta: f("\x1B[35m", "\x1B[39m"),
|
|
476
|
+
cyan: f("\x1B[36m", "\x1B[39m"),
|
|
477
|
+
white: f("\x1B[37m", "\x1B[39m"),
|
|
478
|
+
gray: f("\x1B[90m", "\x1B[39m"),
|
|
479
|
+
bgBlack: f("\x1B[40m", "\x1B[49m"),
|
|
480
|
+
bgRed: f("\x1B[41m", "\x1B[49m"),
|
|
481
|
+
bgGreen: f("\x1B[42m", "\x1B[49m"),
|
|
482
|
+
bgYellow: f("\x1B[43m", "\x1B[49m"),
|
|
483
|
+
bgBlue: f("\x1B[44m", "\x1B[49m"),
|
|
484
|
+
bgMagenta: f("\x1B[45m", "\x1B[49m"),
|
|
485
|
+
bgCyan: f("\x1B[46m", "\x1B[49m"),
|
|
486
|
+
bgWhite: f("\x1B[47m", "\x1B[49m"),
|
|
487
|
+
blackBright: f("\x1B[90m", "\x1B[39m"),
|
|
488
|
+
redBright: f("\x1B[91m", "\x1B[39m"),
|
|
489
|
+
greenBright: f("\x1B[92m", "\x1B[39m"),
|
|
490
|
+
yellowBright: f("\x1B[93m", "\x1B[39m"),
|
|
491
|
+
blueBright: f("\x1B[94m", "\x1B[39m"),
|
|
492
|
+
magentaBright: f("\x1B[95m", "\x1B[39m"),
|
|
493
|
+
cyanBright: f("\x1B[96m", "\x1B[39m"),
|
|
494
|
+
whiteBright: f("\x1B[97m", "\x1B[39m"),
|
|
495
|
+
bgBlackBright: f("\x1B[100m", "\x1B[49m"),
|
|
496
|
+
bgRedBright: f("\x1B[101m", "\x1B[49m"),
|
|
497
|
+
bgGreenBright: f("\x1B[102m", "\x1B[49m"),
|
|
498
|
+
bgYellowBright: f("\x1B[103m", "\x1B[49m"),
|
|
499
|
+
bgBlueBright: f("\x1B[104m", "\x1B[49m"),
|
|
500
|
+
bgMagentaBright: f("\x1B[105m", "\x1B[49m"),
|
|
501
|
+
bgCyanBright: f("\x1B[106m", "\x1B[49m"),
|
|
502
|
+
bgWhiteBright: f("\x1B[107m", "\x1B[49m")
|
|
503
|
+
};
|
|
504
|
+
};
|
|
505
|
+
module.exports = createColors();
|
|
506
|
+
module.exports.createColors = createColors;
|
|
507
|
+
}
|
|
508
|
+
});
|
|
509
|
+
|
|
510
|
+
// node_modules/js-tokens/index.js
|
|
511
|
+
var require_js_tokens = __commonJS({
|
|
512
|
+
"node_modules/js-tokens/index.js"(exports) {
|
|
513
|
+
"use strict";
|
|
514
|
+
init_esm_shims();
|
|
515
|
+
Object.defineProperty(exports, "__esModule", {
|
|
516
|
+
value: true
|
|
517
|
+
});
|
|
518
|
+
exports.default = /((['"])(?:(?!\2|\\).|\\(?:\r\n|[\s\S]))*(\2)?|`(?:[^`\\$]|\\[\s\S]|\$(?!\{)|\$\{(?:[^{}]|\{[^}]*\}?)*\}?)*(`)?)|(\/\/.*)|(\/\*(?:[^*]|\*(?!\/))*(\*\/)?)|(\/(?!\*)(?:\[(?:(?![\]\\]).|\\.)*\]|(?![\/\]\\]).|\\.)+\/(?:(?!\s*(?:\b|[\u0080-\uFFFF$\\'"~({]|[+\-!](?!=)|\.?\d))|[gmiyus]{1,6}\b(?![\u0080-\uFFFF$\\]|\s*(?:[+\-*%&|^<>!=?({]|\/(?![\/*])))))|(0[xX][\da-fA-F]+|0[oO][0-7]+|0[bB][01]+|(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?)|((?!\d)(?:(?!\s)[$\w\u0080-\uFFFF]|\\u[\da-fA-F]{4}|\\u\{[\da-fA-F]+\})+)|(--|\+\+|&&|\|\||=>|\.{3}|(?:[+\-\/%&|^]|\*{1,2}|<{1,2}|>{1,3}|!=?|={1,2})=?|[?~.,:;[\](){}])|(\s+)|(^$|[\s\S])/g;
|
|
519
|
+
exports.matchToToken = function(match) {
|
|
520
|
+
var token = { type: "invalid", value: match[0], closed: void 0 };
|
|
521
|
+
if (match[1]) token.type = "string", token.closed = !!(match[3] || match[4]);
|
|
522
|
+
else if (match[5]) token.type = "comment";
|
|
523
|
+
else if (match[6]) token.type = "comment", token.closed = !!match[7];
|
|
524
|
+
else if (match[8]) token.type = "regex";
|
|
525
|
+
else if (match[9]) token.type = "number";
|
|
526
|
+
else if (match[10]) token.type = "name";
|
|
527
|
+
else if (match[11]) token.type = "punctuator";
|
|
528
|
+
else if (match[12]) token.type = "whitespace";
|
|
529
|
+
return token;
|
|
530
|
+
};
|
|
531
|
+
}
|
|
532
|
+
});
|
|
533
|
+
|
|
534
|
+
// node_modules/@babel/helper-validator-identifier/lib/identifier.js
|
|
535
|
+
var require_identifier = __commonJS({
|
|
536
|
+
"node_modules/@babel/helper-validator-identifier/lib/identifier.js"(exports) {
|
|
537
|
+
"use strict";
|
|
538
|
+
init_esm_shims();
|
|
539
|
+
Object.defineProperty(exports, "__esModule", {
|
|
540
|
+
value: true
|
|
541
|
+
});
|
|
542
|
+
exports.isIdentifierChar = isIdentifierChar;
|
|
543
|
+
exports.isIdentifierName = isIdentifierName;
|
|
544
|
+
exports.isIdentifierStart = isIdentifierStart;
|
|
545
|
+
var nonASCIIidentifierStartChars = "\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088F\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5C\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDC-\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7DC\uA7F1-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC";
|
|
546
|
+
var nonASCIIidentifierChars = "\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1ADD\u1AE0-\u1AEB\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u200C\u200D\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\u30FB\uA620-\uA629\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F1\uA8FF-\uA909\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9D0-\uA9D9\uA9E5\uA9F0-\uA9F9\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA50-\uAA59\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uABF0-\uABF9\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFF10-\uFF19\uFF3F\uFF65";
|
|
547
|
+
var nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]");
|
|
548
|
+
var nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]");
|
|
549
|
+
nonASCIIidentifierStartChars = nonASCIIidentifierChars = null;
|
|
550
|
+
var astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 13, 10, 2, 14, 2, 6, 2, 1, 2, 10, 2, 14, 2, 6, 2, 1, 4, 51, 13, 310, 10, 21, 11, 7, 25, 5, 2, 41, 2, 8, 70, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 7, 25, 39, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 39, 27, 10, 22, 251, 41, 7, 1, 17, 5, 57, 28, 11, 0, 9, 21, 43, 17, 47, 20, 28, 22, 13, 52, 58, 1, 3, 0, 14, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 20, 1, 64, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 31, 9, 2, 0, 3, 0, 2, 37, 2, 0, 26, 0, 2, 0, 45, 52, 19, 3, 21, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 38, 6, 186, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 19, 72, 200, 32, 32, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 24, 43, 261, 18, 16, 0, 2, 12, 2, 33, 125, 0, 80, 921, 103, 110, 18, 195, 2637, 96, 16, 1071, 18, 5, 26, 3994, 6, 582, 6842, 29, 1763, 568, 8, 30, 18, 78, 18, 29, 19, 47, 17, 3, 32, 20, 6, 18, 433, 44, 212, 63, 33, 24, 3, 24, 45, 74, 6, 0, 67, 12, 65, 1, 2, 0, 15, 4, 10, 7381, 42, 31, 98, 114, 8702, 3, 2, 6, 2, 1, 2, 290, 16, 0, 30, 2, 3, 0, 15, 3, 9, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 1845, 30, 7, 5, 262, 61, 147, 44, 11, 6, 17, 0, 322, 29, 19, 43, 485, 27, 229, 29, 3, 0, 208, 30, 2, 2, 2, 1, 2, 6, 3, 4, 10, 1, 225, 6, 2, 3, 2, 1, 2, 14, 2, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42719, 33, 4381, 3, 5773, 3, 7472, 16, 621, 2467, 541, 1507, 4938, 6, 8489];
|
|
551
|
+
var astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 7, 9, 32, 4, 318, 1, 78, 5, 71, 10, 50, 3, 123, 2, 54, 14, 32, 10, 3, 1, 11, 3, 46, 10, 8, 0, 46, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 3, 0, 158, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 68, 8, 2, 0, 3, 0, 2, 3, 2, 4, 2, 0, 15, 1, 83, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 7, 19, 58, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 199, 7, 137, 9, 54, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 55, 9, 266, 3, 10, 1, 2, 0, 49, 6, 4, 4, 14, 10, 5350, 0, 7, 14, 11465, 27, 2343, 9, 87, 9, 39, 4, 60, 6, 26, 9, 535, 9, 470, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 4178, 9, 519, 45, 3, 22, 543, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 101, 0, 161, 6, 10, 9, 357, 0, 62, 13, 499, 13, 245, 1, 2, 9, 233, 0, 3, 0, 8, 1, 6, 0, 475, 6, 110, 6, 6, 9, 4759, 9, 787719, 239];
|
|
552
|
+
function isInAstralSet(code, set) {
|
|
553
|
+
let pos = 65536;
|
|
554
|
+
for (let i = 0, length = set.length; i < length; i += 2) {
|
|
555
|
+
pos += set[i];
|
|
556
|
+
if (pos > code) return false;
|
|
557
|
+
pos += set[i + 1];
|
|
558
|
+
if (pos >= code) return true;
|
|
559
|
+
}
|
|
560
|
+
return false;
|
|
561
|
+
}
|
|
562
|
+
function isIdentifierStart(code) {
|
|
563
|
+
if (code < 65) return code === 36;
|
|
564
|
+
if (code <= 90) return true;
|
|
565
|
+
if (code < 97) return code === 95;
|
|
566
|
+
if (code <= 122) return true;
|
|
567
|
+
if (code <= 65535) {
|
|
568
|
+
return code >= 170 && nonASCIIidentifierStart.test(String.fromCharCode(code));
|
|
569
|
+
}
|
|
570
|
+
return isInAstralSet(code, astralIdentifierStartCodes);
|
|
571
|
+
}
|
|
572
|
+
function isIdentifierChar(code) {
|
|
573
|
+
if (code < 48) return code === 36;
|
|
574
|
+
if (code < 58) return true;
|
|
575
|
+
if (code < 65) return false;
|
|
576
|
+
if (code <= 90) return true;
|
|
577
|
+
if (code < 97) return code === 95;
|
|
578
|
+
if (code <= 122) return true;
|
|
579
|
+
if (code <= 65535) {
|
|
580
|
+
return code >= 170 && nonASCIIidentifier.test(String.fromCharCode(code));
|
|
581
|
+
}
|
|
582
|
+
return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes);
|
|
583
|
+
}
|
|
584
|
+
function isIdentifierName(name) {
|
|
585
|
+
let isFirst = true;
|
|
586
|
+
for (let i = 0; i < name.length; i++) {
|
|
587
|
+
let cp = name.charCodeAt(i);
|
|
588
|
+
if ((cp & 64512) === 55296 && i + 1 < name.length) {
|
|
589
|
+
const trail = name.charCodeAt(++i);
|
|
590
|
+
if ((trail & 64512) === 56320) {
|
|
591
|
+
cp = 65536 + ((cp & 1023) << 10) + (trail & 1023);
|
|
592
|
+
}
|
|
593
|
+
}
|
|
594
|
+
if (isFirst) {
|
|
595
|
+
isFirst = false;
|
|
596
|
+
if (!isIdentifierStart(cp)) {
|
|
597
|
+
return false;
|
|
598
|
+
}
|
|
599
|
+
} else if (!isIdentifierChar(cp)) {
|
|
600
|
+
return false;
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
return !isFirst;
|
|
604
|
+
}
|
|
605
|
+
}
|
|
606
|
+
});
|
|
607
|
+
|
|
608
|
+
// node_modules/@babel/helper-validator-identifier/lib/keyword.js
|
|
609
|
+
var require_keyword = __commonJS({
|
|
610
|
+
"node_modules/@babel/helper-validator-identifier/lib/keyword.js"(exports) {
|
|
611
|
+
"use strict";
|
|
612
|
+
init_esm_shims();
|
|
613
|
+
Object.defineProperty(exports, "__esModule", {
|
|
614
|
+
value: true
|
|
615
|
+
});
|
|
616
|
+
exports.isKeyword = isKeyword;
|
|
617
|
+
exports.isReservedWord = isReservedWord;
|
|
618
|
+
exports.isStrictBindOnlyReservedWord = isStrictBindOnlyReservedWord;
|
|
619
|
+
exports.isStrictBindReservedWord = isStrictBindReservedWord;
|
|
620
|
+
exports.isStrictReservedWord = isStrictReservedWord;
|
|
621
|
+
var reservedWords = {
|
|
622
|
+
keyword: ["break", "case", "catch", "continue", "debugger", "default", "do", "else", "finally", "for", "function", "if", "return", "switch", "throw", "try", "var", "const", "while", "with", "new", "this", "super", "class", "extends", "export", "import", "null", "true", "false", "in", "instanceof", "typeof", "void", "delete"],
|
|
623
|
+
strict: ["implements", "interface", "let", "package", "private", "protected", "public", "static", "yield"],
|
|
624
|
+
strictBind: ["eval", "arguments"]
|
|
625
|
+
};
|
|
626
|
+
var keywords = new Set(reservedWords.keyword);
|
|
627
|
+
var reservedWordsStrictSet = new Set(reservedWords.strict);
|
|
628
|
+
var reservedWordsStrictBindSet = new Set(reservedWords.strictBind);
|
|
629
|
+
function isReservedWord(word, inModule) {
|
|
630
|
+
return inModule && word === "await" || word === "enum";
|
|
631
|
+
}
|
|
632
|
+
function isStrictReservedWord(word, inModule) {
|
|
633
|
+
return isReservedWord(word, inModule) || reservedWordsStrictSet.has(word);
|
|
634
|
+
}
|
|
635
|
+
function isStrictBindOnlyReservedWord(word) {
|
|
636
|
+
return reservedWordsStrictBindSet.has(word);
|
|
637
|
+
}
|
|
638
|
+
function isStrictBindReservedWord(word, inModule) {
|
|
639
|
+
return isStrictReservedWord(word, inModule) || isStrictBindOnlyReservedWord(word);
|
|
640
|
+
}
|
|
641
|
+
function isKeyword(word) {
|
|
642
|
+
return keywords.has(word);
|
|
643
|
+
}
|
|
644
|
+
}
|
|
645
|
+
});
|
|
646
|
+
|
|
647
|
+
// node_modules/@babel/helper-validator-identifier/lib/index.js
|
|
648
|
+
var require_lib = __commonJS({
|
|
649
|
+
"node_modules/@babel/helper-validator-identifier/lib/index.js"(exports) {
|
|
650
|
+
"use strict";
|
|
651
|
+
init_esm_shims();
|
|
652
|
+
Object.defineProperty(exports, "__esModule", {
|
|
653
|
+
value: true
|
|
654
|
+
});
|
|
655
|
+
Object.defineProperty(exports, "isIdentifierChar", {
|
|
656
|
+
enumerable: true,
|
|
657
|
+
get: function() {
|
|
658
|
+
return _identifier.isIdentifierChar;
|
|
659
|
+
}
|
|
660
|
+
});
|
|
661
|
+
Object.defineProperty(exports, "isIdentifierName", {
|
|
662
|
+
enumerable: true,
|
|
663
|
+
get: function() {
|
|
664
|
+
return _identifier.isIdentifierName;
|
|
665
|
+
}
|
|
666
|
+
});
|
|
667
|
+
Object.defineProperty(exports, "isIdentifierStart", {
|
|
668
|
+
enumerable: true,
|
|
669
|
+
get: function() {
|
|
670
|
+
return _identifier.isIdentifierStart;
|
|
671
|
+
}
|
|
672
|
+
});
|
|
673
|
+
Object.defineProperty(exports, "isKeyword", {
|
|
674
|
+
enumerable: true,
|
|
675
|
+
get: function() {
|
|
676
|
+
return _keyword.isKeyword;
|
|
677
|
+
}
|
|
678
|
+
});
|
|
679
|
+
Object.defineProperty(exports, "isReservedWord", {
|
|
680
|
+
enumerable: true,
|
|
681
|
+
get: function() {
|
|
682
|
+
return _keyword.isReservedWord;
|
|
683
|
+
}
|
|
684
|
+
});
|
|
685
|
+
Object.defineProperty(exports, "isStrictBindOnlyReservedWord", {
|
|
686
|
+
enumerable: true,
|
|
687
|
+
get: function() {
|
|
688
|
+
return _keyword.isStrictBindOnlyReservedWord;
|
|
689
|
+
}
|
|
690
|
+
});
|
|
691
|
+
Object.defineProperty(exports, "isStrictBindReservedWord", {
|
|
692
|
+
enumerable: true,
|
|
693
|
+
get: function() {
|
|
694
|
+
return _keyword.isStrictBindReservedWord;
|
|
695
|
+
}
|
|
696
|
+
});
|
|
697
|
+
Object.defineProperty(exports, "isStrictReservedWord", {
|
|
698
|
+
enumerable: true,
|
|
699
|
+
get: function() {
|
|
700
|
+
return _keyword.isStrictReservedWord;
|
|
701
|
+
}
|
|
702
|
+
});
|
|
703
|
+
var _identifier = require_identifier();
|
|
704
|
+
var _keyword = require_keyword();
|
|
705
|
+
}
|
|
706
|
+
});
|
|
707
|
+
|
|
708
|
+
// node_modules/@babel/code-frame/lib/index.js
|
|
709
|
+
var require_lib2 = __commonJS({
|
|
710
|
+
"node_modules/@babel/code-frame/lib/index.js"(exports) {
|
|
711
|
+
"use strict";
|
|
712
|
+
init_esm_shims();
|
|
713
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
714
|
+
var picocolors = require_picocolors();
|
|
715
|
+
var jsTokens = require_js_tokens();
|
|
716
|
+
var helperValidatorIdentifier = require_lib();
|
|
717
|
+
function isColorSupported() {
|
|
718
|
+
return typeof process === "object" && (process.env.FORCE_COLOR === "0" || process.env.FORCE_COLOR === "false") ? false : picocolors.isColorSupported;
|
|
719
|
+
}
|
|
720
|
+
var compose = (f, g) => (v) => f(g(v));
|
|
721
|
+
function buildDefs(colors) {
|
|
722
|
+
return {
|
|
723
|
+
keyword: colors.cyan,
|
|
724
|
+
capitalized: colors.yellow,
|
|
725
|
+
jsxIdentifier: colors.yellow,
|
|
726
|
+
punctuator: colors.yellow,
|
|
727
|
+
number: colors.magenta,
|
|
728
|
+
string: colors.green,
|
|
729
|
+
regex: colors.magenta,
|
|
730
|
+
comment: colors.gray,
|
|
731
|
+
invalid: compose(compose(colors.white, colors.bgRed), colors.bold),
|
|
732
|
+
gutter: colors.gray,
|
|
733
|
+
marker: compose(colors.red, colors.bold),
|
|
734
|
+
message: compose(colors.red, colors.bold),
|
|
735
|
+
reset: colors.reset
|
|
736
|
+
};
|
|
737
|
+
}
|
|
738
|
+
var defsOn = buildDefs(picocolors.createColors(true));
|
|
739
|
+
var defsOff = buildDefs(picocolors.createColors(false));
|
|
740
|
+
function getDefs(enabled) {
|
|
741
|
+
return enabled ? defsOn : defsOff;
|
|
742
|
+
}
|
|
743
|
+
var sometimesKeywords = /* @__PURE__ */ new Set(["as", "async", "from", "get", "of", "set"]);
|
|
744
|
+
var NEWLINE$1 = /\r\n|[\n\r\u2028\u2029]/;
|
|
745
|
+
var BRACKET = /^[()[\]{}]$/;
|
|
746
|
+
var tokenize;
|
|
747
|
+
{
|
|
748
|
+
const JSX_TAG = /^[a-z][\w-]*$/i;
|
|
749
|
+
const getTokenType = function(token, offset, text) {
|
|
750
|
+
if (token.type === "name") {
|
|
751
|
+
if (helperValidatorIdentifier.isKeyword(token.value) || helperValidatorIdentifier.isStrictReservedWord(token.value, true) || sometimesKeywords.has(token.value)) {
|
|
752
|
+
return "keyword";
|
|
753
|
+
}
|
|
754
|
+
if (JSX_TAG.test(token.value) && (text[offset - 1] === "<" || text.slice(offset - 2, offset) === "</")) {
|
|
755
|
+
return "jsxIdentifier";
|
|
756
|
+
}
|
|
757
|
+
if (token.value[0] !== token.value[0].toLowerCase()) {
|
|
758
|
+
return "capitalized";
|
|
759
|
+
}
|
|
760
|
+
}
|
|
761
|
+
if (token.type === "punctuator" && BRACKET.test(token.value)) {
|
|
762
|
+
return "bracket";
|
|
763
|
+
}
|
|
764
|
+
if (token.type === "invalid" && (token.value === "@" || token.value === "#")) {
|
|
765
|
+
return "punctuator";
|
|
766
|
+
}
|
|
767
|
+
return token.type;
|
|
768
|
+
};
|
|
769
|
+
tokenize = function* (text) {
|
|
770
|
+
let match;
|
|
771
|
+
while (match = jsTokens.default.exec(text)) {
|
|
772
|
+
const token = jsTokens.matchToToken(match);
|
|
773
|
+
yield {
|
|
774
|
+
type: getTokenType(token, match.index, text),
|
|
775
|
+
value: token.value
|
|
776
|
+
};
|
|
777
|
+
}
|
|
778
|
+
};
|
|
779
|
+
}
|
|
780
|
+
function highlight(text) {
|
|
781
|
+
if (text === "") return "";
|
|
782
|
+
const defs = getDefs(true);
|
|
783
|
+
let highlighted = "";
|
|
784
|
+
for (const {
|
|
785
|
+
type,
|
|
786
|
+
value
|
|
787
|
+
} of tokenize(text)) {
|
|
788
|
+
if (type in defs) {
|
|
789
|
+
highlighted += value.split(NEWLINE$1).map((str) => defs[type](str)).join("\n");
|
|
790
|
+
} else {
|
|
791
|
+
highlighted += value;
|
|
792
|
+
}
|
|
793
|
+
}
|
|
794
|
+
return highlighted;
|
|
795
|
+
}
|
|
796
|
+
var deprecationWarningShown = false;
|
|
797
|
+
var NEWLINE = /\r\n|[\n\r\u2028\u2029]/;
|
|
798
|
+
function getMarkerLines(loc, source, opts) {
|
|
799
|
+
const startLoc = Object.assign({
|
|
800
|
+
column: 0,
|
|
801
|
+
line: -1
|
|
802
|
+
}, loc.start);
|
|
803
|
+
const endLoc = Object.assign({}, startLoc, loc.end);
|
|
804
|
+
const {
|
|
805
|
+
linesAbove = 2,
|
|
806
|
+
linesBelow = 3
|
|
807
|
+
} = opts || {};
|
|
808
|
+
const startLine = startLoc.line;
|
|
809
|
+
const startColumn = startLoc.column;
|
|
810
|
+
const endLine = endLoc.line;
|
|
811
|
+
const endColumn = endLoc.column;
|
|
812
|
+
let start = Math.max(startLine - (linesAbove + 1), 0);
|
|
813
|
+
let end = Math.min(source.length, endLine + linesBelow);
|
|
814
|
+
if (startLine === -1) {
|
|
815
|
+
start = 0;
|
|
816
|
+
}
|
|
817
|
+
if (endLine === -1) {
|
|
818
|
+
end = source.length;
|
|
819
|
+
}
|
|
820
|
+
const lineDiff = endLine - startLine;
|
|
821
|
+
const markerLines = {};
|
|
822
|
+
if (lineDiff) {
|
|
823
|
+
for (let i = 0; i <= lineDiff; i++) {
|
|
824
|
+
const lineNumber = i + startLine;
|
|
825
|
+
if (!startColumn) {
|
|
826
|
+
markerLines[lineNumber] = true;
|
|
827
|
+
} else if (i === 0) {
|
|
828
|
+
const sourceLength = source[lineNumber - 1].length;
|
|
829
|
+
markerLines[lineNumber] = [startColumn, sourceLength - startColumn + 1];
|
|
830
|
+
} else if (i === lineDiff) {
|
|
831
|
+
markerLines[lineNumber] = [0, endColumn];
|
|
832
|
+
} else {
|
|
833
|
+
const sourceLength = source[lineNumber - i].length;
|
|
834
|
+
markerLines[lineNumber] = [0, sourceLength];
|
|
835
|
+
}
|
|
836
|
+
}
|
|
837
|
+
} else {
|
|
838
|
+
if (startColumn === endColumn) {
|
|
839
|
+
if (startColumn) {
|
|
840
|
+
markerLines[startLine] = [startColumn, 0];
|
|
841
|
+
} else {
|
|
842
|
+
markerLines[startLine] = true;
|
|
843
|
+
}
|
|
844
|
+
} else {
|
|
845
|
+
markerLines[startLine] = [startColumn, endColumn - startColumn];
|
|
846
|
+
}
|
|
847
|
+
}
|
|
848
|
+
return {
|
|
849
|
+
start,
|
|
850
|
+
end,
|
|
851
|
+
markerLines
|
|
852
|
+
};
|
|
853
|
+
}
|
|
854
|
+
function codeFrameColumns(rawLines, loc, opts = {}) {
|
|
855
|
+
const shouldHighlight = opts.forceColor || isColorSupported() && opts.highlightCode;
|
|
856
|
+
const defs = getDefs(shouldHighlight);
|
|
857
|
+
const lines = rawLines.split(NEWLINE);
|
|
858
|
+
const {
|
|
859
|
+
start,
|
|
860
|
+
end,
|
|
861
|
+
markerLines
|
|
862
|
+
} = getMarkerLines(loc, lines, opts);
|
|
863
|
+
const hasColumns = loc.start && typeof loc.start.column === "number";
|
|
864
|
+
const numberMaxWidth = String(end).length;
|
|
865
|
+
const highlightedLines = shouldHighlight ? highlight(rawLines) : rawLines;
|
|
866
|
+
let frame = highlightedLines.split(NEWLINE, end).slice(start, end).map((line, index2) => {
|
|
867
|
+
const number = start + 1 + index2;
|
|
868
|
+
const paddedNumber = ` ${number}`.slice(-numberMaxWidth);
|
|
869
|
+
const gutter = ` ${paddedNumber} |`;
|
|
870
|
+
const hasMarker = markerLines[number];
|
|
871
|
+
const lastMarkerLine = !markerLines[number + 1];
|
|
872
|
+
if (hasMarker) {
|
|
873
|
+
let markerLine = "";
|
|
874
|
+
if (Array.isArray(hasMarker)) {
|
|
875
|
+
const markerSpacing = line.slice(0, Math.max(hasMarker[0] - 1, 0)).replace(/[^\t]/g, " ");
|
|
876
|
+
const numberOfMarkers = hasMarker[1] || 1;
|
|
877
|
+
markerLine = ["\n ", defs.gutter(gutter.replace(/\d/g, " ")), " ", markerSpacing, defs.marker("^").repeat(numberOfMarkers)].join("");
|
|
878
|
+
if (lastMarkerLine && opts.message) {
|
|
879
|
+
markerLine += " " + defs.message(opts.message);
|
|
880
|
+
}
|
|
881
|
+
}
|
|
882
|
+
return [defs.marker(">"), defs.gutter(gutter), line.length > 0 ? ` ${line}` : "", markerLine].join("");
|
|
883
|
+
} else {
|
|
884
|
+
return ` ${defs.gutter(gutter)}${line.length > 0 ? ` ${line}` : ""}`;
|
|
885
|
+
}
|
|
886
|
+
}).join("\n");
|
|
887
|
+
if (opts.message && !hasColumns) {
|
|
888
|
+
frame = `${" ".repeat(numberMaxWidth + 1)}${opts.message}
|
|
889
|
+
${frame}`;
|
|
890
|
+
}
|
|
891
|
+
if (shouldHighlight) {
|
|
892
|
+
return defs.reset(frame);
|
|
893
|
+
} else {
|
|
894
|
+
return frame;
|
|
895
|
+
}
|
|
896
|
+
}
|
|
897
|
+
function index(rawLines, lineNumber, colNumber, opts = {}) {
|
|
898
|
+
if (!deprecationWarningShown) {
|
|
899
|
+
deprecationWarningShown = true;
|
|
900
|
+
const message = "Passing lineNumber and colNumber is deprecated to @babel/code-frame. Please use `codeFrameColumns`.";
|
|
901
|
+
if (process.emitWarning) {
|
|
902
|
+
process.emitWarning(message, "DeprecationWarning");
|
|
903
|
+
} else {
|
|
904
|
+
const deprecationError = new Error(message);
|
|
905
|
+
deprecationError.name = "DeprecationWarning";
|
|
906
|
+
console.warn(new Error(message));
|
|
907
|
+
}
|
|
908
|
+
}
|
|
909
|
+
colNumber = Math.max(colNumber, 0);
|
|
910
|
+
const location = {
|
|
911
|
+
start: {
|
|
912
|
+
column: colNumber,
|
|
913
|
+
line: lineNumber
|
|
914
|
+
}
|
|
915
|
+
};
|
|
916
|
+
return codeFrameColumns(rawLines, location, opts);
|
|
917
|
+
}
|
|
918
|
+
exports.codeFrameColumns = codeFrameColumns;
|
|
919
|
+
exports.default = index;
|
|
920
|
+
exports.highlight = highlight;
|
|
921
|
+
}
|
|
922
|
+
});
|
|
923
|
+
|
|
924
|
+
// node_modules/parse-json/index.js
|
|
925
|
+
var require_parse_json = __commonJS({
|
|
926
|
+
"node_modules/parse-json/index.js"(exports, module) {
|
|
927
|
+
"use strict";
|
|
928
|
+
init_esm_shims();
|
|
929
|
+
var errorEx = require_error_ex();
|
|
930
|
+
var fallback = require_json_parse_even_better_errors();
|
|
931
|
+
var { default: LinesAndColumns } = require_build();
|
|
932
|
+
var { codeFrameColumns } = require_lib2();
|
|
933
|
+
var JSONError = errorEx("JSONError", {
|
|
934
|
+
fileName: errorEx.append("in %s"),
|
|
935
|
+
codeFrame: errorEx.append("\n\n%s\n")
|
|
936
|
+
});
|
|
937
|
+
var parseJson = (string, reviver, filename) => {
|
|
938
|
+
if (typeof reviver === "string") {
|
|
939
|
+
filename = reviver;
|
|
940
|
+
reviver = null;
|
|
941
|
+
}
|
|
942
|
+
try {
|
|
943
|
+
try {
|
|
944
|
+
return JSON.parse(string, reviver);
|
|
945
|
+
} catch (error) {
|
|
946
|
+
fallback(string, reviver);
|
|
947
|
+
throw error;
|
|
948
|
+
}
|
|
949
|
+
} catch (error) {
|
|
950
|
+
error.message = error.message.replace(/\n/g, "");
|
|
951
|
+
const indexMatch = error.message.match(/in JSON at position (\d+) while parsing/);
|
|
952
|
+
const jsonError = new JSONError(error);
|
|
953
|
+
if (filename) {
|
|
954
|
+
jsonError.fileName = filename;
|
|
955
|
+
}
|
|
956
|
+
if (indexMatch && indexMatch.length > 0) {
|
|
957
|
+
const lines = new LinesAndColumns(string);
|
|
958
|
+
const index = Number(indexMatch[1]);
|
|
959
|
+
const location = lines.locationForIndex(index);
|
|
960
|
+
const codeFrame = codeFrameColumns(
|
|
961
|
+
string,
|
|
962
|
+
{ start: { line: location.line + 1, column: location.column + 1 } },
|
|
963
|
+
{ highlightCode: true }
|
|
964
|
+
);
|
|
965
|
+
jsonError.codeFrame = codeFrame;
|
|
966
|
+
}
|
|
967
|
+
throw jsonError;
|
|
968
|
+
}
|
|
969
|
+
};
|
|
970
|
+
parseJson.JSONError = JSONError;
|
|
971
|
+
module.exports = parseJson;
|
|
972
|
+
}
|
|
973
|
+
});
|
|
974
|
+
|
|
975
|
+
// node_modules/js-yaml/lib/common.js
|
|
976
|
+
var require_common = __commonJS({
|
|
977
|
+
"node_modules/js-yaml/lib/common.js"(exports, module) {
|
|
978
|
+
"use strict";
|
|
979
|
+
init_esm_shims();
|
|
980
|
+
function isNothing(subject) {
|
|
981
|
+
return typeof subject === "undefined" || subject === null;
|
|
982
|
+
}
|
|
983
|
+
function isObject(subject) {
|
|
984
|
+
return typeof subject === "object" && subject !== null;
|
|
985
|
+
}
|
|
986
|
+
function toArray(sequence) {
|
|
987
|
+
if (Array.isArray(sequence)) return sequence;
|
|
988
|
+
else if (isNothing(sequence)) return [];
|
|
989
|
+
return [sequence];
|
|
990
|
+
}
|
|
991
|
+
function extend(target, source) {
|
|
992
|
+
var index, length, key, sourceKeys;
|
|
993
|
+
if (source) {
|
|
994
|
+
sourceKeys = Object.keys(source);
|
|
995
|
+
for (index = 0, length = sourceKeys.length; index < length; index += 1) {
|
|
996
|
+
key = sourceKeys[index];
|
|
997
|
+
target[key] = source[key];
|
|
998
|
+
}
|
|
999
|
+
}
|
|
1000
|
+
return target;
|
|
1001
|
+
}
|
|
1002
|
+
function repeat(string, count) {
|
|
1003
|
+
var result = "", cycle;
|
|
1004
|
+
for (cycle = 0; cycle < count; cycle += 1) {
|
|
1005
|
+
result += string;
|
|
1006
|
+
}
|
|
1007
|
+
return result;
|
|
1008
|
+
}
|
|
1009
|
+
function isNegativeZero(number) {
|
|
1010
|
+
return number === 0 && Number.NEGATIVE_INFINITY === 1 / number;
|
|
1011
|
+
}
|
|
1012
|
+
module.exports.isNothing = isNothing;
|
|
1013
|
+
module.exports.isObject = isObject;
|
|
1014
|
+
module.exports.toArray = toArray;
|
|
1015
|
+
module.exports.repeat = repeat;
|
|
1016
|
+
module.exports.isNegativeZero = isNegativeZero;
|
|
1017
|
+
module.exports.extend = extend;
|
|
1018
|
+
}
|
|
1019
|
+
});
|
|
1020
|
+
|
|
1021
|
+
// node_modules/js-yaml/lib/exception.js
|
|
1022
|
+
var require_exception = __commonJS({
|
|
1023
|
+
"node_modules/js-yaml/lib/exception.js"(exports, module) {
|
|
1024
|
+
"use strict";
|
|
1025
|
+
init_esm_shims();
|
|
1026
|
+
function formatError(exception, compact) {
|
|
1027
|
+
var where = "", message = exception.reason || "(unknown reason)";
|
|
1028
|
+
if (!exception.mark) return message;
|
|
1029
|
+
if (exception.mark.name) {
|
|
1030
|
+
where += 'in "' + exception.mark.name + '" ';
|
|
1031
|
+
}
|
|
1032
|
+
where += "(" + (exception.mark.line + 1) + ":" + (exception.mark.column + 1) + ")";
|
|
1033
|
+
if (!compact && exception.mark.snippet) {
|
|
1034
|
+
where += "\n\n" + exception.mark.snippet;
|
|
1035
|
+
}
|
|
1036
|
+
return message + " " + where;
|
|
1037
|
+
}
|
|
1038
|
+
function YAMLException(reason, mark) {
|
|
1039
|
+
Error.call(this);
|
|
1040
|
+
this.name = "YAMLException";
|
|
1041
|
+
this.reason = reason;
|
|
1042
|
+
this.mark = mark;
|
|
1043
|
+
this.message = formatError(this, false);
|
|
1044
|
+
if (Error.captureStackTrace) {
|
|
1045
|
+
Error.captureStackTrace(this, this.constructor);
|
|
1046
|
+
} else {
|
|
1047
|
+
this.stack = new Error().stack || "";
|
|
1048
|
+
}
|
|
1049
|
+
}
|
|
1050
|
+
YAMLException.prototype = Object.create(Error.prototype);
|
|
1051
|
+
YAMLException.prototype.constructor = YAMLException;
|
|
1052
|
+
YAMLException.prototype.toString = function toString(compact) {
|
|
1053
|
+
return this.name + ": " + formatError(this, compact);
|
|
1054
|
+
};
|
|
1055
|
+
module.exports = YAMLException;
|
|
1056
|
+
}
|
|
1057
|
+
});
|
|
1058
|
+
|
|
1059
|
+
// node_modules/js-yaml/lib/snippet.js
|
|
1060
|
+
var require_snippet = __commonJS({
|
|
1061
|
+
"node_modules/js-yaml/lib/snippet.js"(exports, module) {
|
|
1062
|
+
"use strict";
|
|
1063
|
+
init_esm_shims();
|
|
1064
|
+
var common = require_common();
|
|
1065
|
+
function getLine(buffer, lineStart, lineEnd, position, maxLineLength) {
|
|
1066
|
+
var head = "";
|
|
1067
|
+
var tail = "";
|
|
1068
|
+
var maxHalfLength = Math.floor(maxLineLength / 2) - 1;
|
|
1069
|
+
if (position - lineStart > maxHalfLength) {
|
|
1070
|
+
head = " ... ";
|
|
1071
|
+
lineStart = position - maxHalfLength + head.length;
|
|
1072
|
+
}
|
|
1073
|
+
if (lineEnd - position > maxHalfLength) {
|
|
1074
|
+
tail = " ...";
|
|
1075
|
+
lineEnd = position + maxHalfLength - tail.length;
|
|
1076
|
+
}
|
|
1077
|
+
return {
|
|
1078
|
+
str: head + buffer.slice(lineStart, lineEnd).replace(/\t/g, "\u2192") + tail,
|
|
1079
|
+
pos: position - lineStart + head.length
|
|
1080
|
+
// relative position
|
|
1081
|
+
};
|
|
1082
|
+
}
|
|
1083
|
+
function padStart(string, max) {
|
|
1084
|
+
return common.repeat(" ", max - string.length) + string;
|
|
1085
|
+
}
|
|
1086
|
+
function makeSnippet(mark, options) {
|
|
1087
|
+
options = Object.create(options || null);
|
|
1088
|
+
if (!mark.buffer) return null;
|
|
1089
|
+
if (!options.maxLength) options.maxLength = 79;
|
|
1090
|
+
if (typeof options.indent !== "number") options.indent = 1;
|
|
1091
|
+
if (typeof options.linesBefore !== "number") options.linesBefore = 3;
|
|
1092
|
+
if (typeof options.linesAfter !== "number") options.linesAfter = 2;
|
|
1093
|
+
var re = /\r?\n|\r|\0/g;
|
|
1094
|
+
var lineStarts = [0];
|
|
1095
|
+
var lineEnds = [];
|
|
1096
|
+
var match;
|
|
1097
|
+
var foundLineNo = -1;
|
|
1098
|
+
while (match = re.exec(mark.buffer)) {
|
|
1099
|
+
lineEnds.push(match.index);
|
|
1100
|
+
lineStarts.push(match.index + match[0].length);
|
|
1101
|
+
if (mark.position <= match.index && foundLineNo < 0) {
|
|
1102
|
+
foundLineNo = lineStarts.length - 2;
|
|
1103
|
+
}
|
|
1104
|
+
}
|
|
1105
|
+
if (foundLineNo < 0) foundLineNo = lineStarts.length - 1;
|
|
1106
|
+
var result = "", i, line;
|
|
1107
|
+
var lineNoLength = Math.min(mark.line + options.linesAfter, lineEnds.length).toString().length;
|
|
1108
|
+
var maxLineLength = options.maxLength - (options.indent + lineNoLength + 3);
|
|
1109
|
+
for (i = 1; i <= options.linesBefore; i++) {
|
|
1110
|
+
if (foundLineNo - i < 0) break;
|
|
1111
|
+
line = getLine(
|
|
1112
|
+
mark.buffer,
|
|
1113
|
+
lineStarts[foundLineNo - i],
|
|
1114
|
+
lineEnds[foundLineNo - i],
|
|
1115
|
+
mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo - i]),
|
|
1116
|
+
maxLineLength
|
|
1117
|
+
);
|
|
1118
|
+
result = common.repeat(" ", options.indent) + padStart((mark.line - i + 1).toString(), lineNoLength) + " | " + line.str + "\n" + result;
|
|
1119
|
+
}
|
|
1120
|
+
line = getLine(mark.buffer, lineStarts[foundLineNo], lineEnds[foundLineNo], mark.position, maxLineLength);
|
|
1121
|
+
result += common.repeat(" ", options.indent) + padStart((mark.line + 1).toString(), lineNoLength) + " | " + line.str + "\n";
|
|
1122
|
+
result += common.repeat("-", options.indent + lineNoLength + 3 + line.pos) + "^\n";
|
|
1123
|
+
for (i = 1; i <= options.linesAfter; i++) {
|
|
1124
|
+
if (foundLineNo + i >= lineEnds.length) break;
|
|
1125
|
+
line = getLine(
|
|
1126
|
+
mark.buffer,
|
|
1127
|
+
lineStarts[foundLineNo + i],
|
|
1128
|
+
lineEnds[foundLineNo + i],
|
|
1129
|
+
mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo + i]),
|
|
1130
|
+
maxLineLength
|
|
1131
|
+
);
|
|
1132
|
+
result += common.repeat(" ", options.indent) + padStart((mark.line + i + 1).toString(), lineNoLength) + " | " + line.str + "\n";
|
|
1133
|
+
}
|
|
1134
|
+
return result.replace(/\n$/, "");
|
|
1135
|
+
}
|
|
1136
|
+
module.exports = makeSnippet;
|
|
1137
|
+
}
|
|
1138
|
+
});
|
|
1139
|
+
|
|
1140
|
+
// node_modules/js-yaml/lib/type.js
|
|
1141
|
+
var require_type = __commonJS({
|
|
1142
|
+
"node_modules/js-yaml/lib/type.js"(exports, module) {
|
|
1143
|
+
"use strict";
|
|
1144
|
+
init_esm_shims();
|
|
1145
|
+
var YAMLException = require_exception();
|
|
1146
|
+
var TYPE_CONSTRUCTOR_OPTIONS = [
|
|
1147
|
+
"kind",
|
|
1148
|
+
"multi",
|
|
1149
|
+
"resolve",
|
|
1150
|
+
"construct",
|
|
1151
|
+
"instanceOf",
|
|
1152
|
+
"predicate",
|
|
1153
|
+
"represent",
|
|
1154
|
+
"representName",
|
|
1155
|
+
"defaultStyle",
|
|
1156
|
+
"styleAliases"
|
|
1157
|
+
];
|
|
1158
|
+
var YAML_NODE_KINDS = [
|
|
1159
|
+
"scalar",
|
|
1160
|
+
"sequence",
|
|
1161
|
+
"mapping"
|
|
1162
|
+
];
|
|
1163
|
+
function compileStyleAliases(map) {
|
|
1164
|
+
var result = {};
|
|
1165
|
+
if (map !== null) {
|
|
1166
|
+
Object.keys(map).forEach(function(style) {
|
|
1167
|
+
map[style].forEach(function(alias) {
|
|
1168
|
+
result[String(alias)] = style;
|
|
1169
|
+
});
|
|
1170
|
+
});
|
|
1171
|
+
}
|
|
1172
|
+
return result;
|
|
1173
|
+
}
|
|
1174
|
+
function Type(tag, options) {
|
|
1175
|
+
options = options || {};
|
|
1176
|
+
Object.keys(options).forEach(function(name) {
|
|
1177
|
+
if (TYPE_CONSTRUCTOR_OPTIONS.indexOf(name) === -1) {
|
|
1178
|
+
throw new YAMLException('Unknown option "' + name + '" is met in definition of "' + tag + '" YAML type.');
|
|
1179
|
+
}
|
|
1180
|
+
});
|
|
1181
|
+
this.options = options;
|
|
1182
|
+
this.tag = tag;
|
|
1183
|
+
this.kind = options["kind"] || null;
|
|
1184
|
+
this.resolve = options["resolve"] || function() {
|
|
1185
|
+
return true;
|
|
1186
|
+
};
|
|
1187
|
+
this.construct = options["construct"] || function(data) {
|
|
1188
|
+
return data;
|
|
1189
|
+
};
|
|
1190
|
+
this.instanceOf = options["instanceOf"] || null;
|
|
1191
|
+
this.predicate = options["predicate"] || null;
|
|
1192
|
+
this.represent = options["represent"] || null;
|
|
1193
|
+
this.representName = options["representName"] || null;
|
|
1194
|
+
this.defaultStyle = options["defaultStyle"] || null;
|
|
1195
|
+
this.multi = options["multi"] || false;
|
|
1196
|
+
this.styleAliases = compileStyleAliases(options["styleAliases"] || null);
|
|
1197
|
+
if (YAML_NODE_KINDS.indexOf(this.kind) === -1) {
|
|
1198
|
+
throw new YAMLException('Unknown kind "' + this.kind + '" is specified for "' + tag + '" YAML type.');
|
|
1199
|
+
}
|
|
1200
|
+
}
|
|
1201
|
+
module.exports = Type;
|
|
1202
|
+
}
|
|
1203
|
+
});
|
|
1204
|
+
|
|
1205
|
+
// node_modules/js-yaml/lib/schema.js
|
|
1206
|
+
var require_schema = __commonJS({
|
|
1207
|
+
"node_modules/js-yaml/lib/schema.js"(exports, module) {
|
|
1208
|
+
"use strict";
|
|
1209
|
+
init_esm_shims();
|
|
1210
|
+
var YAMLException = require_exception();
|
|
1211
|
+
var Type = require_type();
|
|
1212
|
+
function compileList(schema, name) {
|
|
1213
|
+
var result = [];
|
|
1214
|
+
schema[name].forEach(function(currentType) {
|
|
1215
|
+
var newIndex = result.length;
|
|
1216
|
+
result.forEach(function(previousType, previousIndex) {
|
|
1217
|
+
if (previousType.tag === currentType.tag && previousType.kind === currentType.kind && previousType.multi === currentType.multi) {
|
|
1218
|
+
newIndex = previousIndex;
|
|
1219
|
+
}
|
|
1220
|
+
});
|
|
1221
|
+
result[newIndex] = currentType;
|
|
1222
|
+
});
|
|
1223
|
+
return result;
|
|
1224
|
+
}
|
|
1225
|
+
function compileMap() {
|
|
1226
|
+
var result = {
|
|
1227
|
+
scalar: {},
|
|
1228
|
+
sequence: {},
|
|
1229
|
+
mapping: {},
|
|
1230
|
+
fallback: {},
|
|
1231
|
+
multi: {
|
|
1232
|
+
scalar: [],
|
|
1233
|
+
sequence: [],
|
|
1234
|
+
mapping: [],
|
|
1235
|
+
fallback: []
|
|
1236
|
+
}
|
|
1237
|
+
}, index, length;
|
|
1238
|
+
function collectType(type) {
|
|
1239
|
+
if (type.multi) {
|
|
1240
|
+
result.multi[type.kind].push(type);
|
|
1241
|
+
result.multi["fallback"].push(type);
|
|
1242
|
+
} else {
|
|
1243
|
+
result[type.kind][type.tag] = result["fallback"][type.tag] = type;
|
|
1244
|
+
}
|
|
1245
|
+
}
|
|
1246
|
+
for (index = 0, length = arguments.length; index < length; index += 1) {
|
|
1247
|
+
arguments[index].forEach(collectType);
|
|
1248
|
+
}
|
|
1249
|
+
return result;
|
|
1250
|
+
}
|
|
1251
|
+
function Schema(definition) {
|
|
1252
|
+
return this.extend(definition);
|
|
1253
|
+
}
|
|
1254
|
+
Schema.prototype.extend = function extend(definition) {
|
|
1255
|
+
var implicit = [];
|
|
1256
|
+
var explicit = [];
|
|
1257
|
+
if (definition instanceof Type) {
|
|
1258
|
+
explicit.push(definition);
|
|
1259
|
+
} else if (Array.isArray(definition)) {
|
|
1260
|
+
explicit = explicit.concat(definition);
|
|
1261
|
+
} else if (definition && (Array.isArray(definition.implicit) || Array.isArray(definition.explicit))) {
|
|
1262
|
+
if (definition.implicit) implicit = implicit.concat(definition.implicit);
|
|
1263
|
+
if (definition.explicit) explicit = explicit.concat(definition.explicit);
|
|
1264
|
+
} else {
|
|
1265
|
+
throw new YAMLException("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");
|
|
1266
|
+
}
|
|
1267
|
+
implicit.forEach(function(type) {
|
|
1268
|
+
if (!(type instanceof Type)) {
|
|
1269
|
+
throw new YAMLException("Specified list of YAML types (or a single Type object) contains a non-Type object.");
|
|
1270
|
+
}
|
|
1271
|
+
if (type.loadKind && type.loadKind !== "scalar") {
|
|
1272
|
+
throw new YAMLException("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");
|
|
1273
|
+
}
|
|
1274
|
+
if (type.multi) {
|
|
1275
|
+
throw new YAMLException("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.");
|
|
1276
|
+
}
|
|
1277
|
+
});
|
|
1278
|
+
explicit.forEach(function(type) {
|
|
1279
|
+
if (!(type instanceof Type)) {
|
|
1280
|
+
throw new YAMLException("Specified list of YAML types (or a single Type object) contains a non-Type object.");
|
|
1281
|
+
}
|
|
1282
|
+
});
|
|
1283
|
+
var result = Object.create(Schema.prototype);
|
|
1284
|
+
result.implicit = (this.implicit || []).concat(implicit);
|
|
1285
|
+
result.explicit = (this.explicit || []).concat(explicit);
|
|
1286
|
+
result.compiledImplicit = compileList(result, "implicit");
|
|
1287
|
+
result.compiledExplicit = compileList(result, "explicit");
|
|
1288
|
+
result.compiledTypeMap = compileMap(result.compiledImplicit, result.compiledExplicit);
|
|
1289
|
+
return result;
|
|
1290
|
+
};
|
|
1291
|
+
module.exports = Schema;
|
|
1292
|
+
}
|
|
1293
|
+
});
|
|
1294
|
+
|
|
1295
|
+
// node_modules/js-yaml/lib/type/str.js
|
|
1296
|
+
var require_str = __commonJS({
|
|
1297
|
+
"node_modules/js-yaml/lib/type/str.js"(exports, module) {
|
|
1298
|
+
"use strict";
|
|
1299
|
+
init_esm_shims();
|
|
1300
|
+
var Type = require_type();
|
|
1301
|
+
module.exports = new Type("tag:yaml.org,2002:str", {
|
|
1302
|
+
kind: "scalar",
|
|
1303
|
+
construct: function(data) {
|
|
1304
|
+
return data !== null ? data : "";
|
|
1305
|
+
}
|
|
1306
|
+
});
|
|
1307
|
+
}
|
|
1308
|
+
});
|
|
1309
|
+
|
|
1310
|
+
// node_modules/js-yaml/lib/type/seq.js
|
|
1311
|
+
var require_seq = __commonJS({
|
|
1312
|
+
"node_modules/js-yaml/lib/type/seq.js"(exports, module) {
|
|
1313
|
+
"use strict";
|
|
1314
|
+
init_esm_shims();
|
|
1315
|
+
var Type = require_type();
|
|
1316
|
+
module.exports = new Type("tag:yaml.org,2002:seq", {
|
|
1317
|
+
kind: "sequence",
|
|
1318
|
+
construct: function(data) {
|
|
1319
|
+
return data !== null ? data : [];
|
|
1320
|
+
}
|
|
1321
|
+
});
|
|
1322
|
+
}
|
|
1323
|
+
});
|
|
1324
|
+
|
|
1325
|
+
// node_modules/js-yaml/lib/type/map.js
|
|
1326
|
+
var require_map = __commonJS({
|
|
1327
|
+
"node_modules/js-yaml/lib/type/map.js"(exports, module) {
|
|
1328
|
+
"use strict";
|
|
1329
|
+
init_esm_shims();
|
|
1330
|
+
var Type = require_type();
|
|
1331
|
+
module.exports = new Type("tag:yaml.org,2002:map", {
|
|
1332
|
+
kind: "mapping",
|
|
1333
|
+
construct: function(data) {
|
|
1334
|
+
return data !== null ? data : {};
|
|
1335
|
+
}
|
|
1336
|
+
});
|
|
1337
|
+
}
|
|
1338
|
+
});
|
|
1339
|
+
|
|
1340
|
+
// node_modules/js-yaml/lib/schema/failsafe.js
|
|
1341
|
+
var require_failsafe = __commonJS({
|
|
1342
|
+
"node_modules/js-yaml/lib/schema/failsafe.js"(exports, module) {
|
|
1343
|
+
"use strict";
|
|
1344
|
+
init_esm_shims();
|
|
1345
|
+
var Schema = require_schema();
|
|
1346
|
+
module.exports = new Schema({
|
|
1347
|
+
explicit: [
|
|
1348
|
+
require_str(),
|
|
1349
|
+
require_seq(),
|
|
1350
|
+
require_map()
|
|
1351
|
+
]
|
|
1352
|
+
});
|
|
1353
|
+
}
|
|
1354
|
+
});
|
|
1355
|
+
|
|
1356
|
+
// node_modules/js-yaml/lib/type/null.js
|
|
1357
|
+
var require_null = __commonJS({
|
|
1358
|
+
"node_modules/js-yaml/lib/type/null.js"(exports, module) {
|
|
1359
|
+
"use strict";
|
|
1360
|
+
init_esm_shims();
|
|
1361
|
+
var Type = require_type();
|
|
1362
|
+
function resolveYamlNull(data) {
|
|
1363
|
+
if (data === null) return true;
|
|
1364
|
+
var max = data.length;
|
|
1365
|
+
return max === 1 && data === "~" || max === 4 && (data === "null" || data === "Null" || data === "NULL");
|
|
1366
|
+
}
|
|
1367
|
+
function constructYamlNull() {
|
|
1368
|
+
return null;
|
|
1369
|
+
}
|
|
1370
|
+
function isNull(object) {
|
|
1371
|
+
return object === null;
|
|
1372
|
+
}
|
|
1373
|
+
module.exports = new Type("tag:yaml.org,2002:null", {
|
|
1374
|
+
kind: "scalar",
|
|
1375
|
+
resolve: resolveYamlNull,
|
|
1376
|
+
construct: constructYamlNull,
|
|
1377
|
+
predicate: isNull,
|
|
1378
|
+
represent: {
|
|
1379
|
+
canonical: function() {
|
|
1380
|
+
return "~";
|
|
1381
|
+
},
|
|
1382
|
+
lowercase: function() {
|
|
1383
|
+
return "null";
|
|
1384
|
+
},
|
|
1385
|
+
uppercase: function() {
|
|
1386
|
+
return "NULL";
|
|
1387
|
+
},
|
|
1388
|
+
camelcase: function() {
|
|
1389
|
+
return "Null";
|
|
1390
|
+
},
|
|
1391
|
+
empty: function() {
|
|
1392
|
+
return "";
|
|
1393
|
+
}
|
|
1394
|
+
},
|
|
1395
|
+
defaultStyle: "lowercase"
|
|
1396
|
+
});
|
|
1397
|
+
}
|
|
1398
|
+
});
|
|
1399
|
+
|
|
1400
|
+
// node_modules/js-yaml/lib/type/bool.js
|
|
1401
|
+
var require_bool = __commonJS({
|
|
1402
|
+
"node_modules/js-yaml/lib/type/bool.js"(exports, module) {
|
|
1403
|
+
"use strict";
|
|
1404
|
+
init_esm_shims();
|
|
1405
|
+
var Type = require_type();
|
|
1406
|
+
function resolveYamlBoolean(data) {
|
|
1407
|
+
if (data === null) return false;
|
|
1408
|
+
var max = data.length;
|
|
1409
|
+
return max === 4 && (data === "true" || data === "True" || data === "TRUE") || max === 5 && (data === "false" || data === "False" || data === "FALSE");
|
|
1410
|
+
}
|
|
1411
|
+
function constructYamlBoolean(data) {
|
|
1412
|
+
return data === "true" || data === "True" || data === "TRUE";
|
|
1413
|
+
}
|
|
1414
|
+
function isBoolean(object) {
|
|
1415
|
+
return Object.prototype.toString.call(object) === "[object Boolean]";
|
|
1416
|
+
}
|
|
1417
|
+
module.exports = new Type("tag:yaml.org,2002:bool", {
|
|
1418
|
+
kind: "scalar",
|
|
1419
|
+
resolve: resolveYamlBoolean,
|
|
1420
|
+
construct: constructYamlBoolean,
|
|
1421
|
+
predicate: isBoolean,
|
|
1422
|
+
represent: {
|
|
1423
|
+
lowercase: function(object) {
|
|
1424
|
+
return object ? "true" : "false";
|
|
1425
|
+
},
|
|
1426
|
+
uppercase: function(object) {
|
|
1427
|
+
return object ? "TRUE" : "FALSE";
|
|
1428
|
+
},
|
|
1429
|
+
camelcase: function(object) {
|
|
1430
|
+
return object ? "True" : "False";
|
|
1431
|
+
}
|
|
1432
|
+
},
|
|
1433
|
+
defaultStyle: "lowercase"
|
|
1434
|
+
});
|
|
1435
|
+
}
|
|
1436
|
+
});
|
|
1437
|
+
|
|
1438
|
+
// node_modules/js-yaml/lib/type/int.js
|
|
1439
|
+
var require_int = __commonJS({
|
|
1440
|
+
"node_modules/js-yaml/lib/type/int.js"(exports, module) {
|
|
1441
|
+
"use strict";
|
|
1442
|
+
init_esm_shims();
|
|
1443
|
+
var common = require_common();
|
|
1444
|
+
var Type = require_type();
|
|
1445
|
+
function isHexCode(c) {
|
|
1446
|
+
return 48 <= c && c <= 57 || 65 <= c && c <= 70 || 97 <= c && c <= 102;
|
|
1447
|
+
}
|
|
1448
|
+
function isOctCode(c) {
|
|
1449
|
+
return 48 <= c && c <= 55;
|
|
1450
|
+
}
|
|
1451
|
+
function isDecCode(c) {
|
|
1452
|
+
return 48 <= c && c <= 57;
|
|
1453
|
+
}
|
|
1454
|
+
function resolveYamlInteger(data) {
|
|
1455
|
+
if (data === null) return false;
|
|
1456
|
+
var max = data.length, index = 0, hasDigits = false, ch;
|
|
1457
|
+
if (!max) return false;
|
|
1458
|
+
ch = data[index];
|
|
1459
|
+
if (ch === "-" || ch === "+") {
|
|
1460
|
+
ch = data[++index];
|
|
1461
|
+
}
|
|
1462
|
+
if (ch === "0") {
|
|
1463
|
+
if (index + 1 === max) return true;
|
|
1464
|
+
ch = data[++index];
|
|
1465
|
+
if (ch === "b") {
|
|
1466
|
+
index++;
|
|
1467
|
+
for (; index < max; index++) {
|
|
1468
|
+
ch = data[index];
|
|
1469
|
+
if (ch === "_") continue;
|
|
1470
|
+
if (ch !== "0" && ch !== "1") return false;
|
|
1471
|
+
hasDigits = true;
|
|
1472
|
+
}
|
|
1473
|
+
return hasDigits && ch !== "_";
|
|
1474
|
+
}
|
|
1475
|
+
if (ch === "x") {
|
|
1476
|
+
index++;
|
|
1477
|
+
for (; index < max; index++) {
|
|
1478
|
+
ch = data[index];
|
|
1479
|
+
if (ch === "_") continue;
|
|
1480
|
+
if (!isHexCode(data.charCodeAt(index))) return false;
|
|
1481
|
+
hasDigits = true;
|
|
1482
|
+
}
|
|
1483
|
+
return hasDigits && ch !== "_";
|
|
1484
|
+
}
|
|
1485
|
+
if (ch === "o") {
|
|
1486
|
+
index++;
|
|
1487
|
+
for (; index < max; index++) {
|
|
1488
|
+
ch = data[index];
|
|
1489
|
+
if (ch === "_") continue;
|
|
1490
|
+
if (!isOctCode(data.charCodeAt(index))) return false;
|
|
1491
|
+
hasDigits = true;
|
|
1492
|
+
}
|
|
1493
|
+
return hasDigits && ch !== "_";
|
|
1494
|
+
}
|
|
1495
|
+
}
|
|
1496
|
+
if (ch === "_") return false;
|
|
1497
|
+
for (; index < max; index++) {
|
|
1498
|
+
ch = data[index];
|
|
1499
|
+
if (ch === "_") continue;
|
|
1500
|
+
if (!isDecCode(data.charCodeAt(index))) {
|
|
1501
|
+
return false;
|
|
1502
|
+
}
|
|
1503
|
+
hasDigits = true;
|
|
1504
|
+
}
|
|
1505
|
+
if (!hasDigits || ch === "_") return false;
|
|
1506
|
+
return true;
|
|
1507
|
+
}
|
|
1508
|
+
function constructYamlInteger(data) {
|
|
1509
|
+
var value = data, sign = 1, ch;
|
|
1510
|
+
if (value.indexOf("_") !== -1) {
|
|
1511
|
+
value = value.replace(/_/g, "");
|
|
1512
|
+
}
|
|
1513
|
+
ch = value[0];
|
|
1514
|
+
if (ch === "-" || ch === "+") {
|
|
1515
|
+
if (ch === "-") sign = -1;
|
|
1516
|
+
value = value.slice(1);
|
|
1517
|
+
ch = value[0];
|
|
1518
|
+
}
|
|
1519
|
+
if (value === "0") return 0;
|
|
1520
|
+
if (ch === "0") {
|
|
1521
|
+
if (value[1] === "b") return sign * parseInt(value.slice(2), 2);
|
|
1522
|
+
if (value[1] === "x") return sign * parseInt(value.slice(2), 16);
|
|
1523
|
+
if (value[1] === "o") return sign * parseInt(value.slice(2), 8);
|
|
1524
|
+
}
|
|
1525
|
+
return sign * parseInt(value, 10);
|
|
1526
|
+
}
|
|
1527
|
+
function isInteger(object) {
|
|
1528
|
+
return Object.prototype.toString.call(object) === "[object Number]" && (object % 1 === 0 && !common.isNegativeZero(object));
|
|
1529
|
+
}
|
|
1530
|
+
module.exports = new Type("tag:yaml.org,2002:int", {
|
|
1531
|
+
kind: "scalar",
|
|
1532
|
+
resolve: resolveYamlInteger,
|
|
1533
|
+
construct: constructYamlInteger,
|
|
1534
|
+
predicate: isInteger,
|
|
1535
|
+
represent: {
|
|
1536
|
+
binary: function(obj) {
|
|
1537
|
+
return obj >= 0 ? "0b" + obj.toString(2) : "-0b" + obj.toString(2).slice(1);
|
|
1538
|
+
},
|
|
1539
|
+
octal: function(obj) {
|
|
1540
|
+
return obj >= 0 ? "0o" + obj.toString(8) : "-0o" + obj.toString(8).slice(1);
|
|
1541
|
+
},
|
|
1542
|
+
decimal: function(obj) {
|
|
1543
|
+
return obj.toString(10);
|
|
1544
|
+
},
|
|
1545
|
+
/* eslint-disable max-len */
|
|
1546
|
+
hexadecimal: function(obj) {
|
|
1547
|
+
return obj >= 0 ? "0x" + obj.toString(16).toUpperCase() : "-0x" + obj.toString(16).toUpperCase().slice(1);
|
|
1548
|
+
}
|
|
1549
|
+
},
|
|
1550
|
+
defaultStyle: "decimal",
|
|
1551
|
+
styleAliases: {
|
|
1552
|
+
binary: [2, "bin"],
|
|
1553
|
+
octal: [8, "oct"],
|
|
1554
|
+
decimal: [10, "dec"],
|
|
1555
|
+
hexadecimal: [16, "hex"]
|
|
1556
|
+
}
|
|
1557
|
+
});
|
|
1558
|
+
}
|
|
1559
|
+
});
|
|
1560
|
+
|
|
1561
|
+
// node_modules/js-yaml/lib/type/float.js
|
|
1562
|
+
var require_float = __commonJS({
|
|
1563
|
+
"node_modules/js-yaml/lib/type/float.js"(exports, module) {
|
|
1564
|
+
"use strict";
|
|
1565
|
+
init_esm_shims();
|
|
1566
|
+
var common = require_common();
|
|
1567
|
+
var Type = require_type();
|
|
1568
|
+
var YAML_FLOAT_PATTERN = new RegExp(
|
|
1569
|
+
// 2.5e4, 2.5 and integers
|
|
1570
|
+
"^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"
|
|
1571
|
+
);
|
|
1572
|
+
function resolveYamlFloat(data) {
|
|
1573
|
+
if (data === null) return false;
|
|
1574
|
+
if (!YAML_FLOAT_PATTERN.test(data) || // Quick hack to not allow integers end with `_`
|
|
1575
|
+
// Probably should update regexp & check speed
|
|
1576
|
+
data[data.length - 1] === "_") {
|
|
1577
|
+
return false;
|
|
1578
|
+
}
|
|
1579
|
+
return true;
|
|
1580
|
+
}
|
|
1581
|
+
function constructYamlFloat(data) {
|
|
1582
|
+
var value, sign;
|
|
1583
|
+
value = data.replace(/_/g, "").toLowerCase();
|
|
1584
|
+
sign = value[0] === "-" ? -1 : 1;
|
|
1585
|
+
if ("+-".indexOf(value[0]) >= 0) {
|
|
1586
|
+
value = value.slice(1);
|
|
1587
|
+
}
|
|
1588
|
+
if (value === ".inf") {
|
|
1589
|
+
return sign === 1 ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY;
|
|
1590
|
+
} else if (value === ".nan") {
|
|
1591
|
+
return NaN;
|
|
1592
|
+
}
|
|
1593
|
+
return sign * parseFloat(value, 10);
|
|
1594
|
+
}
|
|
1595
|
+
var SCIENTIFIC_WITHOUT_DOT = /^[-+]?[0-9]+e/;
|
|
1596
|
+
function representYamlFloat(object, style) {
|
|
1597
|
+
var res;
|
|
1598
|
+
if (isNaN(object)) {
|
|
1599
|
+
switch (style) {
|
|
1600
|
+
case "lowercase":
|
|
1601
|
+
return ".nan";
|
|
1602
|
+
case "uppercase":
|
|
1603
|
+
return ".NAN";
|
|
1604
|
+
case "camelcase":
|
|
1605
|
+
return ".NaN";
|
|
1606
|
+
}
|
|
1607
|
+
} else if (Number.POSITIVE_INFINITY === object) {
|
|
1608
|
+
switch (style) {
|
|
1609
|
+
case "lowercase":
|
|
1610
|
+
return ".inf";
|
|
1611
|
+
case "uppercase":
|
|
1612
|
+
return ".INF";
|
|
1613
|
+
case "camelcase":
|
|
1614
|
+
return ".Inf";
|
|
1615
|
+
}
|
|
1616
|
+
} else if (Number.NEGATIVE_INFINITY === object) {
|
|
1617
|
+
switch (style) {
|
|
1618
|
+
case "lowercase":
|
|
1619
|
+
return "-.inf";
|
|
1620
|
+
case "uppercase":
|
|
1621
|
+
return "-.INF";
|
|
1622
|
+
case "camelcase":
|
|
1623
|
+
return "-.Inf";
|
|
1624
|
+
}
|
|
1625
|
+
} else if (common.isNegativeZero(object)) {
|
|
1626
|
+
return "-0.0";
|
|
1627
|
+
}
|
|
1628
|
+
res = object.toString(10);
|
|
1629
|
+
return SCIENTIFIC_WITHOUT_DOT.test(res) ? res.replace("e", ".e") : res;
|
|
1630
|
+
}
|
|
1631
|
+
function isFloat(object) {
|
|
1632
|
+
return Object.prototype.toString.call(object) === "[object Number]" && (object % 1 !== 0 || common.isNegativeZero(object));
|
|
1633
|
+
}
|
|
1634
|
+
module.exports = new Type("tag:yaml.org,2002:float", {
|
|
1635
|
+
kind: "scalar",
|
|
1636
|
+
resolve: resolveYamlFloat,
|
|
1637
|
+
construct: constructYamlFloat,
|
|
1638
|
+
predicate: isFloat,
|
|
1639
|
+
represent: representYamlFloat,
|
|
1640
|
+
defaultStyle: "lowercase"
|
|
1641
|
+
});
|
|
1642
|
+
}
|
|
1643
|
+
});
|
|
1644
|
+
|
|
1645
|
+
// node_modules/js-yaml/lib/schema/json.js
|
|
1646
|
+
var require_json = __commonJS({
|
|
1647
|
+
"node_modules/js-yaml/lib/schema/json.js"(exports, module) {
|
|
1648
|
+
"use strict";
|
|
1649
|
+
init_esm_shims();
|
|
1650
|
+
module.exports = require_failsafe().extend({
|
|
1651
|
+
implicit: [
|
|
1652
|
+
require_null(),
|
|
1653
|
+
require_bool(),
|
|
1654
|
+
require_int(),
|
|
1655
|
+
require_float()
|
|
1656
|
+
]
|
|
1657
|
+
});
|
|
1658
|
+
}
|
|
1659
|
+
});
|
|
1660
|
+
|
|
1661
|
+
// node_modules/js-yaml/lib/schema/core.js
|
|
1662
|
+
var require_core = __commonJS({
|
|
1663
|
+
"node_modules/js-yaml/lib/schema/core.js"(exports, module) {
|
|
1664
|
+
"use strict";
|
|
1665
|
+
init_esm_shims();
|
|
1666
|
+
module.exports = require_json();
|
|
1667
|
+
}
|
|
1668
|
+
});
|
|
1669
|
+
|
|
1670
|
+
// node_modules/js-yaml/lib/type/timestamp.js
|
|
1671
|
+
var require_timestamp = __commonJS({
|
|
1672
|
+
"node_modules/js-yaml/lib/type/timestamp.js"(exports, module) {
|
|
1673
|
+
"use strict";
|
|
1674
|
+
init_esm_shims();
|
|
1675
|
+
var Type = require_type();
|
|
1676
|
+
var YAML_DATE_REGEXP = new RegExp(
|
|
1677
|
+
"^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"
|
|
1678
|
+
);
|
|
1679
|
+
var YAML_TIMESTAMP_REGEXP = new RegExp(
|
|
1680
|
+
"^([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]))?))?$"
|
|
1681
|
+
);
|
|
1682
|
+
function resolveYamlTimestamp(data) {
|
|
1683
|
+
if (data === null) return false;
|
|
1684
|
+
if (YAML_DATE_REGEXP.exec(data) !== null) return true;
|
|
1685
|
+
if (YAML_TIMESTAMP_REGEXP.exec(data) !== null) return true;
|
|
1686
|
+
return false;
|
|
1687
|
+
}
|
|
1688
|
+
function constructYamlTimestamp(data) {
|
|
1689
|
+
var match, year, month, day, hour, minute, second, fraction = 0, delta = null, tz_hour, tz_minute, date;
|
|
1690
|
+
match = YAML_DATE_REGEXP.exec(data);
|
|
1691
|
+
if (match === null) match = YAML_TIMESTAMP_REGEXP.exec(data);
|
|
1692
|
+
if (match === null) throw new Error("Date resolve error");
|
|
1693
|
+
year = +match[1];
|
|
1694
|
+
month = +match[2] - 1;
|
|
1695
|
+
day = +match[3];
|
|
1696
|
+
if (!match[4]) {
|
|
1697
|
+
return new Date(Date.UTC(year, month, day));
|
|
1698
|
+
}
|
|
1699
|
+
hour = +match[4];
|
|
1700
|
+
minute = +match[5];
|
|
1701
|
+
second = +match[6];
|
|
1702
|
+
if (match[7]) {
|
|
1703
|
+
fraction = match[7].slice(0, 3);
|
|
1704
|
+
while (fraction.length < 3) {
|
|
1705
|
+
fraction += "0";
|
|
1706
|
+
}
|
|
1707
|
+
fraction = +fraction;
|
|
1708
|
+
}
|
|
1709
|
+
if (match[9]) {
|
|
1710
|
+
tz_hour = +match[10];
|
|
1711
|
+
tz_minute = +(match[11] || 0);
|
|
1712
|
+
delta = (tz_hour * 60 + tz_minute) * 6e4;
|
|
1713
|
+
if (match[9] === "-") delta = -delta;
|
|
1714
|
+
}
|
|
1715
|
+
date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction));
|
|
1716
|
+
if (delta) date.setTime(date.getTime() - delta);
|
|
1717
|
+
return date;
|
|
1718
|
+
}
|
|
1719
|
+
function representYamlTimestamp(object) {
|
|
1720
|
+
return object.toISOString();
|
|
1721
|
+
}
|
|
1722
|
+
module.exports = new Type("tag:yaml.org,2002:timestamp", {
|
|
1723
|
+
kind: "scalar",
|
|
1724
|
+
resolve: resolveYamlTimestamp,
|
|
1725
|
+
construct: constructYamlTimestamp,
|
|
1726
|
+
instanceOf: Date,
|
|
1727
|
+
represent: representYamlTimestamp
|
|
1728
|
+
});
|
|
1729
|
+
}
|
|
1730
|
+
});
|
|
1731
|
+
|
|
1732
|
+
// node_modules/js-yaml/lib/type/merge.js
|
|
1733
|
+
var require_merge = __commonJS({
|
|
1734
|
+
"node_modules/js-yaml/lib/type/merge.js"(exports, module) {
|
|
1735
|
+
"use strict";
|
|
1736
|
+
init_esm_shims();
|
|
1737
|
+
var Type = require_type();
|
|
1738
|
+
function resolveYamlMerge(data) {
|
|
1739
|
+
return data === "<<" || data === null;
|
|
1740
|
+
}
|
|
1741
|
+
module.exports = new Type("tag:yaml.org,2002:merge", {
|
|
1742
|
+
kind: "scalar",
|
|
1743
|
+
resolve: resolveYamlMerge
|
|
1744
|
+
});
|
|
1745
|
+
}
|
|
1746
|
+
});
|
|
1747
|
+
|
|
1748
|
+
// node_modules/js-yaml/lib/type/binary.js
|
|
1749
|
+
var require_binary = __commonJS({
|
|
1750
|
+
"node_modules/js-yaml/lib/type/binary.js"(exports, module) {
|
|
1751
|
+
"use strict";
|
|
1752
|
+
init_esm_shims();
|
|
1753
|
+
var Type = require_type();
|
|
1754
|
+
var BASE64_MAP = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";
|
|
1755
|
+
function resolveYamlBinary(data) {
|
|
1756
|
+
if (data === null) return false;
|
|
1757
|
+
var code, idx, bitlen = 0, max = data.length, map = BASE64_MAP;
|
|
1758
|
+
for (idx = 0; idx < max; idx++) {
|
|
1759
|
+
code = map.indexOf(data.charAt(idx));
|
|
1760
|
+
if (code > 64) continue;
|
|
1761
|
+
if (code < 0) return false;
|
|
1762
|
+
bitlen += 6;
|
|
1763
|
+
}
|
|
1764
|
+
return bitlen % 8 === 0;
|
|
1765
|
+
}
|
|
1766
|
+
function constructYamlBinary(data) {
|
|
1767
|
+
var idx, tailbits, input = data.replace(/[\r\n=]/g, ""), max = input.length, map = BASE64_MAP, bits = 0, result = [];
|
|
1768
|
+
for (idx = 0; idx < max; idx++) {
|
|
1769
|
+
if (idx % 4 === 0 && idx) {
|
|
1770
|
+
result.push(bits >> 16 & 255);
|
|
1771
|
+
result.push(bits >> 8 & 255);
|
|
1772
|
+
result.push(bits & 255);
|
|
1773
|
+
}
|
|
1774
|
+
bits = bits << 6 | map.indexOf(input.charAt(idx));
|
|
1775
|
+
}
|
|
1776
|
+
tailbits = max % 4 * 6;
|
|
1777
|
+
if (tailbits === 0) {
|
|
1778
|
+
result.push(bits >> 16 & 255);
|
|
1779
|
+
result.push(bits >> 8 & 255);
|
|
1780
|
+
result.push(bits & 255);
|
|
1781
|
+
} else if (tailbits === 18) {
|
|
1782
|
+
result.push(bits >> 10 & 255);
|
|
1783
|
+
result.push(bits >> 2 & 255);
|
|
1784
|
+
} else if (tailbits === 12) {
|
|
1785
|
+
result.push(bits >> 4 & 255);
|
|
1786
|
+
}
|
|
1787
|
+
return new Uint8Array(result);
|
|
1788
|
+
}
|
|
1789
|
+
function representYamlBinary(object) {
|
|
1790
|
+
var result = "", bits = 0, idx, tail, max = object.length, map = BASE64_MAP;
|
|
1791
|
+
for (idx = 0; idx < max; idx++) {
|
|
1792
|
+
if (idx % 3 === 0 && idx) {
|
|
1793
|
+
result += map[bits >> 18 & 63];
|
|
1794
|
+
result += map[bits >> 12 & 63];
|
|
1795
|
+
result += map[bits >> 6 & 63];
|
|
1796
|
+
result += map[bits & 63];
|
|
1797
|
+
}
|
|
1798
|
+
bits = (bits << 8) + object[idx];
|
|
1799
|
+
}
|
|
1800
|
+
tail = max % 3;
|
|
1801
|
+
if (tail === 0) {
|
|
1802
|
+
result += map[bits >> 18 & 63];
|
|
1803
|
+
result += map[bits >> 12 & 63];
|
|
1804
|
+
result += map[bits >> 6 & 63];
|
|
1805
|
+
result += map[bits & 63];
|
|
1806
|
+
} else if (tail === 2) {
|
|
1807
|
+
result += map[bits >> 10 & 63];
|
|
1808
|
+
result += map[bits >> 4 & 63];
|
|
1809
|
+
result += map[bits << 2 & 63];
|
|
1810
|
+
result += map[64];
|
|
1811
|
+
} else if (tail === 1) {
|
|
1812
|
+
result += map[bits >> 2 & 63];
|
|
1813
|
+
result += map[bits << 4 & 63];
|
|
1814
|
+
result += map[64];
|
|
1815
|
+
result += map[64];
|
|
1816
|
+
}
|
|
1817
|
+
return result;
|
|
1818
|
+
}
|
|
1819
|
+
function isBinary(obj) {
|
|
1820
|
+
return Object.prototype.toString.call(obj) === "[object Uint8Array]";
|
|
1821
|
+
}
|
|
1822
|
+
module.exports = new Type("tag:yaml.org,2002:binary", {
|
|
1823
|
+
kind: "scalar",
|
|
1824
|
+
resolve: resolveYamlBinary,
|
|
1825
|
+
construct: constructYamlBinary,
|
|
1826
|
+
predicate: isBinary,
|
|
1827
|
+
represent: representYamlBinary
|
|
1828
|
+
});
|
|
1829
|
+
}
|
|
1830
|
+
});
|
|
1831
|
+
|
|
1832
|
+
// node_modules/js-yaml/lib/type/omap.js
|
|
1833
|
+
var require_omap = __commonJS({
|
|
1834
|
+
"node_modules/js-yaml/lib/type/omap.js"(exports, module) {
|
|
1835
|
+
"use strict";
|
|
1836
|
+
init_esm_shims();
|
|
1837
|
+
var Type = require_type();
|
|
1838
|
+
var _hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
1839
|
+
var _toString = Object.prototype.toString;
|
|
1840
|
+
function resolveYamlOmap(data) {
|
|
1841
|
+
if (data === null) return true;
|
|
1842
|
+
var objectKeys = [], index, length, pair, pairKey, pairHasKey, object = data;
|
|
1843
|
+
for (index = 0, length = object.length; index < length; index += 1) {
|
|
1844
|
+
pair = object[index];
|
|
1845
|
+
pairHasKey = false;
|
|
1846
|
+
if (_toString.call(pair) !== "[object Object]") return false;
|
|
1847
|
+
for (pairKey in pair) {
|
|
1848
|
+
if (_hasOwnProperty.call(pair, pairKey)) {
|
|
1849
|
+
if (!pairHasKey) pairHasKey = true;
|
|
1850
|
+
else return false;
|
|
1851
|
+
}
|
|
1852
|
+
}
|
|
1853
|
+
if (!pairHasKey) return false;
|
|
1854
|
+
if (objectKeys.indexOf(pairKey) === -1) objectKeys.push(pairKey);
|
|
1855
|
+
else return false;
|
|
1856
|
+
}
|
|
1857
|
+
return true;
|
|
1858
|
+
}
|
|
1859
|
+
function constructYamlOmap(data) {
|
|
1860
|
+
return data !== null ? data : [];
|
|
1861
|
+
}
|
|
1862
|
+
module.exports = new Type("tag:yaml.org,2002:omap", {
|
|
1863
|
+
kind: "sequence",
|
|
1864
|
+
resolve: resolveYamlOmap,
|
|
1865
|
+
construct: constructYamlOmap
|
|
1866
|
+
});
|
|
1867
|
+
}
|
|
1868
|
+
});
|
|
1869
|
+
|
|
1870
|
+
// node_modules/js-yaml/lib/type/pairs.js
|
|
1871
|
+
var require_pairs = __commonJS({
|
|
1872
|
+
"node_modules/js-yaml/lib/type/pairs.js"(exports, module) {
|
|
1873
|
+
"use strict";
|
|
1874
|
+
init_esm_shims();
|
|
1875
|
+
var Type = require_type();
|
|
1876
|
+
var _toString = Object.prototype.toString;
|
|
1877
|
+
function resolveYamlPairs(data) {
|
|
1878
|
+
if (data === null) return true;
|
|
1879
|
+
var index, length, pair, keys, result, object = data;
|
|
1880
|
+
result = new Array(object.length);
|
|
1881
|
+
for (index = 0, length = object.length; index < length; index += 1) {
|
|
1882
|
+
pair = object[index];
|
|
1883
|
+
if (_toString.call(pair) !== "[object Object]") return false;
|
|
1884
|
+
keys = Object.keys(pair);
|
|
1885
|
+
if (keys.length !== 1) return false;
|
|
1886
|
+
result[index] = [keys[0], pair[keys[0]]];
|
|
1887
|
+
}
|
|
1888
|
+
return true;
|
|
1889
|
+
}
|
|
1890
|
+
function constructYamlPairs(data) {
|
|
1891
|
+
if (data === null) return [];
|
|
1892
|
+
var index, length, pair, keys, result, object = data;
|
|
1893
|
+
result = new Array(object.length);
|
|
1894
|
+
for (index = 0, length = object.length; index < length; index += 1) {
|
|
1895
|
+
pair = object[index];
|
|
1896
|
+
keys = Object.keys(pair);
|
|
1897
|
+
result[index] = [keys[0], pair[keys[0]]];
|
|
1898
|
+
}
|
|
1899
|
+
return result;
|
|
1900
|
+
}
|
|
1901
|
+
module.exports = new Type("tag:yaml.org,2002:pairs", {
|
|
1902
|
+
kind: "sequence",
|
|
1903
|
+
resolve: resolveYamlPairs,
|
|
1904
|
+
construct: constructYamlPairs
|
|
1905
|
+
});
|
|
1906
|
+
}
|
|
1907
|
+
});
|
|
1908
|
+
|
|
1909
|
+
// node_modules/js-yaml/lib/type/set.js
|
|
1910
|
+
var require_set = __commonJS({
|
|
1911
|
+
"node_modules/js-yaml/lib/type/set.js"(exports, module) {
|
|
1912
|
+
"use strict";
|
|
1913
|
+
init_esm_shims();
|
|
1914
|
+
var Type = require_type();
|
|
1915
|
+
var _hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
1916
|
+
function resolveYamlSet(data) {
|
|
1917
|
+
if (data === null) return true;
|
|
1918
|
+
var key, object = data;
|
|
1919
|
+
for (key in object) {
|
|
1920
|
+
if (_hasOwnProperty.call(object, key)) {
|
|
1921
|
+
if (object[key] !== null) return false;
|
|
1922
|
+
}
|
|
1923
|
+
}
|
|
1924
|
+
return true;
|
|
1925
|
+
}
|
|
1926
|
+
function constructYamlSet(data) {
|
|
1927
|
+
return data !== null ? data : {};
|
|
1928
|
+
}
|
|
1929
|
+
module.exports = new Type("tag:yaml.org,2002:set", {
|
|
1930
|
+
kind: "mapping",
|
|
1931
|
+
resolve: resolveYamlSet,
|
|
1932
|
+
construct: constructYamlSet
|
|
1933
|
+
});
|
|
1934
|
+
}
|
|
1935
|
+
});
|
|
1936
|
+
|
|
1937
|
+
// node_modules/js-yaml/lib/schema/default.js
|
|
1938
|
+
var require_default = __commonJS({
|
|
1939
|
+
"node_modules/js-yaml/lib/schema/default.js"(exports, module) {
|
|
1940
|
+
"use strict";
|
|
1941
|
+
init_esm_shims();
|
|
1942
|
+
module.exports = require_core().extend({
|
|
1943
|
+
implicit: [
|
|
1944
|
+
require_timestamp(),
|
|
1945
|
+
require_merge()
|
|
1946
|
+
],
|
|
1947
|
+
explicit: [
|
|
1948
|
+
require_binary(),
|
|
1949
|
+
require_omap(),
|
|
1950
|
+
require_pairs(),
|
|
1951
|
+
require_set()
|
|
1952
|
+
]
|
|
1953
|
+
});
|
|
1954
|
+
}
|
|
1955
|
+
});
|
|
1956
|
+
|
|
1957
|
+
// node_modules/js-yaml/lib/loader.js
|
|
1958
|
+
var require_loader = __commonJS({
|
|
1959
|
+
"node_modules/js-yaml/lib/loader.js"(exports, module) {
|
|
1960
|
+
"use strict";
|
|
1961
|
+
init_esm_shims();
|
|
1962
|
+
var common = require_common();
|
|
1963
|
+
var YAMLException = require_exception();
|
|
1964
|
+
var makeSnippet = require_snippet();
|
|
1965
|
+
var DEFAULT_SCHEMA = require_default();
|
|
1966
|
+
var _hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
1967
|
+
var CONTEXT_FLOW_IN = 1;
|
|
1968
|
+
var CONTEXT_FLOW_OUT = 2;
|
|
1969
|
+
var CONTEXT_BLOCK_IN = 3;
|
|
1970
|
+
var CONTEXT_BLOCK_OUT = 4;
|
|
1971
|
+
var CHOMPING_CLIP = 1;
|
|
1972
|
+
var CHOMPING_STRIP = 2;
|
|
1973
|
+
var CHOMPING_KEEP = 3;
|
|
1974
|
+
var PATTERN_NON_PRINTABLE = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;
|
|
1975
|
+
var PATTERN_NON_ASCII_LINE_BREAKS = /[\x85\u2028\u2029]/;
|
|
1976
|
+
var PATTERN_FLOW_INDICATORS = /[,\[\]\{\}]/;
|
|
1977
|
+
var PATTERN_TAG_HANDLE = /^(?:!|!!|![a-z\-]+!)$/i;
|
|
1978
|
+
var PATTERN_TAG_URI = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;
|
|
1979
|
+
function _class(obj) {
|
|
1980
|
+
return Object.prototype.toString.call(obj);
|
|
1981
|
+
}
|
|
1982
|
+
function is_EOL(c) {
|
|
1983
|
+
return c === 10 || c === 13;
|
|
1984
|
+
}
|
|
1985
|
+
function is_WHITE_SPACE(c) {
|
|
1986
|
+
return c === 9 || c === 32;
|
|
1987
|
+
}
|
|
1988
|
+
function is_WS_OR_EOL(c) {
|
|
1989
|
+
return c === 9 || c === 32 || c === 10 || c === 13;
|
|
1990
|
+
}
|
|
1991
|
+
function is_FLOW_INDICATOR(c) {
|
|
1992
|
+
return c === 44 || c === 91 || c === 93 || c === 123 || c === 125;
|
|
1993
|
+
}
|
|
1994
|
+
function fromHexCode(c) {
|
|
1995
|
+
var lc;
|
|
1996
|
+
if (48 <= c && c <= 57) {
|
|
1997
|
+
return c - 48;
|
|
1998
|
+
}
|
|
1999
|
+
lc = c | 32;
|
|
2000
|
+
if (97 <= lc && lc <= 102) {
|
|
2001
|
+
return lc - 97 + 10;
|
|
2002
|
+
}
|
|
2003
|
+
return -1;
|
|
2004
|
+
}
|
|
2005
|
+
function escapedHexLen(c) {
|
|
2006
|
+
if (c === 120) {
|
|
2007
|
+
return 2;
|
|
2008
|
+
}
|
|
2009
|
+
if (c === 117) {
|
|
2010
|
+
return 4;
|
|
2011
|
+
}
|
|
2012
|
+
if (c === 85) {
|
|
2013
|
+
return 8;
|
|
2014
|
+
}
|
|
2015
|
+
return 0;
|
|
2016
|
+
}
|
|
2017
|
+
function fromDecimalCode(c) {
|
|
2018
|
+
if (48 <= c && c <= 57) {
|
|
2019
|
+
return c - 48;
|
|
2020
|
+
}
|
|
2021
|
+
return -1;
|
|
2022
|
+
}
|
|
2023
|
+
function simpleEscapeSequence(c) {
|
|
2024
|
+
return c === 48 ? "\0" : c === 97 ? "\x07" : c === 98 ? "\b" : c === 116 ? " " : c === 9 ? " " : c === 110 ? "\n" : 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" : "";
|
|
2025
|
+
}
|
|
2026
|
+
function charFromCodepoint(c) {
|
|
2027
|
+
if (c <= 65535) {
|
|
2028
|
+
return String.fromCharCode(c);
|
|
2029
|
+
}
|
|
2030
|
+
return String.fromCharCode(
|
|
2031
|
+
(c - 65536 >> 10) + 55296,
|
|
2032
|
+
(c - 65536 & 1023) + 56320
|
|
2033
|
+
);
|
|
2034
|
+
}
|
|
2035
|
+
function setProperty(object, key, value) {
|
|
2036
|
+
if (key === "__proto__") {
|
|
2037
|
+
Object.defineProperty(object, key, {
|
|
2038
|
+
configurable: true,
|
|
2039
|
+
enumerable: true,
|
|
2040
|
+
writable: true,
|
|
2041
|
+
value
|
|
2042
|
+
});
|
|
2043
|
+
} else {
|
|
2044
|
+
object[key] = value;
|
|
2045
|
+
}
|
|
2046
|
+
}
|
|
2047
|
+
var simpleEscapeCheck = new Array(256);
|
|
2048
|
+
var simpleEscapeMap = new Array(256);
|
|
2049
|
+
for (i = 0; i < 256; i++) {
|
|
2050
|
+
simpleEscapeCheck[i] = simpleEscapeSequence(i) ? 1 : 0;
|
|
2051
|
+
simpleEscapeMap[i] = simpleEscapeSequence(i);
|
|
2052
|
+
}
|
|
2053
|
+
var i;
|
|
2054
|
+
function State(input, options) {
|
|
2055
|
+
this.input = input;
|
|
2056
|
+
this.filename = options["filename"] || null;
|
|
2057
|
+
this.schema = options["schema"] || DEFAULT_SCHEMA;
|
|
2058
|
+
this.onWarning = options["onWarning"] || null;
|
|
2059
|
+
this.legacy = options["legacy"] || false;
|
|
2060
|
+
this.json = options["json"] || false;
|
|
2061
|
+
this.listener = options["listener"] || null;
|
|
2062
|
+
this.implicitTypes = this.schema.compiledImplicit;
|
|
2063
|
+
this.typeMap = this.schema.compiledTypeMap;
|
|
2064
|
+
this.length = input.length;
|
|
2065
|
+
this.position = 0;
|
|
2066
|
+
this.line = 0;
|
|
2067
|
+
this.lineStart = 0;
|
|
2068
|
+
this.lineIndent = 0;
|
|
2069
|
+
this.firstTabInLine = -1;
|
|
2070
|
+
this.documents = [];
|
|
2071
|
+
}
|
|
2072
|
+
function generateError(state, message) {
|
|
2073
|
+
var mark = {
|
|
2074
|
+
name: state.filename,
|
|
2075
|
+
buffer: state.input.slice(0, -1),
|
|
2076
|
+
// omit trailing \0
|
|
2077
|
+
position: state.position,
|
|
2078
|
+
line: state.line,
|
|
2079
|
+
column: state.position - state.lineStart
|
|
2080
|
+
};
|
|
2081
|
+
mark.snippet = makeSnippet(mark);
|
|
2082
|
+
return new YAMLException(message, mark);
|
|
2083
|
+
}
|
|
2084
|
+
function throwError(state, message) {
|
|
2085
|
+
throw generateError(state, message);
|
|
2086
|
+
}
|
|
2087
|
+
function throwWarning(state, message) {
|
|
2088
|
+
if (state.onWarning) {
|
|
2089
|
+
state.onWarning.call(null, generateError(state, message));
|
|
2090
|
+
}
|
|
2091
|
+
}
|
|
2092
|
+
var directiveHandlers = {
|
|
2093
|
+
YAML: function handleYamlDirective(state, name, args) {
|
|
2094
|
+
var match, major, minor;
|
|
2095
|
+
if (state.version !== null) {
|
|
2096
|
+
throwError(state, "duplication of %YAML directive");
|
|
2097
|
+
}
|
|
2098
|
+
if (args.length !== 1) {
|
|
2099
|
+
throwError(state, "YAML directive accepts exactly one argument");
|
|
2100
|
+
}
|
|
2101
|
+
match = /^([0-9]+)\.([0-9]+)$/.exec(args[0]);
|
|
2102
|
+
if (match === null) {
|
|
2103
|
+
throwError(state, "ill-formed argument of the YAML directive");
|
|
2104
|
+
}
|
|
2105
|
+
major = parseInt(match[1], 10);
|
|
2106
|
+
minor = parseInt(match[2], 10);
|
|
2107
|
+
if (major !== 1) {
|
|
2108
|
+
throwError(state, "unacceptable YAML version of the document");
|
|
2109
|
+
}
|
|
2110
|
+
state.version = args[0];
|
|
2111
|
+
state.checkLineBreaks = minor < 2;
|
|
2112
|
+
if (minor !== 1 && minor !== 2) {
|
|
2113
|
+
throwWarning(state, "unsupported YAML version of the document");
|
|
2114
|
+
}
|
|
2115
|
+
},
|
|
2116
|
+
TAG: function handleTagDirective(state, name, args) {
|
|
2117
|
+
var handle, prefix;
|
|
2118
|
+
if (args.length !== 2) {
|
|
2119
|
+
throwError(state, "TAG directive accepts exactly two arguments");
|
|
2120
|
+
}
|
|
2121
|
+
handle = args[0];
|
|
2122
|
+
prefix = args[1];
|
|
2123
|
+
if (!PATTERN_TAG_HANDLE.test(handle)) {
|
|
2124
|
+
throwError(state, "ill-formed tag handle (first argument) of the TAG directive");
|
|
2125
|
+
}
|
|
2126
|
+
if (_hasOwnProperty.call(state.tagMap, handle)) {
|
|
2127
|
+
throwError(state, 'there is a previously declared suffix for "' + handle + '" tag handle');
|
|
2128
|
+
}
|
|
2129
|
+
if (!PATTERN_TAG_URI.test(prefix)) {
|
|
2130
|
+
throwError(state, "ill-formed tag prefix (second argument) of the TAG directive");
|
|
2131
|
+
}
|
|
2132
|
+
try {
|
|
2133
|
+
prefix = decodeURIComponent(prefix);
|
|
2134
|
+
} catch (err) {
|
|
2135
|
+
throwError(state, "tag prefix is malformed: " + prefix);
|
|
2136
|
+
}
|
|
2137
|
+
state.tagMap[handle] = prefix;
|
|
2138
|
+
}
|
|
2139
|
+
};
|
|
2140
|
+
function captureSegment(state, start, end, checkJson) {
|
|
2141
|
+
var _position, _length, _character, _result;
|
|
2142
|
+
if (start < end) {
|
|
2143
|
+
_result = state.input.slice(start, end);
|
|
2144
|
+
if (checkJson) {
|
|
2145
|
+
for (_position = 0, _length = _result.length; _position < _length; _position += 1) {
|
|
2146
|
+
_character = _result.charCodeAt(_position);
|
|
2147
|
+
if (!(_character === 9 || 32 <= _character && _character <= 1114111)) {
|
|
2148
|
+
throwError(state, "expected valid JSON character");
|
|
2149
|
+
}
|
|
2150
|
+
}
|
|
2151
|
+
} else if (PATTERN_NON_PRINTABLE.test(_result)) {
|
|
2152
|
+
throwError(state, "the stream contains non-printable characters");
|
|
2153
|
+
}
|
|
2154
|
+
state.result += _result;
|
|
2155
|
+
}
|
|
2156
|
+
}
|
|
2157
|
+
function mergeMappings(state, destination, source, overridableKeys) {
|
|
2158
|
+
var sourceKeys, key, index, quantity;
|
|
2159
|
+
if (!common.isObject(source)) {
|
|
2160
|
+
throwError(state, "cannot merge mappings; the provided source object is unacceptable");
|
|
2161
|
+
}
|
|
2162
|
+
sourceKeys = Object.keys(source);
|
|
2163
|
+
for (index = 0, quantity = sourceKeys.length; index < quantity; index += 1) {
|
|
2164
|
+
key = sourceKeys[index];
|
|
2165
|
+
if (!_hasOwnProperty.call(destination, key)) {
|
|
2166
|
+
setProperty(destination, key, source[key]);
|
|
2167
|
+
overridableKeys[key] = true;
|
|
2168
|
+
}
|
|
2169
|
+
}
|
|
2170
|
+
}
|
|
2171
|
+
function storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, startLine, startLineStart, startPos) {
|
|
2172
|
+
var index, quantity;
|
|
2173
|
+
if (Array.isArray(keyNode)) {
|
|
2174
|
+
keyNode = Array.prototype.slice.call(keyNode);
|
|
2175
|
+
for (index = 0, quantity = keyNode.length; index < quantity; index += 1) {
|
|
2176
|
+
if (Array.isArray(keyNode[index])) {
|
|
2177
|
+
throwError(state, "nested arrays are not supported inside keys");
|
|
2178
|
+
}
|
|
2179
|
+
if (typeof keyNode === "object" && _class(keyNode[index]) === "[object Object]") {
|
|
2180
|
+
keyNode[index] = "[object Object]";
|
|
2181
|
+
}
|
|
2182
|
+
}
|
|
2183
|
+
}
|
|
2184
|
+
if (typeof keyNode === "object" && _class(keyNode) === "[object Object]") {
|
|
2185
|
+
keyNode = "[object Object]";
|
|
2186
|
+
}
|
|
2187
|
+
keyNode = String(keyNode);
|
|
2188
|
+
if (_result === null) {
|
|
2189
|
+
_result = {};
|
|
2190
|
+
}
|
|
2191
|
+
if (keyTag === "tag:yaml.org,2002:merge") {
|
|
2192
|
+
if (Array.isArray(valueNode)) {
|
|
2193
|
+
for (index = 0, quantity = valueNode.length; index < quantity; index += 1) {
|
|
2194
|
+
mergeMappings(state, _result, valueNode[index], overridableKeys);
|
|
2195
|
+
}
|
|
2196
|
+
} else {
|
|
2197
|
+
mergeMappings(state, _result, valueNode, overridableKeys);
|
|
2198
|
+
}
|
|
2199
|
+
} else {
|
|
2200
|
+
if (!state.json && !_hasOwnProperty.call(overridableKeys, keyNode) && _hasOwnProperty.call(_result, keyNode)) {
|
|
2201
|
+
state.line = startLine || state.line;
|
|
2202
|
+
state.lineStart = startLineStart || state.lineStart;
|
|
2203
|
+
state.position = startPos || state.position;
|
|
2204
|
+
throwError(state, "duplicated mapping key");
|
|
2205
|
+
}
|
|
2206
|
+
setProperty(_result, keyNode, valueNode);
|
|
2207
|
+
delete overridableKeys[keyNode];
|
|
2208
|
+
}
|
|
2209
|
+
return _result;
|
|
2210
|
+
}
|
|
2211
|
+
function readLineBreak(state) {
|
|
2212
|
+
var ch;
|
|
2213
|
+
ch = state.input.charCodeAt(state.position);
|
|
2214
|
+
if (ch === 10) {
|
|
2215
|
+
state.position++;
|
|
2216
|
+
} else if (ch === 13) {
|
|
2217
|
+
state.position++;
|
|
2218
|
+
if (state.input.charCodeAt(state.position) === 10) {
|
|
2219
|
+
state.position++;
|
|
2220
|
+
}
|
|
2221
|
+
} else {
|
|
2222
|
+
throwError(state, "a line break is expected");
|
|
2223
|
+
}
|
|
2224
|
+
state.line += 1;
|
|
2225
|
+
state.lineStart = state.position;
|
|
2226
|
+
state.firstTabInLine = -1;
|
|
2227
|
+
}
|
|
2228
|
+
function skipSeparationSpace(state, allowComments, checkIndent) {
|
|
2229
|
+
var lineBreaks = 0, ch = state.input.charCodeAt(state.position);
|
|
2230
|
+
while (ch !== 0) {
|
|
2231
|
+
while (is_WHITE_SPACE(ch)) {
|
|
2232
|
+
if (ch === 9 && state.firstTabInLine === -1) {
|
|
2233
|
+
state.firstTabInLine = state.position;
|
|
2234
|
+
}
|
|
2235
|
+
ch = state.input.charCodeAt(++state.position);
|
|
2236
|
+
}
|
|
2237
|
+
if (allowComments && ch === 35) {
|
|
2238
|
+
do {
|
|
2239
|
+
ch = state.input.charCodeAt(++state.position);
|
|
2240
|
+
} while (ch !== 10 && ch !== 13 && ch !== 0);
|
|
2241
|
+
}
|
|
2242
|
+
if (is_EOL(ch)) {
|
|
2243
|
+
readLineBreak(state);
|
|
2244
|
+
ch = state.input.charCodeAt(state.position);
|
|
2245
|
+
lineBreaks++;
|
|
2246
|
+
state.lineIndent = 0;
|
|
2247
|
+
while (ch === 32) {
|
|
2248
|
+
state.lineIndent++;
|
|
2249
|
+
ch = state.input.charCodeAt(++state.position);
|
|
2250
|
+
}
|
|
2251
|
+
} else {
|
|
2252
|
+
break;
|
|
2253
|
+
}
|
|
2254
|
+
}
|
|
2255
|
+
if (checkIndent !== -1 && lineBreaks !== 0 && state.lineIndent < checkIndent) {
|
|
2256
|
+
throwWarning(state, "deficient indentation");
|
|
2257
|
+
}
|
|
2258
|
+
return lineBreaks;
|
|
2259
|
+
}
|
|
2260
|
+
function testDocumentSeparator(state) {
|
|
2261
|
+
var _position = state.position, ch;
|
|
2262
|
+
ch = state.input.charCodeAt(_position);
|
|
2263
|
+
if ((ch === 45 || ch === 46) && ch === state.input.charCodeAt(_position + 1) && ch === state.input.charCodeAt(_position + 2)) {
|
|
2264
|
+
_position += 3;
|
|
2265
|
+
ch = state.input.charCodeAt(_position);
|
|
2266
|
+
if (ch === 0 || is_WS_OR_EOL(ch)) {
|
|
2267
|
+
return true;
|
|
2268
|
+
}
|
|
2269
|
+
}
|
|
2270
|
+
return false;
|
|
2271
|
+
}
|
|
2272
|
+
function writeFoldedLines(state, count) {
|
|
2273
|
+
if (count === 1) {
|
|
2274
|
+
state.result += " ";
|
|
2275
|
+
} else if (count > 1) {
|
|
2276
|
+
state.result += common.repeat("\n", count - 1);
|
|
2277
|
+
}
|
|
2278
|
+
}
|
|
2279
|
+
function readPlainScalar(state, nodeIndent, withinFlowCollection) {
|
|
2280
|
+
var preceding, following, captureStart, captureEnd, hasPendingContent, _line, _lineStart, _lineIndent, _kind = state.kind, _result = state.result, ch;
|
|
2281
|
+
ch = state.input.charCodeAt(state.position);
|
|
2282
|
+
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) {
|
|
2283
|
+
return false;
|
|
2284
|
+
}
|
|
2285
|
+
if (ch === 63 || ch === 45) {
|
|
2286
|
+
following = state.input.charCodeAt(state.position + 1);
|
|
2287
|
+
if (is_WS_OR_EOL(following) || withinFlowCollection && is_FLOW_INDICATOR(following)) {
|
|
2288
|
+
return false;
|
|
2289
|
+
}
|
|
2290
|
+
}
|
|
2291
|
+
state.kind = "scalar";
|
|
2292
|
+
state.result = "";
|
|
2293
|
+
captureStart = captureEnd = state.position;
|
|
2294
|
+
hasPendingContent = false;
|
|
2295
|
+
while (ch !== 0) {
|
|
2296
|
+
if (ch === 58) {
|
|
2297
|
+
following = state.input.charCodeAt(state.position + 1);
|
|
2298
|
+
if (is_WS_OR_EOL(following) || withinFlowCollection && is_FLOW_INDICATOR(following)) {
|
|
2299
|
+
break;
|
|
2300
|
+
}
|
|
2301
|
+
} else if (ch === 35) {
|
|
2302
|
+
preceding = state.input.charCodeAt(state.position - 1);
|
|
2303
|
+
if (is_WS_OR_EOL(preceding)) {
|
|
2304
|
+
break;
|
|
2305
|
+
}
|
|
2306
|
+
} else if (state.position === state.lineStart && testDocumentSeparator(state) || withinFlowCollection && is_FLOW_INDICATOR(ch)) {
|
|
2307
|
+
break;
|
|
2308
|
+
} else if (is_EOL(ch)) {
|
|
2309
|
+
_line = state.line;
|
|
2310
|
+
_lineStart = state.lineStart;
|
|
2311
|
+
_lineIndent = state.lineIndent;
|
|
2312
|
+
skipSeparationSpace(state, false, -1);
|
|
2313
|
+
if (state.lineIndent >= nodeIndent) {
|
|
2314
|
+
hasPendingContent = true;
|
|
2315
|
+
ch = state.input.charCodeAt(state.position);
|
|
2316
|
+
continue;
|
|
2317
|
+
} else {
|
|
2318
|
+
state.position = captureEnd;
|
|
2319
|
+
state.line = _line;
|
|
2320
|
+
state.lineStart = _lineStart;
|
|
2321
|
+
state.lineIndent = _lineIndent;
|
|
2322
|
+
break;
|
|
2323
|
+
}
|
|
2324
|
+
}
|
|
2325
|
+
if (hasPendingContent) {
|
|
2326
|
+
captureSegment(state, captureStart, captureEnd, false);
|
|
2327
|
+
writeFoldedLines(state, state.line - _line);
|
|
2328
|
+
captureStart = captureEnd = state.position;
|
|
2329
|
+
hasPendingContent = false;
|
|
2330
|
+
}
|
|
2331
|
+
if (!is_WHITE_SPACE(ch)) {
|
|
2332
|
+
captureEnd = state.position + 1;
|
|
2333
|
+
}
|
|
2334
|
+
ch = state.input.charCodeAt(++state.position);
|
|
2335
|
+
}
|
|
2336
|
+
captureSegment(state, captureStart, captureEnd, false);
|
|
2337
|
+
if (state.result) {
|
|
2338
|
+
return true;
|
|
2339
|
+
}
|
|
2340
|
+
state.kind = _kind;
|
|
2341
|
+
state.result = _result;
|
|
2342
|
+
return false;
|
|
2343
|
+
}
|
|
2344
|
+
function readSingleQuotedScalar(state, nodeIndent) {
|
|
2345
|
+
var ch, captureStart, captureEnd;
|
|
2346
|
+
ch = state.input.charCodeAt(state.position);
|
|
2347
|
+
if (ch !== 39) {
|
|
2348
|
+
return false;
|
|
2349
|
+
}
|
|
2350
|
+
state.kind = "scalar";
|
|
2351
|
+
state.result = "";
|
|
2352
|
+
state.position++;
|
|
2353
|
+
captureStart = captureEnd = state.position;
|
|
2354
|
+
while ((ch = state.input.charCodeAt(state.position)) !== 0) {
|
|
2355
|
+
if (ch === 39) {
|
|
2356
|
+
captureSegment(state, captureStart, state.position, true);
|
|
2357
|
+
ch = state.input.charCodeAt(++state.position);
|
|
2358
|
+
if (ch === 39) {
|
|
2359
|
+
captureStart = state.position;
|
|
2360
|
+
state.position++;
|
|
2361
|
+
captureEnd = state.position;
|
|
2362
|
+
} else {
|
|
2363
|
+
return true;
|
|
2364
|
+
}
|
|
2365
|
+
} else if (is_EOL(ch)) {
|
|
2366
|
+
captureSegment(state, captureStart, captureEnd, true);
|
|
2367
|
+
writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent));
|
|
2368
|
+
captureStart = captureEnd = state.position;
|
|
2369
|
+
} else if (state.position === state.lineStart && testDocumentSeparator(state)) {
|
|
2370
|
+
throwError(state, "unexpected end of the document within a single quoted scalar");
|
|
2371
|
+
} else {
|
|
2372
|
+
state.position++;
|
|
2373
|
+
captureEnd = state.position;
|
|
2374
|
+
}
|
|
2375
|
+
}
|
|
2376
|
+
throwError(state, "unexpected end of the stream within a single quoted scalar");
|
|
2377
|
+
}
|
|
2378
|
+
function readDoubleQuotedScalar(state, nodeIndent) {
|
|
2379
|
+
var captureStart, captureEnd, hexLength, hexResult, tmp, ch;
|
|
2380
|
+
ch = state.input.charCodeAt(state.position);
|
|
2381
|
+
if (ch !== 34) {
|
|
2382
|
+
return false;
|
|
2383
|
+
}
|
|
2384
|
+
state.kind = "scalar";
|
|
2385
|
+
state.result = "";
|
|
2386
|
+
state.position++;
|
|
2387
|
+
captureStart = captureEnd = state.position;
|
|
2388
|
+
while ((ch = state.input.charCodeAt(state.position)) !== 0) {
|
|
2389
|
+
if (ch === 34) {
|
|
2390
|
+
captureSegment(state, captureStart, state.position, true);
|
|
2391
|
+
state.position++;
|
|
2392
|
+
return true;
|
|
2393
|
+
} else if (ch === 92) {
|
|
2394
|
+
captureSegment(state, captureStart, state.position, true);
|
|
2395
|
+
ch = state.input.charCodeAt(++state.position);
|
|
2396
|
+
if (is_EOL(ch)) {
|
|
2397
|
+
skipSeparationSpace(state, false, nodeIndent);
|
|
2398
|
+
} else if (ch < 256 && simpleEscapeCheck[ch]) {
|
|
2399
|
+
state.result += simpleEscapeMap[ch];
|
|
2400
|
+
state.position++;
|
|
2401
|
+
} else if ((tmp = escapedHexLen(ch)) > 0) {
|
|
2402
|
+
hexLength = tmp;
|
|
2403
|
+
hexResult = 0;
|
|
2404
|
+
for (; hexLength > 0; hexLength--) {
|
|
2405
|
+
ch = state.input.charCodeAt(++state.position);
|
|
2406
|
+
if ((tmp = fromHexCode(ch)) >= 0) {
|
|
2407
|
+
hexResult = (hexResult << 4) + tmp;
|
|
2408
|
+
} else {
|
|
2409
|
+
throwError(state, "expected hexadecimal character");
|
|
2410
|
+
}
|
|
2411
|
+
}
|
|
2412
|
+
state.result += charFromCodepoint(hexResult);
|
|
2413
|
+
state.position++;
|
|
2414
|
+
} else {
|
|
2415
|
+
throwError(state, "unknown escape sequence");
|
|
2416
|
+
}
|
|
2417
|
+
captureStart = captureEnd = state.position;
|
|
2418
|
+
} else if (is_EOL(ch)) {
|
|
2419
|
+
captureSegment(state, captureStart, captureEnd, true);
|
|
2420
|
+
writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent));
|
|
2421
|
+
captureStart = captureEnd = state.position;
|
|
2422
|
+
} else if (state.position === state.lineStart && testDocumentSeparator(state)) {
|
|
2423
|
+
throwError(state, "unexpected end of the document within a double quoted scalar");
|
|
2424
|
+
} else {
|
|
2425
|
+
state.position++;
|
|
2426
|
+
captureEnd = state.position;
|
|
2427
|
+
}
|
|
2428
|
+
}
|
|
2429
|
+
throwError(state, "unexpected end of the stream within a double quoted scalar");
|
|
2430
|
+
}
|
|
2431
|
+
function readFlowCollection(state, nodeIndent) {
|
|
2432
|
+
var readNext = true, _line, _lineStart, _pos, _tag = state.tag, _result, _anchor = state.anchor, following, terminator, isPair, isExplicitPair, isMapping, overridableKeys = /* @__PURE__ */ Object.create(null), keyNode, keyTag, valueNode, ch;
|
|
2433
|
+
ch = state.input.charCodeAt(state.position);
|
|
2434
|
+
if (ch === 91) {
|
|
2435
|
+
terminator = 93;
|
|
2436
|
+
isMapping = false;
|
|
2437
|
+
_result = [];
|
|
2438
|
+
} else if (ch === 123) {
|
|
2439
|
+
terminator = 125;
|
|
2440
|
+
isMapping = true;
|
|
2441
|
+
_result = {};
|
|
2442
|
+
} else {
|
|
2443
|
+
return false;
|
|
2444
|
+
}
|
|
2445
|
+
if (state.anchor !== null) {
|
|
2446
|
+
state.anchorMap[state.anchor] = _result;
|
|
2447
|
+
}
|
|
2448
|
+
ch = state.input.charCodeAt(++state.position);
|
|
2449
|
+
while (ch !== 0) {
|
|
2450
|
+
skipSeparationSpace(state, true, nodeIndent);
|
|
2451
|
+
ch = state.input.charCodeAt(state.position);
|
|
2452
|
+
if (ch === terminator) {
|
|
2453
|
+
state.position++;
|
|
2454
|
+
state.tag = _tag;
|
|
2455
|
+
state.anchor = _anchor;
|
|
2456
|
+
state.kind = isMapping ? "mapping" : "sequence";
|
|
2457
|
+
state.result = _result;
|
|
2458
|
+
return true;
|
|
2459
|
+
} else if (!readNext) {
|
|
2460
|
+
throwError(state, "missed comma between flow collection entries");
|
|
2461
|
+
} else if (ch === 44) {
|
|
2462
|
+
throwError(state, "expected the node content, but found ','");
|
|
2463
|
+
}
|
|
2464
|
+
keyTag = keyNode = valueNode = null;
|
|
2465
|
+
isPair = isExplicitPair = false;
|
|
2466
|
+
if (ch === 63) {
|
|
2467
|
+
following = state.input.charCodeAt(state.position + 1);
|
|
2468
|
+
if (is_WS_OR_EOL(following)) {
|
|
2469
|
+
isPair = isExplicitPair = true;
|
|
2470
|
+
state.position++;
|
|
2471
|
+
skipSeparationSpace(state, true, nodeIndent);
|
|
2472
|
+
}
|
|
2473
|
+
}
|
|
2474
|
+
_line = state.line;
|
|
2475
|
+
_lineStart = state.lineStart;
|
|
2476
|
+
_pos = state.position;
|
|
2477
|
+
composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true);
|
|
2478
|
+
keyTag = state.tag;
|
|
2479
|
+
keyNode = state.result;
|
|
2480
|
+
skipSeparationSpace(state, true, nodeIndent);
|
|
2481
|
+
ch = state.input.charCodeAt(state.position);
|
|
2482
|
+
if ((isExplicitPair || state.line === _line) && ch === 58) {
|
|
2483
|
+
isPair = true;
|
|
2484
|
+
ch = state.input.charCodeAt(++state.position);
|
|
2485
|
+
skipSeparationSpace(state, true, nodeIndent);
|
|
2486
|
+
composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true);
|
|
2487
|
+
valueNode = state.result;
|
|
2488
|
+
}
|
|
2489
|
+
if (isMapping) {
|
|
2490
|
+
storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos);
|
|
2491
|
+
} else if (isPair) {
|
|
2492
|
+
_result.push(storeMappingPair(state, null, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos));
|
|
2493
|
+
} else {
|
|
2494
|
+
_result.push(keyNode);
|
|
2495
|
+
}
|
|
2496
|
+
skipSeparationSpace(state, true, nodeIndent);
|
|
2497
|
+
ch = state.input.charCodeAt(state.position);
|
|
2498
|
+
if (ch === 44) {
|
|
2499
|
+
readNext = true;
|
|
2500
|
+
ch = state.input.charCodeAt(++state.position);
|
|
2501
|
+
} else {
|
|
2502
|
+
readNext = false;
|
|
2503
|
+
}
|
|
2504
|
+
}
|
|
2505
|
+
throwError(state, "unexpected end of the stream within a flow collection");
|
|
2506
|
+
}
|
|
2507
|
+
function readBlockScalar(state, nodeIndent) {
|
|
2508
|
+
var captureStart, folding, chomping = CHOMPING_CLIP, didReadContent = false, detectedIndent = false, textIndent = nodeIndent, emptyLines = 0, atMoreIndented = false, tmp, ch;
|
|
2509
|
+
ch = state.input.charCodeAt(state.position);
|
|
2510
|
+
if (ch === 124) {
|
|
2511
|
+
folding = false;
|
|
2512
|
+
} else if (ch === 62) {
|
|
2513
|
+
folding = true;
|
|
2514
|
+
} else {
|
|
2515
|
+
return false;
|
|
2516
|
+
}
|
|
2517
|
+
state.kind = "scalar";
|
|
2518
|
+
state.result = "";
|
|
2519
|
+
while (ch !== 0) {
|
|
2520
|
+
ch = state.input.charCodeAt(++state.position);
|
|
2521
|
+
if (ch === 43 || ch === 45) {
|
|
2522
|
+
if (CHOMPING_CLIP === chomping) {
|
|
2523
|
+
chomping = ch === 43 ? CHOMPING_KEEP : CHOMPING_STRIP;
|
|
2524
|
+
} else {
|
|
2525
|
+
throwError(state, "repeat of a chomping mode identifier");
|
|
2526
|
+
}
|
|
2527
|
+
} else if ((tmp = fromDecimalCode(ch)) >= 0) {
|
|
2528
|
+
if (tmp === 0) {
|
|
2529
|
+
throwError(state, "bad explicit indentation width of a block scalar; it cannot be less than one");
|
|
2530
|
+
} else if (!detectedIndent) {
|
|
2531
|
+
textIndent = nodeIndent + tmp - 1;
|
|
2532
|
+
detectedIndent = true;
|
|
2533
|
+
} else {
|
|
2534
|
+
throwError(state, "repeat of an indentation width identifier");
|
|
2535
|
+
}
|
|
2536
|
+
} else {
|
|
2537
|
+
break;
|
|
2538
|
+
}
|
|
2539
|
+
}
|
|
2540
|
+
if (is_WHITE_SPACE(ch)) {
|
|
2541
|
+
do {
|
|
2542
|
+
ch = state.input.charCodeAt(++state.position);
|
|
2543
|
+
} while (is_WHITE_SPACE(ch));
|
|
2544
|
+
if (ch === 35) {
|
|
2545
|
+
do {
|
|
2546
|
+
ch = state.input.charCodeAt(++state.position);
|
|
2547
|
+
} while (!is_EOL(ch) && ch !== 0);
|
|
2548
|
+
}
|
|
2549
|
+
}
|
|
2550
|
+
while (ch !== 0) {
|
|
2551
|
+
readLineBreak(state);
|
|
2552
|
+
state.lineIndent = 0;
|
|
2553
|
+
ch = state.input.charCodeAt(state.position);
|
|
2554
|
+
while ((!detectedIndent || state.lineIndent < textIndent) && ch === 32) {
|
|
2555
|
+
state.lineIndent++;
|
|
2556
|
+
ch = state.input.charCodeAt(++state.position);
|
|
2557
|
+
}
|
|
2558
|
+
if (!detectedIndent && state.lineIndent > textIndent) {
|
|
2559
|
+
textIndent = state.lineIndent;
|
|
2560
|
+
}
|
|
2561
|
+
if (is_EOL(ch)) {
|
|
2562
|
+
emptyLines++;
|
|
2563
|
+
continue;
|
|
2564
|
+
}
|
|
2565
|
+
if (state.lineIndent < textIndent) {
|
|
2566
|
+
if (chomping === CHOMPING_KEEP) {
|
|
2567
|
+
state.result += common.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines);
|
|
2568
|
+
} else if (chomping === CHOMPING_CLIP) {
|
|
2569
|
+
if (didReadContent) {
|
|
2570
|
+
state.result += "\n";
|
|
2571
|
+
}
|
|
2572
|
+
}
|
|
2573
|
+
break;
|
|
2574
|
+
}
|
|
2575
|
+
if (folding) {
|
|
2576
|
+
if (is_WHITE_SPACE(ch)) {
|
|
2577
|
+
atMoreIndented = true;
|
|
2578
|
+
state.result += common.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines);
|
|
2579
|
+
} else if (atMoreIndented) {
|
|
2580
|
+
atMoreIndented = false;
|
|
2581
|
+
state.result += common.repeat("\n", emptyLines + 1);
|
|
2582
|
+
} else if (emptyLines === 0) {
|
|
2583
|
+
if (didReadContent) {
|
|
2584
|
+
state.result += " ";
|
|
2585
|
+
}
|
|
2586
|
+
} else {
|
|
2587
|
+
state.result += common.repeat("\n", emptyLines);
|
|
2588
|
+
}
|
|
2589
|
+
} else {
|
|
2590
|
+
state.result += common.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines);
|
|
2591
|
+
}
|
|
2592
|
+
didReadContent = true;
|
|
2593
|
+
detectedIndent = true;
|
|
2594
|
+
emptyLines = 0;
|
|
2595
|
+
captureStart = state.position;
|
|
2596
|
+
while (!is_EOL(ch) && ch !== 0) {
|
|
2597
|
+
ch = state.input.charCodeAt(++state.position);
|
|
2598
|
+
}
|
|
2599
|
+
captureSegment(state, captureStart, state.position, false);
|
|
2600
|
+
}
|
|
2601
|
+
return true;
|
|
2602
|
+
}
|
|
2603
|
+
function readBlockSequence(state, nodeIndent) {
|
|
2604
|
+
var _line, _tag = state.tag, _anchor = state.anchor, _result = [], following, detected = false, ch;
|
|
2605
|
+
if (state.firstTabInLine !== -1) return false;
|
|
2606
|
+
if (state.anchor !== null) {
|
|
2607
|
+
state.anchorMap[state.anchor] = _result;
|
|
2608
|
+
}
|
|
2609
|
+
ch = state.input.charCodeAt(state.position);
|
|
2610
|
+
while (ch !== 0) {
|
|
2611
|
+
if (state.firstTabInLine !== -1) {
|
|
2612
|
+
state.position = state.firstTabInLine;
|
|
2613
|
+
throwError(state, "tab characters must not be used in indentation");
|
|
2614
|
+
}
|
|
2615
|
+
if (ch !== 45) {
|
|
2616
|
+
break;
|
|
2617
|
+
}
|
|
2618
|
+
following = state.input.charCodeAt(state.position + 1);
|
|
2619
|
+
if (!is_WS_OR_EOL(following)) {
|
|
2620
|
+
break;
|
|
2621
|
+
}
|
|
2622
|
+
detected = true;
|
|
2623
|
+
state.position++;
|
|
2624
|
+
if (skipSeparationSpace(state, true, -1)) {
|
|
2625
|
+
if (state.lineIndent <= nodeIndent) {
|
|
2626
|
+
_result.push(null);
|
|
2627
|
+
ch = state.input.charCodeAt(state.position);
|
|
2628
|
+
continue;
|
|
2629
|
+
}
|
|
2630
|
+
}
|
|
2631
|
+
_line = state.line;
|
|
2632
|
+
composeNode(state, nodeIndent, CONTEXT_BLOCK_IN, false, true);
|
|
2633
|
+
_result.push(state.result);
|
|
2634
|
+
skipSeparationSpace(state, true, -1);
|
|
2635
|
+
ch = state.input.charCodeAt(state.position);
|
|
2636
|
+
if ((state.line === _line || state.lineIndent > nodeIndent) && ch !== 0) {
|
|
2637
|
+
throwError(state, "bad indentation of a sequence entry");
|
|
2638
|
+
} else if (state.lineIndent < nodeIndent) {
|
|
2639
|
+
break;
|
|
2640
|
+
}
|
|
2641
|
+
}
|
|
2642
|
+
if (detected) {
|
|
2643
|
+
state.tag = _tag;
|
|
2644
|
+
state.anchor = _anchor;
|
|
2645
|
+
state.kind = "sequence";
|
|
2646
|
+
state.result = _result;
|
|
2647
|
+
return true;
|
|
2648
|
+
}
|
|
2649
|
+
return false;
|
|
2650
|
+
}
|
|
2651
|
+
function readBlockMapping(state, nodeIndent, flowIndent) {
|
|
2652
|
+
var following, allowCompact, _line, _keyLine, _keyLineStart, _keyPos, _tag = state.tag, _anchor = state.anchor, _result = {}, overridableKeys = /* @__PURE__ */ Object.create(null), keyTag = null, keyNode = null, valueNode = null, atExplicitKey = false, detected = false, ch;
|
|
2653
|
+
if (state.firstTabInLine !== -1) return false;
|
|
2654
|
+
if (state.anchor !== null) {
|
|
2655
|
+
state.anchorMap[state.anchor] = _result;
|
|
2656
|
+
}
|
|
2657
|
+
ch = state.input.charCodeAt(state.position);
|
|
2658
|
+
while (ch !== 0) {
|
|
2659
|
+
if (!atExplicitKey && state.firstTabInLine !== -1) {
|
|
2660
|
+
state.position = state.firstTabInLine;
|
|
2661
|
+
throwError(state, "tab characters must not be used in indentation");
|
|
2662
|
+
}
|
|
2663
|
+
following = state.input.charCodeAt(state.position + 1);
|
|
2664
|
+
_line = state.line;
|
|
2665
|
+
if ((ch === 63 || ch === 58) && is_WS_OR_EOL(following)) {
|
|
2666
|
+
if (ch === 63) {
|
|
2667
|
+
if (atExplicitKey) {
|
|
2668
|
+
storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos);
|
|
2669
|
+
keyTag = keyNode = valueNode = null;
|
|
2670
|
+
}
|
|
2671
|
+
detected = true;
|
|
2672
|
+
atExplicitKey = true;
|
|
2673
|
+
allowCompact = true;
|
|
2674
|
+
} else if (atExplicitKey) {
|
|
2675
|
+
atExplicitKey = false;
|
|
2676
|
+
allowCompact = true;
|
|
2677
|
+
} else {
|
|
2678
|
+
throwError(state, "incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line");
|
|
2679
|
+
}
|
|
2680
|
+
state.position += 1;
|
|
2681
|
+
ch = following;
|
|
2682
|
+
} else {
|
|
2683
|
+
_keyLine = state.line;
|
|
2684
|
+
_keyLineStart = state.lineStart;
|
|
2685
|
+
_keyPos = state.position;
|
|
2686
|
+
if (!composeNode(state, flowIndent, CONTEXT_FLOW_OUT, false, true)) {
|
|
2687
|
+
break;
|
|
2688
|
+
}
|
|
2689
|
+
if (state.line === _line) {
|
|
2690
|
+
ch = state.input.charCodeAt(state.position);
|
|
2691
|
+
while (is_WHITE_SPACE(ch)) {
|
|
2692
|
+
ch = state.input.charCodeAt(++state.position);
|
|
2693
|
+
}
|
|
2694
|
+
if (ch === 58) {
|
|
2695
|
+
ch = state.input.charCodeAt(++state.position);
|
|
2696
|
+
if (!is_WS_OR_EOL(ch)) {
|
|
2697
|
+
throwError(state, "a whitespace character is expected after the key-value separator within a block mapping");
|
|
2698
|
+
}
|
|
2699
|
+
if (atExplicitKey) {
|
|
2700
|
+
storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos);
|
|
2701
|
+
keyTag = keyNode = valueNode = null;
|
|
2702
|
+
}
|
|
2703
|
+
detected = true;
|
|
2704
|
+
atExplicitKey = false;
|
|
2705
|
+
allowCompact = false;
|
|
2706
|
+
keyTag = state.tag;
|
|
2707
|
+
keyNode = state.result;
|
|
2708
|
+
} else if (detected) {
|
|
2709
|
+
throwError(state, "can not read an implicit mapping pair; a colon is missed");
|
|
2710
|
+
} else {
|
|
2711
|
+
state.tag = _tag;
|
|
2712
|
+
state.anchor = _anchor;
|
|
2713
|
+
return true;
|
|
2714
|
+
}
|
|
2715
|
+
} else if (detected) {
|
|
2716
|
+
throwError(state, "can not read a block mapping entry; a multiline key may not be an implicit key");
|
|
2717
|
+
} else {
|
|
2718
|
+
state.tag = _tag;
|
|
2719
|
+
state.anchor = _anchor;
|
|
2720
|
+
return true;
|
|
2721
|
+
}
|
|
2722
|
+
}
|
|
2723
|
+
if (state.line === _line || state.lineIndent > nodeIndent) {
|
|
2724
|
+
if (atExplicitKey) {
|
|
2725
|
+
_keyLine = state.line;
|
|
2726
|
+
_keyLineStart = state.lineStart;
|
|
2727
|
+
_keyPos = state.position;
|
|
2728
|
+
}
|
|
2729
|
+
if (composeNode(state, nodeIndent, CONTEXT_BLOCK_OUT, true, allowCompact)) {
|
|
2730
|
+
if (atExplicitKey) {
|
|
2731
|
+
keyNode = state.result;
|
|
2732
|
+
} else {
|
|
2733
|
+
valueNode = state.result;
|
|
2734
|
+
}
|
|
2735
|
+
}
|
|
2736
|
+
if (!atExplicitKey) {
|
|
2737
|
+
storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _keyLine, _keyLineStart, _keyPos);
|
|
2738
|
+
keyTag = keyNode = valueNode = null;
|
|
2739
|
+
}
|
|
2740
|
+
skipSeparationSpace(state, true, -1);
|
|
2741
|
+
ch = state.input.charCodeAt(state.position);
|
|
2742
|
+
}
|
|
2743
|
+
if ((state.line === _line || state.lineIndent > nodeIndent) && ch !== 0) {
|
|
2744
|
+
throwError(state, "bad indentation of a mapping entry");
|
|
2745
|
+
} else if (state.lineIndent < nodeIndent) {
|
|
2746
|
+
break;
|
|
2747
|
+
}
|
|
2748
|
+
}
|
|
2749
|
+
if (atExplicitKey) {
|
|
2750
|
+
storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos);
|
|
2751
|
+
}
|
|
2752
|
+
if (detected) {
|
|
2753
|
+
state.tag = _tag;
|
|
2754
|
+
state.anchor = _anchor;
|
|
2755
|
+
state.kind = "mapping";
|
|
2756
|
+
state.result = _result;
|
|
2757
|
+
}
|
|
2758
|
+
return detected;
|
|
2759
|
+
}
|
|
2760
|
+
function readTagProperty(state) {
|
|
2761
|
+
var _position, isVerbatim = false, isNamed = false, tagHandle, tagName, ch;
|
|
2762
|
+
ch = state.input.charCodeAt(state.position);
|
|
2763
|
+
if (ch !== 33) return false;
|
|
2764
|
+
if (state.tag !== null) {
|
|
2765
|
+
throwError(state, "duplication of a tag property");
|
|
2766
|
+
}
|
|
2767
|
+
ch = state.input.charCodeAt(++state.position);
|
|
2768
|
+
if (ch === 60) {
|
|
2769
|
+
isVerbatim = true;
|
|
2770
|
+
ch = state.input.charCodeAt(++state.position);
|
|
2771
|
+
} else if (ch === 33) {
|
|
2772
|
+
isNamed = true;
|
|
2773
|
+
tagHandle = "!!";
|
|
2774
|
+
ch = state.input.charCodeAt(++state.position);
|
|
2775
|
+
} else {
|
|
2776
|
+
tagHandle = "!";
|
|
2777
|
+
}
|
|
2778
|
+
_position = state.position;
|
|
2779
|
+
if (isVerbatim) {
|
|
2780
|
+
do {
|
|
2781
|
+
ch = state.input.charCodeAt(++state.position);
|
|
2782
|
+
} while (ch !== 0 && ch !== 62);
|
|
2783
|
+
if (state.position < state.length) {
|
|
2784
|
+
tagName = state.input.slice(_position, state.position);
|
|
2785
|
+
ch = state.input.charCodeAt(++state.position);
|
|
2786
|
+
} else {
|
|
2787
|
+
throwError(state, "unexpected end of the stream within a verbatim tag");
|
|
2788
|
+
}
|
|
2789
|
+
} else {
|
|
2790
|
+
while (ch !== 0 && !is_WS_OR_EOL(ch)) {
|
|
2791
|
+
if (ch === 33) {
|
|
2792
|
+
if (!isNamed) {
|
|
2793
|
+
tagHandle = state.input.slice(_position - 1, state.position + 1);
|
|
2794
|
+
if (!PATTERN_TAG_HANDLE.test(tagHandle)) {
|
|
2795
|
+
throwError(state, "named tag handle cannot contain such characters");
|
|
2796
|
+
}
|
|
2797
|
+
isNamed = true;
|
|
2798
|
+
_position = state.position + 1;
|
|
2799
|
+
} else {
|
|
2800
|
+
throwError(state, "tag suffix cannot contain exclamation marks");
|
|
2801
|
+
}
|
|
2802
|
+
}
|
|
2803
|
+
ch = state.input.charCodeAt(++state.position);
|
|
2804
|
+
}
|
|
2805
|
+
tagName = state.input.slice(_position, state.position);
|
|
2806
|
+
if (PATTERN_FLOW_INDICATORS.test(tagName)) {
|
|
2807
|
+
throwError(state, "tag suffix cannot contain flow indicator characters");
|
|
2808
|
+
}
|
|
2809
|
+
}
|
|
2810
|
+
if (tagName && !PATTERN_TAG_URI.test(tagName)) {
|
|
2811
|
+
throwError(state, "tag name cannot contain such characters: " + tagName);
|
|
2812
|
+
}
|
|
2813
|
+
try {
|
|
2814
|
+
tagName = decodeURIComponent(tagName);
|
|
2815
|
+
} catch (err) {
|
|
2816
|
+
throwError(state, "tag name is malformed: " + tagName);
|
|
2817
|
+
}
|
|
2818
|
+
if (isVerbatim) {
|
|
2819
|
+
state.tag = tagName;
|
|
2820
|
+
} else if (_hasOwnProperty.call(state.tagMap, tagHandle)) {
|
|
2821
|
+
state.tag = state.tagMap[tagHandle] + tagName;
|
|
2822
|
+
} else if (tagHandle === "!") {
|
|
2823
|
+
state.tag = "!" + tagName;
|
|
2824
|
+
} else if (tagHandle === "!!") {
|
|
2825
|
+
state.tag = "tag:yaml.org,2002:" + tagName;
|
|
2826
|
+
} else {
|
|
2827
|
+
throwError(state, 'undeclared tag handle "' + tagHandle + '"');
|
|
2828
|
+
}
|
|
2829
|
+
return true;
|
|
2830
|
+
}
|
|
2831
|
+
function readAnchorProperty(state) {
|
|
2832
|
+
var _position, ch;
|
|
2833
|
+
ch = state.input.charCodeAt(state.position);
|
|
2834
|
+
if (ch !== 38) return false;
|
|
2835
|
+
if (state.anchor !== null) {
|
|
2836
|
+
throwError(state, "duplication of an anchor property");
|
|
2837
|
+
}
|
|
2838
|
+
ch = state.input.charCodeAt(++state.position);
|
|
2839
|
+
_position = state.position;
|
|
2840
|
+
while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) {
|
|
2841
|
+
ch = state.input.charCodeAt(++state.position);
|
|
2842
|
+
}
|
|
2843
|
+
if (state.position === _position) {
|
|
2844
|
+
throwError(state, "name of an anchor node must contain at least one character");
|
|
2845
|
+
}
|
|
2846
|
+
state.anchor = state.input.slice(_position, state.position);
|
|
2847
|
+
return true;
|
|
2848
|
+
}
|
|
2849
|
+
function readAlias(state) {
|
|
2850
|
+
var _position, alias, ch;
|
|
2851
|
+
ch = state.input.charCodeAt(state.position);
|
|
2852
|
+
if (ch !== 42) return false;
|
|
2853
|
+
ch = state.input.charCodeAt(++state.position);
|
|
2854
|
+
_position = state.position;
|
|
2855
|
+
while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) {
|
|
2856
|
+
ch = state.input.charCodeAt(++state.position);
|
|
2857
|
+
}
|
|
2858
|
+
if (state.position === _position) {
|
|
2859
|
+
throwError(state, "name of an alias node must contain at least one character");
|
|
2860
|
+
}
|
|
2861
|
+
alias = state.input.slice(_position, state.position);
|
|
2862
|
+
if (!_hasOwnProperty.call(state.anchorMap, alias)) {
|
|
2863
|
+
throwError(state, 'unidentified alias "' + alias + '"');
|
|
2864
|
+
}
|
|
2865
|
+
state.result = state.anchorMap[alias];
|
|
2866
|
+
skipSeparationSpace(state, true, -1);
|
|
2867
|
+
return true;
|
|
2868
|
+
}
|
|
2869
|
+
function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact) {
|
|
2870
|
+
var allowBlockStyles, allowBlockScalars, allowBlockCollections, indentStatus = 1, atNewLine = false, hasContent = false, typeIndex, typeQuantity, typeList, type, flowIndent, blockIndent;
|
|
2871
|
+
if (state.listener !== null) {
|
|
2872
|
+
state.listener("open", state);
|
|
2873
|
+
}
|
|
2874
|
+
state.tag = null;
|
|
2875
|
+
state.anchor = null;
|
|
2876
|
+
state.kind = null;
|
|
2877
|
+
state.result = null;
|
|
2878
|
+
allowBlockStyles = allowBlockScalars = allowBlockCollections = CONTEXT_BLOCK_OUT === nodeContext || CONTEXT_BLOCK_IN === nodeContext;
|
|
2879
|
+
if (allowToSeek) {
|
|
2880
|
+
if (skipSeparationSpace(state, true, -1)) {
|
|
2881
|
+
atNewLine = true;
|
|
2882
|
+
if (state.lineIndent > parentIndent) {
|
|
2883
|
+
indentStatus = 1;
|
|
2884
|
+
} else if (state.lineIndent === parentIndent) {
|
|
2885
|
+
indentStatus = 0;
|
|
2886
|
+
} else if (state.lineIndent < parentIndent) {
|
|
2887
|
+
indentStatus = -1;
|
|
2888
|
+
}
|
|
2889
|
+
}
|
|
2890
|
+
}
|
|
2891
|
+
if (indentStatus === 1) {
|
|
2892
|
+
while (readTagProperty(state) || readAnchorProperty(state)) {
|
|
2893
|
+
if (skipSeparationSpace(state, true, -1)) {
|
|
2894
|
+
atNewLine = true;
|
|
2895
|
+
allowBlockCollections = allowBlockStyles;
|
|
2896
|
+
if (state.lineIndent > parentIndent) {
|
|
2897
|
+
indentStatus = 1;
|
|
2898
|
+
} else if (state.lineIndent === parentIndent) {
|
|
2899
|
+
indentStatus = 0;
|
|
2900
|
+
} else if (state.lineIndent < parentIndent) {
|
|
2901
|
+
indentStatus = -1;
|
|
2902
|
+
}
|
|
2903
|
+
} else {
|
|
2904
|
+
allowBlockCollections = false;
|
|
2905
|
+
}
|
|
2906
|
+
}
|
|
2907
|
+
}
|
|
2908
|
+
if (allowBlockCollections) {
|
|
2909
|
+
allowBlockCollections = atNewLine || allowCompact;
|
|
2910
|
+
}
|
|
2911
|
+
if (indentStatus === 1 || CONTEXT_BLOCK_OUT === nodeContext) {
|
|
2912
|
+
if (CONTEXT_FLOW_IN === nodeContext || CONTEXT_FLOW_OUT === nodeContext) {
|
|
2913
|
+
flowIndent = parentIndent;
|
|
2914
|
+
} else {
|
|
2915
|
+
flowIndent = parentIndent + 1;
|
|
2916
|
+
}
|
|
2917
|
+
blockIndent = state.position - state.lineStart;
|
|
2918
|
+
if (indentStatus === 1) {
|
|
2919
|
+
if (allowBlockCollections && (readBlockSequence(state, blockIndent) || readBlockMapping(state, blockIndent, flowIndent)) || readFlowCollection(state, flowIndent)) {
|
|
2920
|
+
hasContent = true;
|
|
2921
|
+
} else {
|
|
2922
|
+
if (allowBlockScalars && readBlockScalar(state, flowIndent) || readSingleQuotedScalar(state, flowIndent) || readDoubleQuotedScalar(state, flowIndent)) {
|
|
2923
|
+
hasContent = true;
|
|
2924
|
+
} else if (readAlias(state)) {
|
|
2925
|
+
hasContent = true;
|
|
2926
|
+
if (state.tag !== null || state.anchor !== null) {
|
|
2927
|
+
throwError(state, "alias node should not have any properties");
|
|
2928
|
+
}
|
|
2929
|
+
} else if (readPlainScalar(state, flowIndent, CONTEXT_FLOW_IN === nodeContext)) {
|
|
2930
|
+
hasContent = true;
|
|
2931
|
+
if (state.tag === null) {
|
|
2932
|
+
state.tag = "?";
|
|
2933
|
+
}
|
|
2934
|
+
}
|
|
2935
|
+
if (state.anchor !== null) {
|
|
2936
|
+
state.anchorMap[state.anchor] = state.result;
|
|
2937
|
+
}
|
|
2938
|
+
}
|
|
2939
|
+
} else if (indentStatus === 0) {
|
|
2940
|
+
hasContent = allowBlockCollections && readBlockSequence(state, blockIndent);
|
|
2941
|
+
}
|
|
2942
|
+
}
|
|
2943
|
+
if (state.tag === null) {
|
|
2944
|
+
if (state.anchor !== null) {
|
|
2945
|
+
state.anchorMap[state.anchor] = state.result;
|
|
2946
|
+
}
|
|
2947
|
+
} else if (state.tag === "?") {
|
|
2948
|
+
if (state.result !== null && state.kind !== "scalar") {
|
|
2949
|
+
throwError(state, 'unacceptable node kind for !<?> tag; it should be "scalar", not "' + state.kind + '"');
|
|
2950
|
+
}
|
|
2951
|
+
for (typeIndex = 0, typeQuantity = state.implicitTypes.length; typeIndex < typeQuantity; typeIndex += 1) {
|
|
2952
|
+
type = state.implicitTypes[typeIndex];
|
|
2953
|
+
if (type.resolve(state.result)) {
|
|
2954
|
+
state.result = type.construct(state.result);
|
|
2955
|
+
state.tag = type.tag;
|
|
2956
|
+
if (state.anchor !== null) {
|
|
2957
|
+
state.anchorMap[state.anchor] = state.result;
|
|
2958
|
+
}
|
|
2959
|
+
break;
|
|
2960
|
+
}
|
|
2961
|
+
}
|
|
2962
|
+
} else if (state.tag !== "!") {
|
|
2963
|
+
if (_hasOwnProperty.call(state.typeMap[state.kind || "fallback"], state.tag)) {
|
|
2964
|
+
type = state.typeMap[state.kind || "fallback"][state.tag];
|
|
2965
|
+
} else {
|
|
2966
|
+
type = null;
|
|
2967
|
+
typeList = state.typeMap.multi[state.kind || "fallback"];
|
|
2968
|
+
for (typeIndex = 0, typeQuantity = typeList.length; typeIndex < typeQuantity; typeIndex += 1) {
|
|
2969
|
+
if (state.tag.slice(0, typeList[typeIndex].tag.length) === typeList[typeIndex].tag) {
|
|
2970
|
+
type = typeList[typeIndex];
|
|
2971
|
+
break;
|
|
2972
|
+
}
|
|
2973
|
+
}
|
|
2974
|
+
}
|
|
2975
|
+
if (!type) {
|
|
2976
|
+
throwError(state, "unknown tag !<" + state.tag + ">");
|
|
2977
|
+
}
|
|
2978
|
+
if (state.result !== null && type.kind !== state.kind) {
|
|
2979
|
+
throwError(state, "unacceptable node kind for !<" + state.tag + '> tag; it should be "' + type.kind + '", not "' + state.kind + '"');
|
|
2980
|
+
}
|
|
2981
|
+
if (!type.resolve(state.result, state.tag)) {
|
|
2982
|
+
throwError(state, "cannot resolve a node with !<" + state.tag + "> explicit tag");
|
|
2983
|
+
} else {
|
|
2984
|
+
state.result = type.construct(state.result, state.tag);
|
|
2985
|
+
if (state.anchor !== null) {
|
|
2986
|
+
state.anchorMap[state.anchor] = state.result;
|
|
2987
|
+
}
|
|
2988
|
+
}
|
|
2989
|
+
}
|
|
2990
|
+
if (state.listener !== null) {
|
|
2991
|
+
state.listener("close", state);
|
|
2992
|
+
}
|
|
2993
|
+
return state.tag !== null || state.anchor !== null || hasContent;
|
|
2994
|
+
}
|
|
2995
|
+
function readDocument(state) {
|
|
2996
|
+
var documentStart = state.position, _position, directiveName, directiveArgs, hasDirectives = false, ch;
|
|
2997
|
+
state.version = null;
|
|
2998
|
+
state.checkLineBreaks = state.legacy;
|
|
2999
|
+
state.tagMap = /* @__PURE__ */ Object.create(null);
|
|
3000
|
+
state.anchorMap = /* @__PURE__ */ Object.create(null);
|
|
3001
|
+
while ((ch = state.input.charCodeAt(state.position)) !== 0) {
|
|
3002
|
+
skipSeparationSpace(state, true, -1);
|
|
3003
|
+
ch = state.input.charCodeAt(state.position);
|
|
3004
|
+
if (state.lineIndent > 0 || ch !== 37) {
|
|
3005
|
+
break;
|
|
3006
|
+
}
|
|
3007
|
+
hasDirectives = true;
|
|
3008
|
+
ch = state.input.charCodeAt(++state.position);
|
|
3009
|
+
_position = state.position;
|
|
3010
|
+
while (ch !== 0 && !is_WS_OR_EOL(ch)) {
|
|
3011
|
+
ch = state.input.charCodeAt(++state.position);
|
|
3012
|
+
}
|
|
3013
|
+
directiveName = state.input.slice(_position, state.position);
|
|
3014
|
+
directiveArgs = [];
|
|
3015
|
+
if (directiveName.length < 1) {
|
|
3016
|
+
throwError(state, "directive name must not be less than one character in length");
|
|
3017
|
+
}
|
|
3018
|
+
while (ch !== 0) {
|
|
3019
|
+
while (is_WHITE_SPACE(ch)) {
|
|
3020
|
+
ch = state.input.charCodeAt(++state.position);
|
|
3021
|
+
}
|
|
3022
|
+
if (ch === 35) {
|
|
3023
|
+
do {
|
|
3024
|
+
ch = state.input.charCodeAt(++state.position);
|
|
3025
|
+
} while (ch !== 0 && !is_EOL(ch));
|
|
3026
|
+
break;
|
|
3027
|
+
}
|
|
3028
|
+
if (is_EOL(ch)) break;
|
|
3029
|
+
_position = state.position;
|
|
3030
|
+
while (ch !== 0 && !is_WS_OR_EOL(ch)) {
|
|
3031
|
+
ch = state.input.charCodeAt(++state.position);
|
|
3032
|
+
}
|
|
3033
|
+
directiveArgs.push(state.input.slice(_position, state.position));
|
|
3034
|
+
}
|
|
3035
|
+
if (ch !== 0) readLineBreak(state);
|
|
3036
|
+
if (_hasOwnProperty.call(directiveHandlers, directiveName)) {
|
|
3037
|
+
directiveHandlers[directiveName](state, directiveName, directiveArgs);
|
|
3038
|
+
} else {
|
|
3039
|
+
throwWarning(state, 'unknown document directive "' + directiveName + '"');
|
|
3040
|
+
}
|
|
3041
|
+
}
|
|
3042
|
+
skipSeparationSpace(state, true, -1);
|
|
3043
|
+
if (state.lineIndent === 0 && state.input.charCodeAt(state.position) === 45 && state.input.charCodeAt(state.position + 1) === 45 && state.input.charCodeAt(state.position + 2) === 45) {
|
|
3044
|
+
state.position += 3;
|
|
3045
|
+
skipSeparationSpace(state, true, -1);
|
|
3046
|
+
} else if (hasDirectives) {
|
|
3047
|
+
throwError(state, "directives end mark is expected");
|
|
3048
|
+
}
|
|
3049
|
+
composeNode(state, state.lineIndent - 1, CONTEXT_BLOCK_OUT, false, true);
|
|
3050
|
+
skipSeparationSpace(state, true, -1);
|
|
3051
|
+
if (state.checkLineBreaks && PATTERN_NON_ASCII_LINE_BREAKS.test(state.input.slice(documentStart, state.position))) {
|
|
3052
|
+
throwWarning(state, "non-ASCII line breaks are interpreted as content");
|
|
3053
|
+
}
|
|
3054
|
+
state.documents.push(state.result);
|
|
3055
|
+
if (state.position === state.lineStart && testDocumentSeparator(state)) {
|
|
3056
|
+
if (state.input.charCodeAt(state.position) === 46) {
|
|
3057
|
+
state.position += 3;
|
|
3058
|
+
skipSeparationSpace(state, true, -1);
|
|
3059
|
+
}
|
|
3060
|
+
return;
|
|
3061
|
+
}
|
|
3062
|
+
if (state.position < state.length - 1) {
|
|
3063
|
+
throwError(state, "end of the stream or a document separator is expected");
|
|
3064
|
+
} else {
|
|
3065
|
+
return;
|
|
3066
|
+
}
|
|
3067
|
+
}
|
|
3068
|
+
function loadDocuments(input, options) {
|
|
3069
|
+
input = String(input);
|
|
3070
|
+
options = options || {};
|
|
3071
|
+
if (input.length !== 0) {
|
|
3072
|
+
if (input.charCodeAt(input.length - 1) !== 10 && input.charCodeAt(input.length - 1) !== 13) {
|
|
3073
|
+
input += "\n";
|
|
3074
|
+
}
|
|
3075
|
+
if (input.charCodeAt(0) === 65279) {
|
|
3076
|
+
input = input.slice(1);
|
|
3077
|
+
}
|
|
3078
|
+
}
|
|
3079
|
+
var state = new State(input, options);
|
|
3080
|
+
var nullpos = input.indexOf("\0");
|
|
3081
|
+
if (nullpos !== -1) {
|
|
3082
|
+
state.position = nullpos;
|
|
3083
|
+
throwError(state, "null byte is not allowed in input");
|
|
3084
|
+
}
|
|
3085
|
+
state.input += "\0";
|
|
3086
|
+
while (state.input.charCodeAt(state.position) === 32) {
|
|
3087
|
+
state.lineIndent += 1;
|
|
3088
|
+
state.position += 1;
|
|
3089
|
+
}
|
|
3090
|
+
while (state.position < state.length - 1) {
|
|
3091
|
+
readDocument(state);
|
|
3092
|
+
}
|
|
3093
|
+
return state.documents;
|
|
3094
|
+
}
|
|
3095
|
+
function loadAll(input, iterator, options) {
|
|
3096
|
+
if (iterator !== null && typeof iterator === "object" && typeof options === "undefined") {
|
|
3097
|
+
options = iterator;
|
|
3098
|
+
iterator = null;
|
|
3099
|
+
}
|
|
3100
|
+
var documents = loadDocuments(input, options);
|
|
3101
|
+
if (typeof iterator !== "function") {
|
|
3102
|
+
return documents;
|
|
3103
|
+
}
|
|
3104
|
+
for (var index = 0, length = documents.length; index < length; index += 1) {
|
|
3105
|
+
iterator(documents[index]);
|
|
3106
|
+
}
|
|
3107
|
+
}
|
|
3108
|
+
function load(input, options) {
|
|
3109
|
+
var documents = loadDocuments(input, options);
|
|
3110
|
+
if (documents.length === 0) {
|
|
3111
|
+
return void 0;
|
|
3112
|
+
} else if (documents.length === 1) {
|
|
3113
|
+
return documents[0];
|
|
3114
|
+
}
|
|
3115
|
+
throw new YAMLException("expected a single document in the stream, but found more");
|
|
3116
|
+
}
|
|
3117
|
+
module.exports.loadAll = loadAll;
|
|
3118
|
+
module.exports.load = load;
|
|
3119
|
+
}
|
|
3120
|
+
});
|
|
3121
|
+
|
|
3122
|
+
// node_modules/js-yaml/lib/dumper.js
|
|
3123
|
+
var require_dumper = __commonJS({
|
|
3124
|
+
"node_modules/js-yaml/lib/dumper.js"(exports, module) {
|
|
3125
|
+
"use strict";
|
|
3126
|
+
init_esm_shims();
|
|
3127
|
+
var common = require_common();
|
|
3128
|
+
var YAMLException = require_exception();
|
|
3129
|
+
var DEFAULT_SCHEMA = require_default();
|
|
3130
|
+
var _toString = Object.prototype.toString;
|
|
3131
|
+
var _hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
3132
|
+
var CHAR_BOM = 65279;
|
|
3133
|
+
var CHAR_TAB = 9;
|
|
3134
|
+
var CHAR_LINE_FEED = 10;
|
|
3135
|
+
var CHAR_CARRIAGE_RETURN = 13;
|
|
3136
|
+
var CHAR_SPACE = 32;
|
|
3137
|
+
var CHAR_EXCLAMATION = 33;
|
|
3138
|
+
var CHAR_DOUBLE_QUOTE = 34;
|
|
3139
|
+
var CHAR_SHARP = 35;
|
|
3140
|
+
var CHAR_PERCENT = 37;
|
|
3141
|
+
var CHAR_AMPERSAND = 38;
|
|
3142
|
+
var CHAR_SINGLE_QUOTE = 39;
|
|
3143
|
+
var CHAR_ASTERISK = 42;
|
|
3144
|
+
var CHAR_COMMA = 44;
|
|
3145
|
+
var CHAR_MINUS = 45;
|
|
3146
|
+
var CHAR_COLON = 58;
|
|
3147
|
+
var CHAR_EQUALS = 61;
|
|
3148
|
+
var CHAR_GREATER_THAN = 62;
|
|
3149
|
+
var CHAR_QUESTION = 63;
|
|
3150
|
+
var CHAR_COMMERCIAL_AT = 64;
|
|
3151
|
+
var CHAR_LEFT_SQUARE_BRACKET = 91;
|
|
3152
|
+
var CHAR_RIGHT_SQUARE_BRACKET = 93;
|
|
3153
|
+
var CHAR_GRAVE_ACCENT = 96;
|
|
3154
|
+
var CHAR_LEFT_CURLY_BRACKET = 123;
|
|
3155
|
+
var CHAR_VERTICAL_LINE = 124;
|
|
3156
|
+
var CHAR_RIGHT_CURLY_BRACKET = 125;
|
|
3157
|
+
var ESCAPE_SEQUENCES = {};
|
|
3158
|
+
ESCAPE_SEQUENCES[0] = "\\0";
|
|
3159
|
+
ESCAPE_SEQUENCES[7] = "\\a";
|
|
3160
|
+
ESCAPE_SEQUENCES[8] = "\\b";
|
|
3161
|
+
ESCAPE_SEQUENCES[9] = "\\t";
|
|
3162
|
+
ESCAPE_SEQUENCES[10] = "\\n";
|
|
3163
|
+
ESCAPE_SEQUENCES[11] = "\\v";
|
|
3164
|
+
ESCAPE_SEQUENCES[12] = "\\f";
|
|
3165
|
+
ESCAPE_SEQUENCES[13] = "\\r";
|
|
3166
|
+
ESCAPE_SEQUENCES[27] = "\\e";
|
|
3167
|
+
ESCAPE_SEQUENCES[34] = '\\"';
|
|
3168
|
+
ESCAPE_SEQUENCES[92] = "\\\\";
|
|
3169
|
+
ESCAPE_SEQUENCES[133] = "\\N";
|
|
3170
|
+
ESCAPE_SEQUENCES[160] = "\\_";
|
|
3171
|
+
ESCAPE_SEQUENCES[8232] = "\\L";
|
|
3172
|
+
ESCAPE_SEQUENCES[8233] = "\\P";
|
|
3173
|
+
var DEPRECATED_BOOLEANS_SYNTAX = [
|
|
3174
|
+
"y",
|
|
3175
|
+
"Y",
|
|
3176
|
+
"yes",
|
|
3177
|
+
"Yes",
|
|
3178
|
+
"YES",
|
|
3179
|
+
"on",
|
|
3180
|
+
"On",
|
|
3181
|
+
"ON",
|
|
3182
|
+
"n",
|
|
3183
|
+
"N",
|
|
3184
|
+
"no",
|
|
3185
|
+
"No",
|
|
3186
|
+
"NO",
|
|
3187
|
+
"off",
|
|
3188
|
+
"Off",
|
|
3189
|
+
"OFF"
|
|
3190
|
+
];
|
|
3191
|
+
var DEPRECATED_BASE60_SYNTAX = /^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;
|
|
3192
|
+
function compileStyleMap(schema, map) {
|
|
3193
|
+
var result, keys, index, length, tag, style, type;
|
|
3194
|
+
if (map === null) return {};
|
|
3195
|
+
result = {};
|
|
3196
|
+
keys = Object.keys(map);
|
|
3197
|
+
for (index = 0, length = keys.length; index < length; index += 1) {
|
|
3198
|
+
tag = keys[index];
|
|
3199
|
+
style = String(map[tag]);
|
|
3200
|
+
if (tag.slice(0, 2) === "!!") {
|
|
3201
|
+
tag = "tag:yaml.org,2002:" + tag.slice(2);
|
|
3202
|
+
}
|
|
3203
|
+
type = schema.compiledTypeMap["fallback"][tag];
|
|
3204
|
+
if (type && _hasOwnProperty.call(type.styleAliases, style)) {
|
|
3205
|
+
style = type.styleAliases[style];
|
|
3206
|
+
}
|
|
3207
|
+
result[tag] = style;
|
|
3208
|
+
}
|
|
3209
|
+
return result;
|
|
3210
|
+
}
|
|
3211
|
+
function encodeHex(character) {
|
|
3212
|
+
var string, handle, length;
|
|
3213
|
+
string = character.toString(16).toUpperCase();
|
|
3214
|
+
if (character <= 255) {
|
|
3215
|
+
handle = "x";
|
|
3216
|
+
length = 2;
|
|
3217
|
+
} else if (character <= 65535) {
|
|
3218
|
+
handle = "u";
|
|
3219
|
+
length = 4;
|
|
3220
|
+
} else if (character <= 4294967295) {
|
|
3221
|
+
handle = "U";
|
|
3222
|
+
length = 8;
|
|
3223
|
+
} else {
|
|
3224
|
+
throw new YAMLException("code point within a string may not be greater than 0xFFFFFFFF");
|
|
3225
|
+
}
|
|
3226
|
+
return "\\" + handle + common.repeat("0", length - string.length) + string;
|
|
3227
|
+
}
|
|
3228
|
+
var QUOTING_TYPE_SINGLE = 1;
|
|
3229
|
+
var QUOTING_TYPE_DOUBLE = 2;
|
|
3230
|
+
function State(options) {
|
|
3231
|
+
this.schema = options["schema"] || DEFAULT_SCHEMA;
|
|
3232
|
+
this.indent = Math.max(1, options["indent"] || 2);
|
|
3233
|
+
this.noArrayIndent = options["noArrayIndent"] || false;
|
|
3234
|
+
this.skipInvalid = options["skipInvalid"] || false;
|
|
3235
|
+
this.flowLevel = common.isNothing(options["flowLevel"]) ? -1 : options["flowLevel"];
|
|
3236
|
+
this.styleMap = compileStyleMap(this.schema, options["styles"] || null);
|
|
3237
|
+
this.sortKeys = options["sortKeys"] || false;
|
|
3238
|
+
this.lineWidth = options["lineWidth"] || 80;
|
|
3239
|
+
this.noRefs = options["noRefs"] || false;
|
|
3240
|
+
this.noCompatMode = options["noCompatMode"] || false;
|
|
3241
|
+
this.condenseFlow = options["condenseFlow"] || false;
|
|
3242
|
+
this.quotingType = options["quotingType"] === '"' ? QUOTING_TYPE_DOUBLE : QUOTING_TYPE_SINGLE;
|
|
3243
|
+
this.forceQuotes = options["forceQuotes"] || false;
|
|
3244
|
+
this.replacer = typeof options["replacer"] === "function" ? options["replacer"] : null;
|
|
3245
|
+
this.implicitTypes = this.schema.compiledImplicit;
|
|
3246
|
+
this.explicitTypes = this.schema.compiledExplicit;
|
|
3247
|
+
this.tag = null;
|
|
3248
|
+
this.result = "";
|
|
3249
|
+
this.duplicates = [];
|
|
3250
|
+
this.usedDuplicates = null;
|
|
3251
|
+
}
|
|
3252
|
+
function indentString(string, spaces) {
|
|
3253
|
+
var ind = common.repeat(" ", spaces), position = 0, next = -1, result = "", line, length = string.length;
|
|
3254
|
+
while (position < length) {
|
|
3255
|
+
next = string.indexOf("\n", position);
|
|
3256
|
+
if (next === -1) {
|
|
3257
|
+
line = string.slice(position);
|
|
3258
|
+
position = length;
|
|
3259
|
+
} else {
|
|
3260
|
+
line = string.slice(position, next + 1);
|
|
3261
|
+
position = next + 1;
|
|
3262
|
+
}
|
|
3263
|
+
if (line.length && line !== "\n") result += ind;
|
|
3264
|
+
result += line;
|
|
3265
|
+
}
|
|
3266
|
+
return result;
|
|
3267
|
+
}
|
|
3268
|
+
function generateNextLine(state, level) {
|
|
3269
|
+
return "\n" + common.repeat(" ", state.indent * level);
|
|
3270
|
+
}
|
|
3271
|
+
function testImplicitResolving(state, str) {
|
|
3272
|
+
var index, length, type;
|
|
3273
|
+
for (index = 0, length = state.implicitTypes.length; index < length; index += 1) {
|
|
3274
|
+
type = state.implicitTypes[index];
|
|
3275
|
+
if (type.resolve(str)) {
|
|
3276
|
+
return true;
|
|
3277
|
+
}
|
|
3278
|
+
}
|
|
3279
|
+
return false;
|
|
3280
|
+
}
|
|
3281
|
+
function isWhitespace(c) {
|
|
3282
|
+
return c === CHAR_SPACE || c === CHAR_TAB;
|
|
3283
|
+
}
|
|
3284
|
+
function isPrintable(c) {
|
|
3285
|
+
return 32 <= c && c <= 126 || 161 <= c && c <= 55295 && c !== 8232 && c !== 8233 || 57344 <= c && c <= 65533 && c !== CHAR_BOM || 65536 <= c && c <= 1114111;
|
|
3286
|
+
}
|
|
3287
|
+
function isNsCharOrWhitespace(c) {
|
|
3288
|
+
return isPrintable(c) && c !== CHAR_BOM && c !== CHAR_CARRIAGE_RETURN && c !== CHAR_LINE_FEED;
|
|
3289
|
+
}
|
|
3290
|
+
function isPlainSafe(c, prev, inblock) {
|
|
3291
|
+
var cIsNsCharOrWhitespace = isNsCharOrWhitespace(c);
|
|
3292
|
+
var cIsNsChar = cIsNsCharOrWhitespace && !isWhitespace(c);
|
|
3293
|
+
return (
|
|
3294
|
+
// ns-plain-safe
|
|
3295
|
+
(inblock ? (
|
|
3296
|
+
// c = flow-in
|
|
3297
|
+
cIsNsCharOrWhitespace
|
|
3298
|
+
) : 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
|
|
3299
|
+
);
|
|
3300
|
+
}
|
|
3301
|
+
function isPlainSafeFirst(c) {
|
|
3302
|
+
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;
|
|
3303
|
+
}
|
|
3304
|
+
function isPlainSafeLast(c) {
|
|
3305
|
+
return !isWhitespace(c) && c !== CHAR_COLON;
|
|
3306
|
+
}
|
|
3307
|
+
function codePointAt(string, pos) {
|
|
3308
|
+
var first = string.charCodeAt(pos), second;
|
|
3309
|
+
if (first >= 55296 && first <= 56319 && pos + 1 < string.length) {
|
|
3310
|
+
second = string.charCodeAt(pos + 1);
|
|
3311
|
+
if (second >= 56320 && second <= 57343) {
|
|
3312
|
+
return (first - 55296) * 1024 + second - 56320 + 65536;
|
|
3313
|
+
}
|
|
3314
|
+
}
|
|
3315
|
+
return first;
|
|
3316
|
+
}
|
|
3317
|
+
function needIndentIndicator(string) {
|
|
3318
|
+
var leadingSpaceRe = /^\n* /;
|
|
3319
|
+
return leadingSpaceRe.test(string);
|
|
3320
|
+
}
|
|
3321
|
+
var STYLE_PLAIN = 1;
|
|
3322
|
+
var STYLE_SINGLE = 2;
|
|
3323
|
+
var STYLE_LITERAL = 3;
|
|
3324
|
+
var STYLE_FOLDED = 4;
|
|
3325
|
+
var STYLE_DOUBLE = 5;
|
|
3326
|
+
function chooseScalarStyle(string, singleLineOnly, indentPerLevel, lineWidth, testAmbiguousType, quotingType, forceQuotes, inblock) {
|
|
3327
|
+
var i;
|
|
3328
|
+
var char = 0;
|
|
3329
|
+
var prevChar = null;
|
|
3330
|
+
var hasLineBreak = false;
|
|
3331
|
+
var hasFoldableLine = false;
|
|
3332
|
+
var shouldTrackWidth = lineWidth !== -1;
|
|
3333
|
+
var previousLineBreak = -1;
|
|
3334
|
+
var plain = isPlainSafeFirst(codePointAt(string, 0)) && isPlainSafeLast(codePointAt(string, string.length - 1));
|
|
3335
|
+
if (singleLineOnly || forceQuotes) {
|
|
3336
|
+
for (i = 0; i < string.length; char >= 65536 ? i += 2 : i++) {
|
|
3337
|
+
char = codePointAt(string, i);
|
|
3338
|
+
if (!isPrintable(char)) {
|
|
3339
|
+
return STYLE_DOUBLE;
|
|
3340
|
+
}
|
|
3341
|
+
plain = plain && isPlainSafe(char, prevChar, inblock);
|
|
3342
|
+
prevChar = char;
|
|
3343
|
+
}
|
|
3344
|
+
} else {
|
|
3345
|
+
for (i = 0; i < string.length; char >= 65536 ? i += 2 : i++) {
|
|
3346
|
+
char = codePointAt(string, i);
|
|
3347
|
+
if (char === CHAR_LINE_FEED) {
|
|
3348
|
+
hasLineBreak = true;
|
|
3349
|
+
if (shouldTrackWidth) {
|
|
3350
|
+
hasFoldableLine = hasFoldableLine || // Foldable line = too long, and not more-indented.
|
|
3351
|
+
i - previousLineBreak - 1 > lineWidth && string[previousLineBreak + 1] !== " ";
|
|
3352
|
+
previousLineBreak = i;
|
|
3353
|
+
}
|
|
3354
|
+
} else if (!isPrintable(char)) {
|
|
3355
|
+
return STYLE_DOUBLE;
|
|
3356
|
+
}
|
|
3357
|
+
plain = plain && isPlainSafe(char, prevChar, inblock);
|
|
3358
|
+
prevChar = char;
|
|
3359
|
+
}
|
|
3360
|
+
hasFoldableLine = hasFoldableLine || shouldTrackWidth && (i - previousLineBreak - 1 > lineWidth && string[previousLineBreak + 1] !== " ");
|
|
3361
|
+
}
|
|
3362
|
+
if (!hasLineBreak && !hasFoldableLine) {
|
|
3363
|
+
if (plain && !forceQuotes && !testAmbiguousType(string)) {
|
|
3364
|
+
return STYLE_PLAIN;
|
|
3365
|
+
}
|
|
3366
|
+
return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : STYLE_SINGLE;
|
|
3367
|
+
}
|
|
3368
|
+
if (indentPerLevel > 9 && needIndentIndicator(string)) {
|
|
3369
|
+
return STYLE_DOUBLE;
|
|
3370
|
+
}
|
|
3371
|
+
if (!forceQuotes) {
|
|
3372
|
+
return hasFoldableLine ? STYLE_FOLDED : STYLE_LITERAL;
|
|
3373
|
+
}
|
|
3374
|
+
return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : STYLE_SINGLE;
|
|
3375
|
+
}
|
|
3376
|
+
function writeScalar(state, string, level, iskey, inblock) {
|
|
3377
|
+
state.dump = (function() {
|
|
3378
|
+
if (string.length === 0) {
|
|
3379
|
+
return state.quotingType === QUOTING_TYPE_DOUBLE ? '""' : "''";
|
|
3380
|
+
}
|
|
3381
|
+
if (!state.noCompatMode) {
|
|
3382
|
+
if (DEPRECATED_BOOLEANS_SYNTAX.indexOf(string) !== -1 || DEPRECATED_BASE60_SYNTAX.test(string)) {
|
|
3383
|
+
return state.quotingType === QUOTING_TYPE_DOUBLE ? '"' + string + '"' : "'" + string + "'";
|
|
3384
|
+
}
|
|
3385
|
+
}
|
|
3386
|
+
var indent = state.indent * Math.max(1, level);
|
|
3387
|
+
var lineWidth = state.lineWidth === -1 ? -1 : Math.max(Math.min(state.lineWidth, 40), state.lineWidth - indent);
|
|
3388
|
+
var singleLineOnly = iskey || state.flowLevel > -1 && level >= state.flowLevel;
|
|
3389
|
+
function testAmbiguity(string2) {
|
|
3390
|
+
return testImplicitResolving(state, string2);
|
|
3391
|
+
}
|
|
3392
|
+
switch (chooseScalarStyle(
|
|
3393
|
+
string,
|
|
3394
|
+
singleLineOnly,
|
|
3395
|
+
state.indent,
|
|
3396
|
+
lineWidth,
|
|
3397
|
+
testAmbiguity,
|
|
3398
|
+
state.quotingType,
|
|
3399
|
+
state.forceQuotes && !iskey,
|
|
3400
|
+
inblock
|
|
3401
|
+
)) {
|
|
3402
|
+
case STYLE_PLAIN:
|
|
3403
|
+
return string;
|
|
3404
|
+
case STYLE_SINGLE:
|
|
3405
|
+
return "'" + string.replace(/'/g, "''") + "'";
|
|
3406
|
+
case STYLE_LITERAL:
|
|
3407
|
+
return "|" + blockHeader(string, state.indent) + dropEndingNewline(indentString(string, indent));
|
|
3408
|
+
case STYLE_FOLDED:
|
|
3409
|
+
return ">" + blockHeader(string, state.indent) + dropEndingNewline(indentString(foldString(string, lineWidth), indent));
|
|
3410
|
+
case STYLE_DOUBLE:
|
|
3411
|
+
return '"' + escapeString(string, lineWidth) + '"';
|
|
3412
|
+
default:
|
|
3413
|
+
throw new YAMLException("impossible error: invalid scalar style");
|
|
3414
|
+
}
|
|
3415
|
+
})();
|
|
3416
|
+
}
|
|
3417
|
+
function blockHeader(string, indentPerLevel) {
|
|
3418
|
+
var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : "";
|
|
3419
|
+
var clip = string[string.length - 1] === "\n";
|
|
3420
|
+
var keep = clip && (string[string.length - 2] === "\n" || string === "\n");
|
|
3421
|
+
var chomp = keep ? "+" : clip ? "" : "-";
|
|
3422
|
+
return indentIndicator + chomp + "\n";
|
|
3423
|
+
}
|
|
3424
|
+
function dropEndingNewline(string) {
|
|
3425
|
+
return string[string.length - 1] === "\n" ? string.slice(0, -1) : string;
|
|
3426
|
+
}
|
|
3427
|
+
function foldString(string, width) {
|
|
3428
|
+
var lineRe = /(\n+)([^\n]*)/g;
|
|
3429
|
+
var result = (function() {
|
|
3430
|
+
var nextLF = string.indexOf("\n");
|
|
3431
|
+
nextLF = nextLF !== -1 ? nextLF : string.length;
|
|
3432
|
+
lineRe.lastIndex = nextLF;
|
|
3433
|
+
return foldLine(string.slice(0, nextLF), width);
|
|
3434
|
+
})();
|
|
3435
|
+
var prevMoreIndented = string[0] === "\n" || string[0] === " ";
|
|
3436
|
+
var moreIndented;
|
|
3437
|
+
var match;
|
|
3438
|
+
while (match = lineRe.exec(string)) {
|
|
3439
|
+
var prefix = match[1], line = match[2];
|
|
3440
|
+
moreIndented = line[0] === " ";
|
|
3441
|
+
result += prefix + (!prevMoreIndented && !moreIndented && line !== "" ? "\n" : "") + foldLine(line, width);
|
|
3442
|
+
prevMoreIndented = moreIndented;
|
|
3443
|
+
}
|
|
3444
|
+
return result;
|
|
3445
|
+
}
|
|
3446
|
+
function foldLine(line, width) {
|
|
3447
|
+
if (line === "" || line[0] === " ") return line;
|
|
3448
|
+
var breakRe = / [^ ]/g;
|
|
3449
|
+
var match;
|
|
3450
|
+
var start = 0, end, curr = 0, next = 0;
|
|
3451
|
+
var result = "";
|
|
3452
|
+
while (match = breakRe.exec(line)) {
|
|
3453
|
+
next = match.index;
|
|
3454
|
+
if (next - start > width) {
|
|
3455
|
+
end = curr > start ? curr : next;
|
|
3456
|
+
result += "\n" + line.slice(start, end);
|
|
3457
|
+
start = end + 1;
|
|
3458
|
+
}
|
|
3459
|
+
curr = next;
|
|
3460
|
+
}
|
|
3461
|
+
result += "\n";
|
|
3462
|
+
if (line.length - start > width && curr > start) {
|
|
3463
|
+
result += line.slice(start, curr) + "\n" + line.slice(curr + 1);
|
|
3464
|
+
} else {
|
|
3465
|
+
result += line.slice(start);
|
|
3466
|
+
}
|
|
3467
|
+
return result.slice(1);
|
|
3468
|
+
}
|
|
3469
|
+
function escapeString(string) {
|
|
3470
|
+
var result = "";
|
|
3471
|
+
var char = 0;
|
|
3472
|
+
var escapeSeq;
|
|
3473
|
+
for (var i = 0; i < string.length; char >= 65536 ? i += 2 : i++) {
|
|
3474
|
+
char = codePointAt(string, i);
|
|
3475
|
+
escapeSeq = ESCAPE_SEQUENCES[char];
|
|
3476
|
+
if (!escapeSeq && isPrintable(char)) {
|
|
3477
|
+
result += string[i];
|
|
3478
|
+
if (char >= 65536) result += string[i + 1];
|
|
3479
|
+
} else {
|
|
3480
|
+
result += escapeSeq || encodeHex(char);
|
|
3481
|
+
}
|
|
3482
|
+
}
|
|
3483
|
+
return result;
|
|
3484
|
+
}
|
|
3485
|
+
function writeFlowSequence(state, level, object) {
|
|
3486
|
+
var _result = "", _tag = state.tag, index, length, value;
|
|
3487
|
+
for (index = 0, length = object.length; index < length; index += 1) {
|
|
3488
|
+
value = object[index];
|
|
3489
|
+
if (state.replacer) {
|
|
3490
|
+
value = state.replacer.call(object, String(index), value);
|
|
3491
|
+
}
|
|
3492
|
+
if (writeNode(state, level, value, false, false) || typeof value === "undefined" && writeNode(state, level, null, false, false)) {
|
|
3493
|
+
if (_result !== "") _result += "," + (!state.condenseFlow ? " " : "");
|
|
3494
|
+
_result += state.dump;
|
|
3495
|
+
}
|
|
3496
|
+
}
|
|
3497
|
+
state.tag = _tag;
|
|
3498
|
+
state.dump = "[" + _result + "]";
|
|
3499
|
+
}
|
|
3500
|
+
function writeBlockSequence(state, level, object, compact) {
|
|
3501
|
+
var _result = "", _tag = state.tag, index, length, value;
|
|
3502
|
+
for (index = 0, length = object.length; index < length; index += 1) {
|
|
3503
|
+
value = object[index];
|
|
3504
|
+
if (state.replacer) {
|
|
3505
|
+
value = state.replacer.call(object, String(index), value);
|
|
3506
|
+
}
|
|
3507
|
+
if (writeNode(state, level + 1, value, true, true, false, true) || typeof value === "undefined" && writeNode(state, level + 1, null, true, true, false, true)) {
|
|
3508
|
+
if (!compact || _result !== "") {
|
|
3509
|
+
_result += generateNextLine(state, level);
|
|
3510
|
+
}
|
|
3511
|
+
if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
|
|
3512
|
+
_result += "-";
|
|
3513
|
+
} else {
|
|
3514
|
+
_result += "- ";
|
|
3515
|
+
}
|
|
3516
|
+
_result += state.dump;
|
|
3517
|
+
}
|
|
3518
|
+
}
|
|
3519
|
+
state.tag = _tag;
|
|
3520
|
+
state.dump = _result || "[]";
|
|
3521
|
+
}
|
|
3522
|
+
function writeFlowMapping(state, level, object) {
|
|
3523
|
+
var _result = "", _tag = state.tag, objectKeyList = Object.keys(object), index, length, objectKey, objectValue, pairBuffer;
|
|
3524
|
+
for (index = 0, length = objectKeyList.length; index < length; index += 1) {
|
|
3525
|
+
pairBuffer = "";
|
|
3526
|
+
if (_result !== "") pairBuffer += ", ";
|
|
3527
|
+
if (state.condenseFlow) pairBuffer += '"';
|
|
3528
|
+
objectKey = objectKeyList[index];
|
|
3529
|
+
objectValue = object[objectKey];
|
|
3530
|
+
if (state.replacer) {
|
|
3531
|
+
objectValue = state.replacer.call(object, objectKey, objectValue);
|
|
3532
|
+
}
|
|
3533
|
+
if (!writeNode(state, level, objectKey, false, false)) {
|
|
3534
|
+
continue;
|
|
3535
|
+
}
|
|
3536
|
+
if (state.dump.length > 1024) pairBuffer += "? ";
|
|
3537
|
+
pairBuffer += state.dump + (state.condenseFlow ? '"' : "") + ":" + (state.condenseFlow ? "" : " ");
|
|
3538
|
+
if (!writeNode(state, level, objectValue, false, false)) {
|
|
3539
|
+
continue;
|
|
3540
|
+
}
|
|
3541
|
+
pairBuffer += state.dump;
|
|
3542
|
+
_result += pairBuffer;
|
|
3543
|
+
}
|
|
3544
|
+
state.tag = _tag;
|
|
3545
|
+
state.dump = "{" + _result + "}";
|
|
3546
|
+
}
|
|
3547
|
+
function writeBlockMapping(state, level, object, compact) {
|
|
3548
|
+
var _result = "", _tag = state.tag, objectKeyList = Object.keys(object), index, length, objectKey, objectValue, explicitPair, pairBuffer;
|
|
3549
|
+
if (state.sortKeys === true) {
|
|
3550
|
+
objectKeyList.sort();
|
|
3551
|
+
} else if (typeof state.sortKeys === "function") {
|
|
3552
|
+
objectKeyList.sort(state.sortKeys);
|
|
3553
|
+
} else if (state.sortKeys) {
|
|
3554
|
+
throw new YAMLException("sortKeys must be a boolean or a function");
|
|
3555
|
+
}
|
|
3556
|
+
for (index = 0, length = objectKeyList.length; index < length; index += 1) {
|
|
3557
|
+
pairBuffer = "";
|
|
3558
|
+
if (!compact || _result !== "") {
|
|
3559
|
+
pairBuffer += generateNextLine(state, level);
|
|
3560
|
+
}
|
|
3561
|
+
objectKey = objectKeyList[index];
|
|
3562
|
+
objectValue = object[objectKey];
|
|
3563
|
+
if (state.replacer) {
|
|
3564
|
+
objectValue = state.replacer.call(object, objectKey, objectValue);
|
|
3565
|
+
}
|
|
3566
|
+
if (!writeNode(state, level + 1, objectKey, true, true, true)) {
|
|
3567
|
+
continue;
|
|
3568
|
+
}
|
|
3569
|
+
explicitPair = state.tag !== null && state.tag !== "?" || state.dump && state.dump.length > 1024;
|
|
3570
|
+
if (explicitPair) {
|
|
3571
|
+
if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
|
|
3572
|
+
pairBuffer += "?";
|
|
3573
|
+
} else {
|
|
3574
|
+
pairBuffer += "? ";
|
|
3575
|
+
}
|
|
3576
|
+
}
|
|
3577
|
+
pairBuffer += state.dump;
|
|
3578
|
+
if (explicitPair) {
|
|
3579
|
+
pairBuffer += generateNextLine(state, level);
|
|
3580
|
+
}
|
|
3581
|
+
if (!writeNode(state, level + 1, objectValue, true, explicitPair)) {
|
|
3582
|
+
continue;
|
|
3583
|
+
}
|
|
3584
|
+
if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
|
|
3585
|
+
pairBuffer += ":";
|
|
3586
|
+
} else {
|
|
3587
|
+
pairBuffer += ": ";
|
|
3588
|
+
}
|
|
3589
|
+
pairBuffer += state.dump;
|
|
3590
|
+
_result += pairBuffer;
|
|
3591
|
+
}
|
|
3592
|
+
state.tag = _tag;
|
|
3593
|
+
state.dump = _result || "{}";
|
|
3594
|
+
}
|
|
3595
|
+
function detectType(state, object, explicit) {
|
|
3596
|
+
var _result, typeList, index, length, type, style;
|
|
3597
|
+
typeList = explicit ? state.explicitTypes : state.implicitTypes;
|
|
3598
|
+
for (index = 0, length = typeList.length; index < length; index += 1) {
|
|
3599
|
+
type = typeList[index];
|
|
3600
|
+
if ((type.instanceOf || type.predicate) && (!type.instanceOf || typeof object === "object" && object instanceof type.instanceOf) && (!type.predicate || type.predicate(object))) {
|
|
3601
|
+
if (explicit) {
|
|
3602
|
+
if (type.multi && type.representName) {
|
|
3603
|
+
state.tag = type.representName(object);
|
|
3604
|
+
} else {
|
|
3605
|
+
state.tag = type.tag;
|
|
3606
|
+
}
|
|
3607
|
+
} else {
|
|
3608
|
+
state.tag = "?";
|
|
3609
|
+
}
|
|
3610
|
+
if (type.represent) {
|
|
3611
|
+
style = state.styleMap[type.tag] || type.defaultStyle;
|
|
3612
|
+
if (_toString.call(type.represent) === "[object Function]") {
|
|
3613
|
+
_result = type.represent(object, style);
|
|
3614
|
+
} else if (_hasOwnProperty.call(type.represent, style)) {
|
|
3615
|
+
_result = type.represent[style](object, style);
|
|
3616
|
+
} else {
|
|
3617
|
+
throw new YAMLException("!<" + type.tag + '> tag resolver accepts not "' + style + '" style');
|
|
3618
|
+
}
|
|
3619
|
+
state.dump = _result;
|
|
3620
|
+
}
|
|
3621
|
+
return true;
|
|
3622
|
+
}
|
|
3623
|
+
}
|
|
3624
|
+
return false;
|
|
3625
|
+
}
|
|
3626
|
+
function writeNode(state, level, object, block, compact, iskey, isblockseq) {
|
|
3627
|
+
state.tag = null;
|
|
3628
|
+
state.dump = object;
|
|
3629
|
+
if (!detectType(state, object, false)) {
|
|
3630
|
+
detectType(state, object, true);
|
|
3631
|
+
}
|
|
3632
|
+
var type = _toString.call(state.dump);
|
|
3633
|
+
var inblock = block;
|
|
3634
|
+
var tagStr;
|
|
3635
|
+
if (block) {
|
|
3636
|
+
block = state.flowLevel < 0 || state.flowLevel > level;
|
|
3637
|
+
}
|
|
3638
|
+
var objectOrArray = type === "[object Object]" || type === "[object Array]", duplicateIndex, duplicate;
|
|
3639
|
+
if (objectOrArray) {
|
|
3640
|
+
duplicateIndex = state.duplicates.indexOf(object);
|
|
3641
|
+
duplicate = duplicateIndex !== -1;
|
|
3642
|
+
}
|
|
3643
|
+
if (state.tag !== null && state.tag !== "?" || duplicate || state.indent !== 2 && level > 0) {
|
|
3644
|
+
compact = false;
|
|
3645
|
+
}
|
|
3646
|
+
if (duplicate && state.usedDuplicates[duplicateIndex]) {
|
|
3647
|
+
state.dump = "*ref_" + duplicateIndex;
|
|
3648
|
+
} else {
|
|
3649
|
+
if (objectOrArray && duplicate && !state.usedDuplicates[duplicateIndex]) {
|
|
3650
|
+
state.usedDuplicates[duplicateIndex] = true;
|
|
3651
|
+
}
|
|
3652
|
+
if (type === "[object Object]") {
|
|
3653
|
+
if (block && Object.keys(state.dump).length !== 0) {
|
|
3654
|
+
writeBlockMapping(state, level, state.dump, compact);
|
|
3655
|
+
if (duplicate) {
|
|
3656
|
+
state.dump = "&ref_" + duplicateIndex + state.dump;
|
|
3657
|
+
}
|
|
3658
|
+
} else {
|
|
3659
|
+
writeFlowMapping(state, level, state.dump);
|
|
3660
|
+
if (duplicate) {
|
|
3661
|
+
state.dump = "&ref_" + duplicateIndex + " " + state.dump;
|
|
3662
|
+
}
|
|
3663
|
+
}
|
|
3664
|
+
} else if (type === "[object Array]") {
|
|
3665
|
+
if (block && state.dump.length !== 0) {
|
|
3666
|
+
if (state.noArrayIndent && !isblockseq && level > 0) {
|
|
3667
|
+
writeBlockSequence(state, level - 1, state.dump, compact);
|
|
3668
|
+
} else {
|
|
3669
|
+
writeBlockSequence(state, level, state.dump, compact);
|
|
3670
|
+
}
|
|
3671
|
+
if (duplicate) {
|
|
3672
|
+
state.dump = "&ref_" + duplicateIndex + state.dump;
|
|
3673
|
+
}
|
|
3674
|
+
} else {
|
|
3675
|
+
writeFlowSequence(state, level, state.dump);
|
|
3676
|
+
if (duplicate) {
|
|
3677
|
+
state.dump = "&ref_" + duplicateIndex + " " + state.dump;
|
|
3678
|
+
}
|
|
3679
|
+
}
|
|
3680
|
+
} else if (type === "[object String]") {
|
|
3681
|
+
if (state.tag !== "?") {
|
|
3682
|
+
writeScalar(state, state.dump, level, iskey, inblock);
|
|
3683
|
+
}
|
|
3684
|
+
} else if (type === "[object Undefined]") {
|
|
3685
|
+
return false;
|
|
3686
|
+
} else {
|
|
3687
|
+
if (state.skipInvalid) return false;
|
|
3688
|
+
throw new YAMLException("unacceptable kind of an object to dump " + type);
|
|
3689
|
+
}
|
|
3690
|
+
if (state.tag !== null && state.tag !== "?") {
|
|
3691
|
+
tagStr = encodeURI(
|
|
3692
|
+
state.tag[0] === "!" ? state.tag.slice(1) : state.tag
|
|
3693
|
+
).replace(/!/g, "%21");
|
|
3694
|
+
if (state.tag[0] === "!") {
|
|
3695
|
+
tagStr = "!" + tagStr;
|
|
3696
|
+
} else if (tagStr.slice(0, 18) === "tag:yaml.org,2002:") {
|
|
3697
|
+
tagStr = "!!" + tagStr.slice(18);
|
|
3698
|
+
} else {
|
|
3699
|
+
tagStr = "!<" + tagStr + ">";
|
|
3700
|
+
}
|
|
3701
|
+
state.dump = tagStr + " " + state.dump;
|
|
3702
|
+
}
|
|
3703
|
+
}
|
|
3704
|
+
return true;
|
|
3705
|
+
}
|
|
3706
|
+
function getDuplicateReferences(object, state) {
|
|
3707
|
+
var objects = [], duplicatesIndexes = [], index, length;
|
|
3708
|
+
inspectNode(object, objects, duplicatesIndexes);
|
|
3709
|
+
for (index = 0, length = duplicatesIndexes.length; index < length; index += 1) {
|
|
3710
|
+
state.duplicates.push(objects[duplicatesIndexes[index]]);
|
|
3711
|
+
}
|
|
3712
|
+
state.usedDuplicates = new Array(length);
|
|
3713
|
+
}
|
|
3714
|
+
function inspectNode(object, objects, duplicatesIndexes) {
|
|
3715
|
+
var objectKeyList, index, length;
|
|
3716
|
+
if (object !== null && typeof object === "object") {
|
|
3717
|
+
index = objects.indexOf(object);
|
|
3718
|
+
if (index !== -1) {
|
|
3719
|
+
if (duplicatesIndexes.indexOf(index) === -1) {
|
|
3720
|
+
duplicatesIndexes.push(index);
|
|
3721
|
+
}
|
|
3722
|
+
} else {
|
|
3723
|
+
objects.push(object);
|
|
3724
|
+
if (Array.isArray(object)) {
|
|
3725
|
+
for (index = 0, length = object.length; index < length; index += 1) {
|
|
3726
|
+
inspectNode(object[index], objects, duplicatesIndexes);
|
|
3727
|
+
}
|
|
3728
|
+
} else {
|
|
3729
|
+
objectKeyList = Object.keys(object);
|
|
3730
|
+
for (index = 0, length = objectKeyList.length; index < length; index += 1) {
|
|
3731
|
+
inspectNode(object[objectKeyList[index]], objects, duplicatesIndexes);
|
|
3732
|
+
}
|
|
3733
|
+
}
|
|
3734
|
+
}
|
|
3735
|
+
}
|
|
3736
|
+
}
|
|
3737
|
+
function dump(input, options) {
|
|
3738
|
+
options = options || {};
|
|
3739
|
+
var state = new State(options);
|
|
3740
|
+
if (!state.noRefs) getDuplicateReferences(input, state);
|
|
3741
|
+
var value = input;
|
|
3742
|
+
if (state.replacer) {
|
|
3743
|
+
value = state.replacer.call({ "": value }, "", value);
|
|
3744
|
+
}
|
|
3745
|
+
if (writeNode(state, 0, value, true, true)) return state.dump + "\n";
|
|
3746
|
+
return "";
|
|
3747
|
+
}
|
|
3748
|
+
module.exports.dump = dump;
|
|
3749
|
+
}
|
|
3750
|
+
});
|
|
3751
|
+
|
|
3752
|
+
// node_modules/js-yaml/index.js
|
|
3753
|
+
var require_js_yaml = __commonJS({
|
|
3754
|
+
"node_modules/js-yaml/index.js"(exports, module) {
|
|
3755
|
+
"use strict";
|
|
3756
|
+
init_esm_shims();
|
|
3757
|
+
var loader = require_loader();
|
|
3758
|
+
var dumper = require_dumper();
|
|
3759
|
+
function renamed(from, to) {
|
|
3760
|
+
return function() {
|
|
3761
|
+
throw new Error("Function yaml." + from + " is removed in js-yaml 4. Use yaml." + to + " instead, which is now safe by default.");
|
|
3762
|
+
};
|
|
3763
|
+
}
|
|
3764
|
+
module.exports.Type = require_type();
|
|
3765
|
+
module.exports.Schema = require_schema();
|
|
3766
|
+
module.exports.FAILSAFE_SCHEMA = require_failsafe();
|
|
3767
|
+
module.exports.JSON_SCHEMA = require_json();
|
|
3768
|
+
module.exports.CORE_SCHEMA = require_core();
|
|
3769
|
+
module.exports.DEFAULT_SCHEMA = require_default();
|
|
3770
|
+
module.exports.load = loader.load;
|
|
3771
|
+
module.exports.loadAll = loader.loadAll;
|
|
3772
|
+
module.exports.dump = dumper.dump;
|
|
3773
|
+
module.exports.YAMLException = require_exception();
|
|
3774
|
+
module.exports.types = {
|
|
3775
|
+
binary: require_binary(),
|
|
3776
|
+
float: require_float(),
|
|
3777
|
+
map: require_map(),
|
|
3778
|
+
null: require_null(),
|
|
3779
|
+
pairs: require_pairs(),
|
|
3780
|
+
set: require_set(),
|
|
3781
|
+
timestamp: require_timestamp(),
|
|
3782
|
+
bool: require_bool(),
|
|
3783
|
+
int: require_int(),
|
|
3784
|
+
merge: require_merge(),
|
|
3785
|
+
omap: require_omap(),
|
|
3786
|
+
seq: require_seq(),
|
|
3787
|
+
str: require_str()
|
|
3788
|
+
};
|
|
3789
|
+
module.exports.safeLoad = renamed("safeLoad", "load");
|
|
3790
|
+
module.exports.safeLoadAll = renamed("safeLoadAll", "loadAll");
|
|
3791
|
+
module.exports.safeDump = renamed("safeDump", "dump");
|
|
3792
|
+
}
|
|
3793
|
+
});
|
|
3794
|
+
|
|
3795
|
+
// node_modules/cosmiconfig/dist/loaders.js
|
|
3796
|
+
var require_loaders = __commonJS({
|
|
3797
|
+
"node_modules/cosmiconfig/dist/loaders.js"(exports) {
|
|
3798
|
+
"use strict";
|
|
3799
|
+
init_esm_shims();
|
|
3800
|
+
var __importDefault = exports && exports.__importDefault || function(mod) {
|
|
3801
|
+
return mod && mod.__esModule ? mod : { "default": mod };
|
|
3802
|
+
};
|
|
3803
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3804
|
+
exports.loadTs = exports.loadTsSync = exports.loadYaml = exports.loadJson = exports.loadJs = exports.loadJsSync = void 0;
|
|
3805
|
+
var fs_1 = __require("fs");
|
|
3806
|
+
var promises_1 = __require("fs/promises");
|
|
3807
|
+
var path_1 = __importDefault(__require("path"));
|
|
3808
|
+
var url_1 = __require("url");
|
|
3809
|
+
var importFresh;
|
|
3810
|
+
var loadJsSync = function loadJsSync2(filepath) {
|
|
3811
|
+
if (importFresh === void 0) {
|
|
3812
|
+
importFresh = require_import_fresh();
|
|
3813
|
+
}
|
|
3814
|
+
return importFresh(filepath);
|
|
3815
|
+
};
|
|
3816
|
+
exports.loadJsSync = loadJsSync;
|
|
3817
|
+
var loadJs = async function loadJs2(filepath) {
|
|
3818
|
+
try {
|
|
3819
|
+
const { href } = (0, url_1.pathToFileURL)(filepath);
|
|
3820
|
+
return (await import(href)).default;
|
|
3821
|
+
} catch (error) {
|
|
3822
|
+
try {
|
|
3823
|
+
return (0, exports.loadJsSync)(filepath, "");
|
|
3824
|
+
} catch (requireError) {
|
|
3825
|
+
if (requireError.code === "ERR_REQUIRE_ESM" || requireError instanceof SyntaxError && requireError.toString().includes("Cannot use import statement outside a module")) {
|
|
3826
|
+
throw error;
|
|
3827
|
+
}
|
|
3828
|
+
throw requireError;
|
|
3829
|
+
}
|
|
3830
|
+
}
|
|
3831
|
+
};
|
|
3832
|
+
exports.loadJs = loadJs;
|
|
3833
|
+
var parseJson;
|
|
3834
|
+
var loadJson = function loadJson2(filepath, content) {
|
|
3835
|
+
if (parseJson === void 0) {
|
|
3836
|
+
parseJson = require_parse_json();
|
|
3837
|
+
}
|
|
3838
|
+
try {
|
|
3839
|
+
return parseJson(content);
|
|
3840
|
+
} catch (error) {
|
|
3841
|
+
error.message = `JSON Error in ${filepath}:
|
|
3842
|
+
${error.message}`;
|
|
3843
|
+
throw error;
|
|
3844
|
+
}
|
|
3845
|
+
};
|
|
3846
|
+
exports.loadJson = loadJson;
|
|
3847
|
+
var yaml;
|
|
3848
|
+
var loadYaml = function loadYaml2(filepath, content) {
|
|
3849
|
+
if (yaml === void 0) {
|
|
3850
|
+
yaml = require_js_yaml();
|
|
3851
|
+
}
|
|
3852
|
+
try {
|
|
3853
|
+
return yaml.load(content);
|
|
3854
|
+
} catch (error) {
|
|
3855
|
+
error.message = `YAML Error in ${filepath}:
|
|
3856
|
+
${error.message}`;
|
|
3857
|
+
throw error;
|
|
3858
|
+
}
|
|
3859
|
+
};
|
|
3860
|
+
exports.loadYaml = loadYaml;
|
|
3861
|
+
var typescript;
|
|
3862
|
+
var loadTsSync = function loadTsSync2(filepath, content) {
|
|
3863
|
+
if (typescript === void 0) {
|
|
3864
|
+
typescript = require_typescript();
|
|
3865
|
+
}
|
|
3866
|
+
const compiledFilepath = `${filepath.slice(0, -2)}cjs`;
|
|
3867
|
+
try {
|
|
3868
|
+
const config = resolveTsConfig(path_1.default.dirname(filepath)) ?? {};
|
|
3869
|
+
config.compilerOptions = {
|
|
3870
|
+
...config.compilerOptions,
|
|
3871
|
+
module: typescript.ModuleKind.NodeNext,
|
|
3872
|
+
moduleResolution: typescript.ModuleResolutionKind.NodeNext,
|
|
3873
|
+
target: typescript.ScriptTarget.ES2022,
|
|
3874
|
+
noEmit: false
|
|
3875
|
+
};
|
|
3876
|
+
content = typescript.transpileModule(content, config).outputText;
|
|
3877
|
+
(0, fs_1.writeFileSync)(compiledFilepath, content);
|
|
3878
|
+
return (0, exports.loadJsSync)(compiledFilepath, content).default;
|
|
3879
|
+
} catch (error) {
|
|
3880
|
+
error.message = `TypeScript Error in ${filepath}:
|
|
3881
|
+
${error.message}`;
|
|
3882
|
+
throw error;
|
|
3883
|
+
} finally {
|
|
3884
|
+
if ((0, fs_1.existsSync)(compiledFilepath)) {
|
|
3885
|
+
(0, fs_1.rmSync)(compiledFilepath);
|
|
3886
|
+
}
|
|
3887
|
+
}
|
|
3888
|
+
};
|
|
3889
|
+
exports.loadTsSync = loadTsSync;
|
|
3890
|
+
var loadTs = async function loadTs2(filepath, content) {
|
|
3891
|
+
if (typescript === void 0) {
|
|
3892
|
+
typescript = (await import("./typescript-7Q5RIVZY.mjs")).default;
|
|
3893
|
+
}
|
|
3894
|
+
const compiledFilepath = `${filepath.slice(0, -2)}mjs`;
|
|
3895
|
+
let transpiledContent;
|
|
3896
|
+
try {
|
|
3897
|
+
try {
|
|
3898
|
+
const config = resolveTsConfig(path_1.default.dirname(filepath)) ?? {};
|
|
3899
|
+
config.compilerOptions = {
|
|
3900
|
+
...config.compilerOptions,
|
|
3901
|
+
module: typescript.ModuleKind.ES2022,
|
|
3902
|
+
moduleResolution: typescript.ModuleResolutionKind.Bundler,
|
|
3903
|
+
target: typescript.ScriptTarget.ES2022,
|
|
3904
|
+
noEmit: false
|
|
3905
|
+
};
|
|
3906
|
+
transpiledContent = typescript.transpileModule(content, config).outputText;
|
|
3907
|
+
await (0, promises_1.writeFile)(compiledFilepath, transpiledContent);
|
|
3908
|
+
} catch (error) {
|
|
3909
|
+
error.message = `TypeScript Error in ${filepath}:
|
|
3910
|
+
${error.message}`;
|
|
3911
|
+
throw error;
|
|
3912
|
+
}
|
|
3913
|
+
return await (0, exports.loadJs)(compiledFilepath, transpiledContent);
|
|
3914
|
+
} finally {
|
|
3915
|
+
if ((0, fs_1.existsSync)(compiledFilepath)) {
|
|
3916
|
+
await (0, promises_1.rm)(compiledFilepath);
|
|
3917
|
+
}
|
|
3918
|
+
}
|
|
3919
|
+
};
|
|
3920
|
+
exports.loadTs = loadTs;
|
|
3921
|
+
function resolveTsConfig(directory) {
|
|
3922
|
+
const filePath = typescript.findConfigFile(directory, (fileName) => {
|
|
3923
|
+
return typescript.sys.fileExists(fileName);
|
|
3924
|
+
});
|
|
3925
|
+
if (filePath !== void 0) {
|
|
3926
|
+
const { config, error } = typescript.readConfigFile(filePath, (path) => typescript.sys.readFile(path));
|
|
3927
|
+
if (error) {
|
|
3928
|
+
throw new Error(`Error in ${filePath}: ${error.messageText.toString()}`);
|
|
3929
|
+
}
|
|
3930
|
+
return config;
|
|
3931
|
+
}
|
|
3932
|
+
return;
|
|
3933
|
+
}
|
|
3934
|
+
}
|
|
3935
|
+
});
|
|
3936
|
+
|
|
3937
|
+
// node_modules/cosmiconfig/dist/defaults.js
|
|
3938
|
+
var require_defaults = __commonJS({
|
|
3939
|
+
"node_modules/cosmiconfig/dist/defaults.js"(exports) {
|
|
3940
|
+
"use strict";
|
|
3941
|
+
init_esm_shims();
|
|
3942
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3943
|
+
exports.defaultLoadersSync = exports.defaultLoaders = exports.metaSearchPlaces = exports.globalConfigSearchPlacesSync = exports.globalConfigSearchPlaces = exports.getDefaultSearchPlacesSync = exports.getDefaultSearchPlaces = void 0;
|
|
3944
|
+
var loaders_1 = require_loaders();
|
|
3945
|
+
function getDefaultSearchPlaces(moduleName) {
|
|
3946
|
+
return [
|
|
3947
|
+
"package.json",
|
|
3948
|
+
`.${moduleName}rc`,
|
|
3949
|
+
`.${moduleName}rc.json`,
|
|
3950
|
+
`.${moduleName}rc.yaml`,
|
|
3951
|
+
`.${moduleName}rc.yml`,
|
|
3952
|
+
`.${moduleName}rc.js`,
|
|
3953
|
+
`.${moduleName}rc.ts`,
|
|
3954
|
+
`.${moduleName}rc.cjs`,
|
|
3955
|
+
`.${moduleName}rc.mjs`,
|
|
3956
|
+
`.config/${moduleName}rc`,
|
|
3957
|
+
`.config/${moduleName}rc.json`,
|
|
3958
|
+
`.config/${moduleName}rc.yaml`,
|
|
3959
|
+
`.config/${moduleName}rc.yml`,
|
|
3960
|
+
`.config/${moduleName}rc.js`,
|
|
3961
|
+
`.config/${moduleName}rc.ts`,
|
|
3962
|
+
`.config/${moduleName}rc.cjs`,
|
|
3963
|
+
`.config/${moduleName}rc.mjs`,
|
|
3964
|
+
`${moduleName}.config.js`,
|
|
3965
|
+
`${moduleName}.config.ts`,
|
|
3966
|
+
`${moduleName}.config.cjs`,
|
|
3967
|
+
`${moduleName}.config.mjs`
|
|
3968
|
+
];
|
|
3969
|
+
}
|
|
3970
|
+
exports.getDefaultSearchPlaces = getDefaultSearchPlaces;
|
|
3971
|
+
function getDefaultSearchPlacesSync(moduleName) {
|
|
3972
|
+
return [
|
|
3973
|
+
"package.json",
|
|
3974
|
+
`.${moduleName}rc`,
|
|
3975
|
+
`.${moduleName}rc.json`,
|
|
3976
|
+
`.${moduleName}rc.yaml`,
|
|
3977
|
+
`.${moduleName}rc.yml`,
|
|
3978
|
+
`.${moduleName}rc.js`,
|
|
3979
|
+
`.${moduleName}rc.ts`,
|
|
3980
|
+
`.${moduleName}rc.cjs`,
|
|
3981
|
+
`.config/${moduleName}rc`,
|
|
3982
|
+
`.config/${moduleName}rc.json`,
|
|
3983
|
+
`.config/${moduleName}rc.yaml`,
|
|
3984
|
+
`.config/${moduleName}rc.yml`,
|
|
3985
|
+
`.config/${moduleName}rc.js`,
|
|
3986
|
+
`.config/${moduleName}rc.ts`,
|
|
3987
|
+
`.config/${moduleName}rc.cjs`,
|
|
3988
|
+
`${moduleName}.config.js`,
|
|
3989
|
+
`${moduleName}.config.ts`,
|
|
3990
|
+
`${moduleName}.config.cjs`
|
|
3991
|
+
];
|
|
3992
|
+
}
|
|
3993
|
+
exports.getDefaultSearchPlacesSync = getDefaultSearchPlacesSync;
|
|
3994
|
+
exports.globalConfigSearchPlaces = [
|
|
3995
|
+
"config",
|
|
3996
|
+
"config.json",
|
|
3997
|
+
"config.yaml",
|
|
3998
|
+
"config.yml",
|
|
3999
|
+
"config.js",
|
|
4000
|
+
"config.ts",
|
|
4001
|
+
"config.cjs",
|
|
4002
|
+
"config.mjs"
|
|
4003
|
+
];
|
|
4004
|
+
exports.globalConfigSearchPlacesSync = [
|
|
4005
|
+
"config",
|
|
4006
|
+
"config.json",
|
|
4007
|
+
"config.yaml",
|
|
4008
|
+
"config.yml",
|
|
4009
|
+
"config.js",
|
|
4010
|
+
"config.ts",
|
|
4011
|
+
"config.cjs"
|
|
4012
|
+
];
|
|
4013
|
+
exports.metaSearchPlaces = [
|
|
4014
|
+
"package.json",
|
|
4015
|
+
"package.yaml",
|
|
4016
|
+
".config/config.json",
|
|
4017
|
+
".config/config.yaml",
|
|
4018
|
+
".config/config.yml",
|
|
4019
|
+
".config/config.js",
|
|
4020
|
+
".config/config.ts",
|
|
4021
|
+
".config/config.cjs",
|
|
4022
|
+
".config/config.mjs"
|
|
4023
|
+
];
|
|
4024
|
+
exports.defaultLoaders = Object.freeze({
|
|
4025
|
+
".mjs": loaders_1.loadJs,
|
|
4026
|
+
".cjs": loaders_1.loadJs,
|
|
4027
|
+
".js": loaders_1.loadJs,
|
|
4028
|
+
".ts": loaders_1.loadTs,
|
|
4029
|
+
".json": loaders_1.loadJson,
|
|
4030
|
+
".yaml": loaders_1.loadYaml,
|
|
4031
|
+
".yml": loaders_1.loadYaml,
|
|
4032
|
+
noExt: loaders_1.loadYaml
|
|
4033
|
+
});
|
|
4034
|
+
exports.defaultLoadersSync = Object.freeze({
|
|
4035
|
+
".cjs": loaders_1.loadJsSync,
|
|
4036
|
+
".js": loaders_1.loadJsSync,
|
|
4037
|
+
".ts": loaders_1.loadTsSync,
|
|
4038
|
+
".json": loaders_1.loadJson,
|
|
4039
|
+
".yaml": loaders_1.loadYaml,
|
|
4040
|
+
".yml": loaders_1.loadYaml,
|
|
4041
|
+
noExt: loaders_1.loadYaml
|
|
4042
|
+
});
|
|
4043
|
+
}
|
|
4044
|
+
});
|
|
4045
|
+
|
|
4046
|
+
// node_modules/env-paths/index.js
|
|
4047
|
+
var require_env_paths = __commonJS({
|
|
4048
|
+
"node_modules/env-paths/index.js"(exports, module) {
|
|
4049
|
+
"use strict";
|
|
4050
|
+
init_esm_shims();
|
|
4051
|
+
var path = __require("path");
|
|
4052
|
+
var os = __require("os");
|
|
4053
|
+
var homedir = os.homedir();
|
|
4054
|
+
var tmpdir = os.tmpdir();
|
|
4055
|
+
var { env } = process;
|
|
4056
|
+
var macos = (name) => {
|
|
4057
|
+
const library = path.join(homedir, "Library");
|
|
4058
|
+
return {
|
|
4059
|
+
data: path.join(library, "Application Support", name),
|
|
4060
|
+
config: path.join(library, "Preferences", name),
|
|
4061
|
+
cache: path.join(library, "Caches", name),
|
|
4062
|
+
log: path.join(library, "Logs", name),
|
|
4063
|
+
temp: path.join(tmpdir, name)
|
|
4064
|
+
};
|
|
4065
|
+
};
|
|
4066
|
+
var windows = (name) => {
|
|
4067
|
+
const appData = env.APPDATA || path.join(homedir, "AppData", "Roaming");
|
|
4068
|
+
const localAppData = env.LOCALAPPDATA || path.join(homedir, "AppData", "Local");
|
|
4069
|
+
return {
|
|
4070
|
+
// Data/config/cache/log are invented by me as Windows isn't opinionated about this
|
|
4071
|
+
data: path.join(localAppData, name, "Data"),
|
|
4072
|
+
config: path.join(appData, name, "Config"),
|
|
4073
|
+
cache: path.join(localAppData, name, "Cache"),
|
|
4074
|
+
log: path.join(localAppData, name, "Log"),
|
|
4075
|
+
temp: path.join(tmpdir, name)
|
|
4076
|
+
};
|
|
4077
|
+
};
|
|
4078
|
+
var linux = (name) => {
|
|
4079
|
+
const username = path.basename(homedir);
|
|
4080
|
+
return {
|
|
4081
|
+
data: path.join(env.XDG_DATA_HOME || path.join(homedir, ".local", "share"), name),
|
|
4082
|
+
config: path.join(env.XDG_CONFIG_HOME || path.join(homedir, ".config"), name),
|
|
4083
|
+
cache: path.join(env.XDG_CACHE_HOME || path.join(homedir, ".cache"), name),
|
|
4084
|
+
// https://wiki.debian.org/XDGBaseDirectorySpecification#state
|
|
4085
|
+
log: path.join(env.XDG_STATE_HOME || path.join(homedir, ".local", "state"), name),
|
|
4086
|
+
temp: path.join(tmpdir, username, name)
|
|
4087
|
+
};
|
|
4088
|
+
};
|
|
4089
|
+
var envPaths = (name, options) => {
|
|
4090
|
+
if (typeof name !== "string") {
|
|
4091
|
+
throw new TypeError(`Expected string, got ${typeof name}`);
|
|
4092
|
+
}
|
|
4093
|
+
options = Object.assign({ suffix: "nodejs" }, options);
|
|
4094
|
+
if (options.suffix) {
|
|
4095
|
+
name += `-${options.suffix}`;
|
|
4096
|
+
}
|
|
4097
|
+
if (process.platform === "darwin") {
|
|
4098
|
+
return macos(name);
|
|
4099
|
+
}
|
|
4100
|
+
if (process.platform === "win32") {
|
|
4101
|
+
return windows(name);
|
|
4102
|
+
}
|
|
4103
|
+
return linux(name);
|
|
4104
|
+
};
|
|
4105
|
+
module.exports = envPaths;
|
|
4106
|
+
module.exports.default = envPaths;
|
|
4107
|
+
}
|
|
4108
|
+
});
|
|
4109
|
+
|
|
4110
|
+
// node_modules/cosmiconfig/dist/util.js
|
|
4111
|
+
var require_util = __commonJS({
|
|
4112
|
+
"node_modules/cosmiconfig/dist/util.js"(exports) {
|
|
4113
|
+
"use strict";
|
|
4114
|
+
init_esm_shims();
|
|
4115
|
+
var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k, k2) {
|
|
4116
|
+
if (k2 === void 0) k2 = k;
|
|
4117
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
4118
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
4119
|
+
desc = { enumerable: true, get: function() {
|
|
4120
|
+
return m[k];
|
|
4121
|
+
} };
|
|
4122
|
+
}
|
|
4123
|
+
Object.defineProperty(o, k2, desc);
|
|
4124
|
+
}) : (function(o, m, k, k2) {
|
|
4125
|
+
if (k2 === void 0) k2 = k;
|
|
4126
|
+
o[k2] = m[k];
|
|
4127
|
+
}));
|
|
4128
|
+
var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? (function(o, v) {
|
|
4129
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
4130
|
+
}) : function(o, v) {
|
|
4131
|
+
o["default"] = v;
|
|
4132
|
+
});
|
|
4133
|
+
var __importStar = exports && exports.__importStar || function(mod) {
|
|
4134
|
+
if (mod && mod.__esModule) return mod;
|
|
4135
|
+
var result = {};
|
|
4136
|
+
if (mod != null) {
|
|
4137
|
+
for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
4138
|
+
}
|
|
4139
|
+
__setModuleDefault(result, mod);
|
|
4140
|
+
return result;
|
|
4141
|
+
};
|
|
4142
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4143
|
+
exports.isDirectorySync = exports.isDirectory = exports.removeUndefinedValuesFromObject = exports.getPropertyByPath = exports.emplace = void 0;
|
|
4144
|
+
var fs_1 = __importStar(__require("fs"));
|
|
4145
|
+
function emplace(map, key, fn) {
|
|
4146
|
+
const cached = map.get(key);
|
|
4147
|
+
if (cached !== void 0) {
|
|
4148
|
+
return cached;
|
|
4149
|
+
}
|
|
4150
|
+
const result = fn();
|
|
4151
|
+
map.set(key, result);
|
|
4152
|
+
return result;
|
|
4153
|
+
}
|
|
4154
|
+
exports.emplace = emplace;
|
|
4155
|
+
function getPropertyByPath(source, path) {
|
|
4156
|
+
if (typeof path === "string" && Object.prototype.hasOwnProperty.call(source, path)) {
|
|
4157
|
+
return source[path];
|
|
4158
|
+
}
|
|
4159
|
+
const parsedPath = typeof path === "string" ? path.split(".") : path;
|
|
4160
|
+
return parsedPath.reduce((previous, key) => {
|
|
4161
|
+
if (previous === void 0) {
|
|
4162
|
+
return previous;
|
|
4163
|
+
}
|
|
4164
|
+
return previous[key];
|
|
4165
|
+
}, source);
|
|
4166
|
+
}
|
|
4167
|
+
exports.getPropertyByPath = getPropertyByPath;
|
|
4168
|
+
function removeUndefinedValuesFromObject(options) {
|
|
4169
|
+
return Object.fromEntries(Object.entries(options).filter(([, value]) => value !== void 0));
|
|
4170
|
+
}
|
|
4171
|
+
exports.removeUndefinedValuesFromObject = removeUndefinedValuesFromObject;
|
|
4172
|
+
async function isDirectory(path) {
|
|
4173
|
+
try {
|
|
4174
|
+
const stat = await fs_1.promises.stat(path);
|
|
4175
|
+
return stat.isDirectory();
|
|
4176
|
+
} catch (e) {
|
|
4177
|
+
if (e.code === "ENOENT") {
|
|
4178
|
+
return false;
|
|
4179
|
+
}
|
|
4180
|
+
throw e;
|
|
4181
|
+
}
|
|
4182
|
+
}
|
|
4183
|
+
exports.isDirectory = isDirectory;
|
|
4184
|
+
function isDirectorySync(path) {
|
|
4185
|
+
try {
|
|
4186
|
+
const stat = fs_1.default.statSync(path);
|
|
4187
|
+
return stat.isDirectory();
|
|
4188
|
+
} catch (e) {
|
|
4189
|
+
if (e.code === "ENOENT") {
|
|
4190
|
+
return false;
|
|
4191
|
+
}
|
|
4192
|
+
throw e;
|
|
4193
|
+
}
|
|
4194
|
+
}
|
|
4195
|
+
exports.isDirectorySync = isDirectorySync;
|
|
4196
|
+
}
|
|
4197
|
+
});
|
|
4198
|
+
|
|
4199
|
+
// node_modules/cosmiconfig/dist/ExplorerBase.js
|
|
4200
|
+
var require_ExplorerBase = __commonJS({
|
|
4201
|
+
"node_modules/cosmiconfig/dist/ExplorerBase.js"(exports) {
|
|
4202
|
+
"use strict";
|
|
4203
|
+
init_esm_shims();
|
|
4204
|
+
var __importDefault = exports && exports.__importDefault || function(mod) {
|
|
4205
|
+
return mod && mod.__esModule ? mod : { "default": mod };
|
|
4206
|
+
};
|
|
4207
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4208
|
+
exports.getExtensionDescription = exports.ExplorerBase = void 0;
|
|
4209
|
+
var env_paths_1 = __importDefault(require_env_paths());
|
|
4210
|
+
var os_1 = __importDefault(__require("os"));
|
|
4211
|
+
var path_1 = __importDefault(__require("path"));
|
|
4212
|
+
var util_js_1 = require_util();
|
|
4213
|
+
var _loadingMetaConfig, _ExplorerBase_instances, validateConfig_fn;
|
|
4214
|
+
var ExplorerBase = class {
|
|
4215
|
+
constructor(options) {
|
|
4216
|
+
__privateAdd(this, _ExplorerBase_instances);
|
|
4217
|
+
__privateAdd(this, _loadingMetaConfig, false);
|
|
4218
|
+
__publicField(this, "config");
|
|
4219
|
+
__publicField(this, "loadCache");
|
|
4220
|
+
__publicField(this, "searchCache");
|
|
4221
|
+
this.config = options;
|
|
4222
|
+
if (options.cache) {
|
|
4223
|
+
this.loadCache = /* @__PURE__ */ new Map();
|
|
4224
|
+
this.searchCache = /* @__PURE__ */ new Map();
|
|
4225
|
+
}
|
|
4226
|
+
__privateMethod(this, _ExplorerBase_instances, validateConfig_fn).call(this);
|
|
4227
|
+
}
|
|
4228
|
+
set loadingMetaConfig(value) {
|
|
4229
|
+
__privateSet(this, _loadingMetaConfig, value);
|
|
4230
|
+
}
|
|
4231
|
+
clearLoadCache() {
|
|
4232
|
+
if (this.loadCache) {
|
|
4233
|
+
this.loadCache.clear();
|
|
4234
|
+
}
|
|
4235
|
+
}
|
|
4236
|
+
clearSearchCache() {
|
|
4237
|
+
if (this.searchCache) {
|
|
4238
|
+
this.searchCache.clear();
|
|
4239
|
+
}
|
|
4240
|
+
}
|
|
4241
|
+
clearCaches() {
|
|
4242
|
+
this.clearLoadCache();
|
|
4243
|
+
this.clearSearchCache();
|
|
4244
|
+
}
|
|
4245
|
+
toCosmiconfigResult(filepath, config) {
|
|
4246
|
+
if (config === null) {
|
|
4247
|
+
return null;
|
|
4248
|
+
}
|
|
4249
|
+
if (config === void 0) {
|
|
4250
|
+
return { filepath, config: void 0, isEmpty: true };
|
|
4251
|
+
}
|
|
4252
|
+
if (this.config.applyPackagePropertyPathToConfiguration || __privateGet(this, _loadingMetaConfig)) {
|
|
4253
|
+
const packageProp = this.config.packageProp ?? this.config.moduleName;
|
|
4254
|
+
config = (0, util_js_1.getPropertyByPath)(config, packageProp);
|
|
4255
|
+
}
|
|
4256
|
+
if (config === void 0) {
|
|
4257
|
+
return { filepath, config: void 0, isEmpty: true };
|
|
4258
|
+
}
|
|
4259
|
+
return { config, filepath };
|
|
4260
|
+
}
|
|
4261
|
+
validateImports(containingFilePath, imports, importStack) {
|
|
4262
|
+
const fileDirectory = path_1.default.dirname(containingFilePath);
|
|
4263
|
+
for (const importPath of imports) {
|
|
4264
|
+
if (typeof importPath !== "string") {
|
|
4265
|
+
throw new Error(`${containingFilePath}: Key $import must contain a string or a list of strings`);
|
|
4266
|
+
}
|
|
4267
|
+
const fullPath = path_1.default.resolve(fileDirectory, importPath);
|
|
4268
|
+
if (fullPath === containingFilePath) {
|
|
4269
|
+
throw new Error(`Self-import detected in ${containingFilePath}`);
|
|
4270
|
+
}
|
|
4271
|
+
const idx = importStack.indexOf(fullPath);
|
|
4272
|
+
if (idx !== -1) {
|
|
4273
|
+
throw new Error(`Circular import detected:
|
|
4274
|
+
${[...importStack, fullPath].map((path, i) => `${i + 1}. ${path}`).join("\n")} (same as ${idx + 1}.)`);
|
|
4275
|
+
}
|
|
4276
|
+
}
|
|
4277
|
+
}
|
|
4278
|
+
getSearchPlacesForDir(dir, globalConfigPlaces) {
|
|
4279
|
+
return (dir.isGlobalConfig ? globalConfigPlaces : this.config.searchPlaces).map((place) => path_1.default.join(dir.path, place));
|
|
4280
|
+
}
|
|
4281
|
+
getGlobalConfigDir() {
|
|
4282
|
+
return (0, env_paths_1.default)(this.config.moduleName, { suffix: "" }).config;
|
|
4283
|
+
}
|
|
4284
|
+
*getGlobalDirs(startDir) {
|
|
4285
|
+
const stopDir = path_1.default.resolve(this.config.stopDir ?? os_1.default.homedir());
|
|
4286
|
+
yield { path: startDir, isGlobalConfig: false };
|
|
4287
|
+
let currentDir = startDir;
|
|
4288
|
+
while (currentDir !== stopDir) {
|
|
4289
|
+
const parentDir = path_1.default.dirname(currentDir);
|
|
4290
|
+
if (parentDir === currentDir) {
|
|
4291
|
+
break;
|
|
4292
|
+
}
|
|
4293
|
+
yield { path: parentDir, isGlobalConfig: false };
|
|
4294
|
+
currentDir = parentDir;
|
|
4295
|
+
}
|
|
4296
|
+
yield { path: this.getGlobalConfigDir(), isGlobalConfig: true };
|
|
4297
|
+
}
|
|
4298
|
+
};
|
|
4299
|
+
_loadingMetaConfig = new WeakMap();
|
|
4300
|
+
_ExplorerBase_instances = new WeakSet();
|
|
4301
|
+
validateConfig_fn = function() {
|
|
4302
|
+
const config = this.config;
|
|
4303
|
+
for (const place of config.searchPlaces) {
|
|
4304
|
+
const extension = path_1.default.extname(place);
|
|
4305
|
+
const loader = this.config.loaders[extension || "noExt"] ?? this.config.loaders["default"];
|
|
4306
|
+
if (loader === void 0) {
|
|
4307
|
+
throw new Error(`Missing loader for ${getExtensionDescription(place)}.`);
|
|
4308
|
+
}
|
|
4309
|
+
if (typeof loader !== "function") {
|
|
4310
|
+
throw new Error(`Loader for ${getExtensionDescription(place)} is not a function: Received ${typeof loader}.`);
|
|
4311
|
+
}
|
|
4312
|
+
}
|
|
4313
|
+
};
|
|
4314
|
+
exports.ExplorerBase = ExplorerBase;
|
|
4315
|
+
function getExtensionDescription(extension) {
|
|
4316
|
+
return extension ? `extension "${extension}"` : "files without extensions";
|
|
4317
|
+
}
|
|
4318
|
+
exports.getExtensionDescription = getExtensionDescription;
|
|
4319
|
+
}
|
|
4320
|
+
});
|
|
4321
|
+
|
|
4322
|
+
// node_modules/cosmiconfig/dist/merge.js
|
|
4323
|
+
var require_merge2 = __commonJS({
|
|
4324
|
+
"node_modules/cosmiconfig/dist/merge.js"(exports) {
|
|
4325
|
+
"use strict";
|
|
4326
|
+
init_esm_shims();
|
|
4327
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4328
|
+
exports.mergeAll = exports.hasOwn = void 0;
|
|
4329
|
+
exports.hasOwn = Function.prototype.call.bind(Object.prototype.hasOwnProperty);
|
|
4330
|
+
var objToString = Function.prototype.call.bind(Object.prototype.toString);
|
|
4331
|
+
function isPlainObject(obj) {
|
|
4332
|
+
return objToString(obj) === "[object Object]";
|
|
4333
|
+
}
|
|
4334
|
+
function merge(target, source, options) {
|
|
4335
|
+
for (const key of Object.keys(source)) {
|
|
4336
|
+
const newValue = source[key];
|
|
4337
|
+
if ((0, exports.hasOwn)(target, key)) {
|
|
4338
|
+
if (Array.isArray(target[key]) && Array.isArray(newValue)) {
|
|
4339
|
+
if (options.mergeArrays) {
|
|
4340
|
+
target[key].push(...newValue);
|
|
4341
|
+
continue;
|
|
4342
|
+
}
|
|
4343
|
+
} else if (isPlainObject(target[key]) && isPlainObject(newValue)) {
|
|
4344
|
+
target[key] = merge(target[key], newValue, options);
|
|
4345
|
+
continue;
|
|
4346
|
+
}
|
|
4347
|
+
}
|
|
4348
|
+
target[key] = newValue;
|
|
4349
|
+
}
|
|
4350
|
+
return target;
|
|
4351
|
+
}
|
|
4352
|
+
function mergeAll(objects, options) {
|
|
4353
|
+
return objects.reduce((target, source) => merge(target, source, options), {});
|
|
4354
|
+
}
|
|
4355
|
+
exports.mergeAll = mergeAll;
|
|
4356
|
+
}
|
|
4357
|
+
});
|
|
4358
|
+
|
|
4359
|
+
// node_modules/cosmiconfig/dist/Explorer.js
|
|
4360
|
+
var require_Explorer = __commonJS({
|
|
4361
|
+
"node_modules/cosmiconfig/dist/Explorer.js"(exports) {
|
|
4362
|
+
"use strict";
|
|
4363
|
+
init_esm_shims();
|
|
4364
|
+
var __importDefault = exports && exports.__importDefault || function(mod) {
|
|
4365
|
+
return mod && mod.__esModule ? mod : { "default": mod };
|
|
4366
|
+
};
|
|
4367
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4368
|
+
exports.Explorer = void 0;
|
|
4369
|
+
var promises_1 = __importDefault(__require("fs/promises"));
|
|
4370
|
+
var path_1 = __importDefault(__require("path"));
|
|
4371
|
+
var defaults_1 = require_defaults();
|
|
4372
|
+
var ExplorerBase_js_1 = require_ExplorerBase();
|
|
4373
|
+
var merge_1 = require_merge2();
|
|
4374
|
+
var util_js_1 = require_util();
|
|
4375
|
+
var _Explorer_instances, readConfiguration_fn, loadConfigFileWithImports_fn, loadConfiguration_fn, fileExists_fn, getDirs_fn;
|
|
4376
|
+
var Explorer = class extends ExplorerBase_js_1.ExplorerBase {
|
|
4377
|
+
constructor() {
|
|
4378
|
+
super(...arguments);
|
|
4379
|
+
__privateAdd(this, _Explorer_instances);
|
|
4380
|
+
}
|
|
4381
|
+
async load(filepath) {
|
|
4382
|
+
filepath = path_1.default.resolve(filepath);
|
|
4383
|
+
const load = async () => {
|
|
4384
|
+
return await this.config.transform(await __privateMethod(this, _Explorer_instances, readConfiguration_fn).call(this, filepath));
|
|
4385
|
+
};
|
|
4386
|
+
if (this.loadCache) {
|
|
4387
|
+
return await (0, util_js_1.emplace)(this.loadCache, filepath, load);
|
|
4388
|
+
}
|
|
4389
|
+
return await load();
|
|
4390
|
+
}
|
|
4391
|
+
async search(from = "") {
|
|
4392
|
+
if (this.config.metaConfigFilePath) {
|
|
4393
|
+
this.loadingMetaConfig = true;
|
|
4394
|
+
const config = await this.load(this.config.metaConfigFilePath);
|
|
4395
|
+
this.loadingMetaConfig = false;
|
|
4396
|
+
if (config && !config.isEmpty) {
|
|
4397
|
+
return config;
|
|
4398
|
+
}
|
|
4399
|
+
}
|
|
4400
|
+
from = path_1.default.resolve(from);
|
|
4401
|
+
const dirs = __privateMethod(this, _Explorer_instances, getDirs_fn).call(this, from);
|
|
4402
|
+
const firstDirIter = await dirs.next();
|
|
4403
|
+
if (firstDirIter.done) {
|
|
4404
|
+
throw new Error(`Could not find any folders to iterate through (start from ${from})`);
|
|
4405
|
+
}
|
|
4406
|
+
let currentDir = firstDirIter.value;
|
|
4407
|
+
const search = async () => {
|
|
4408
|
+
if (await (0, util_js_1.isDirectory)(currentDir.path)) {
|
|
4409
|
+
for (const filepath of this.getSearchPlacesForDir(currentDir, defaults_1.globalConfigSearchPlaces)) {
|
|
4410
|
+
try {
|
|
4411
|
+
const result = await __privateMethod(this, _Explorer_instances, readConfiguration_fn).call(this, filepath);
|
|
4412
|
+
if (result !== null && !(result.isEmpty && this.config.ignoreEmptySearchPlaces)) {
|
|
4413
|
+
return await this.config.transform(result);
|
|
4414
|
+
}
|
|
4415
|
+
} catch (error) {
|
|
4416
|
+
if (error.code === "ENOENT" || error.code === "EISDIR" || error.code === "ENOTDIR" || error.code === "EACCES") {
|
|
4417
|
+
continue;
|
|
4418
|
+
}
|
|
4419
|
+
throw error;
|
|
4420
|
+
}
|
|
4421
|
+
}
|
|
4422
|
+
}
|
|
4423
|
+
const nextDirIter = await dirs.next();
|
|
4424
|
+
if (!nextDirIter.done) {
|
|
4425
|
+
currentDir = nextDirIter.value;
|
|
4426
|
+
if (this.searchCache) {
|
|
4427
|
+
return await (0, util_js_1.emplace)(this.searchCache, currentDir.path, search);
|
|
4428
|
+
}
|
|
4429
|
+
return await search();
|
|
4430
|
+
}
|
|
4431
|
+
return await this.config.transform(null);
|
|
4432
|
+
};
|
|
4433
|
+
if (this.searchCache) {
|
|
4434
|
+
return await (0, util_js_1.emplace)(this.searchCache, from, search);
|
|
4435
|
+
}
|
|
4436
|
+
return await search();
|
|
4437
|
+
}
|
|
4438
|
+
};
|
|
4439
|
+
_Explorer_instances = new WeakSet();
|
|
4440
|
+
readConfiguration_fn = async function(filepath, importStack = []) {
|
|
4441
|
+
const contents = await promises_1.default.readFile(filepath, { encoding: "utf-8" });
|
|
4442
|
+
return this.toCosmiconfigResult(filepath, await __privateMethod(this, _Explorer_instances, loadConfigFileWithImports_fn).call(this, filepath, contents, importStack));
|
|
4443
|
+
};
|
|
4444
|
+
loadConfigFileWithImports_fn = async function(filepath, contents, importStack) {
|
|
4445
|
+
const loadedContent = await __privateMethod(this, _Explorer_instances, loadConfiguration_fn).call(this, filepath, contents);
|
|
4446
|
+
if (!loadedContent || !(0, merge_1.hasOwn)(loadedContent, "$import")) {
|
|
4447
|
+
return loadedContent;
|
|
4448
|
+
}
|
|
4449
|
+
const fileDirectory = path_1.default.dirname(filepath);
|
|
4450
|
+
const { $import: imports, ...ownContent } = loadedContent;
|
|
4451
|
+
const importPaths = Array.isArray(imports) ? imports : [imports];
|
|
4452
|
+
const newImportStack = [...importStack, filepath];
|
|
4453
|
+
this.validateImports(filepath, importPaths, newImportStack);
|
|
4454
|
+
const importedConfigs = await Promise.all(importPaths.map(async (importPath) => {
|
|
4455
|
+
const fullPath = path_1.default.resolve(fileDirectory, importPath);
|
|
4456
|
+
const result = await __privateMethod(this, _Explorer_instances, readConfiguration_fn).call(this, fullPath, newImportStack);
|
|
4457
|
+
return result?.config;
|
|
4458
|
+
}));
|
|
4459
|
+
return (0, merge_1.mergeAll)([...importedConfigs, ownContent], {
|
|
4460
|
+
mergeArrays: this.config.mergeImportArrays
|
|
4461
|
+
});
|
|
4462
|
+
};
|
|
4463
|
+
loadConfiguration_fn = async function(filepath, contents) {
|
|
4464
|
+
if (contents.trim() === "") {
|
|
4465
|
+
return;
|
|
4466
|
+
}
|
|
4467
|
+
const extension = path_1.default.extname(filepath);
|
|
4468
|
+
const loader = this.config.loaders[extension || "noExt"] ?? this.config.loaders["default"];
|
|
4469
|
+
if (!loader) {
|
|
4470
|
+
throw new Error(`No loader specified for ${(0, ExplorerBase_js_1.getExtensionDescription)(extension)}`);
|
|
4471
|
+
}
|
|
4472
|
+
try {
|
|
4473
|
+
const loadedContents = await loader(filepath, contents);
|
|
4474
|
+
if (path_1.default.basename(filepath, extension) !== "package") {
|
|
4475
|
+
return loadedContents;
|
|
4476
|
+
}
|
|
4477
|
+
return (0, util_js_1.getPropertyByPath)(loadedContents, this.config.packageProp ?? this.config.moduleName) ?? null;
|
|
4478
|
+
} catch (error) {
|
|
4479
|
+
error.filepath = filepath;
|
|
4480
|
+
throw error;
|
|
4481
|
+
}
|
|
4482
|
+
};
|
|
4483
|
+
fileExists_fn = async function(path) {
|
|
4484
|
+
try {
|
|
4485
|
+
await promises_1.default.stat(path);
|
|
4486
|
+
return true;
|
|
4487
|
+
} catch (e) {
|
|
4488
|
+
return false;
|
|
4489
|
+
}
|
|
4490
|
+
};
|
|
4491
|
+
getDirs_fn = async function* (startDir) {
|
|
4492
|
+
switch (this.config.searchStrategy) {
|
|
4493
|
+
case "none": {
|
|
4494
|
+
yield { path: startDir, isGlobalConfig: false };
|
|
4495
|
+
return;
|
|
4496
|
+
}
|
|
4497
|
+
case "project": {
|
|
4498
|
+
let currentDir = startDir;
|
|
4499
|
+
while (true) {
|
|
4500
|
+
yield { path: currentDir, isGlobalConfig: false };
|
|
4501
|
+
for (const ext of ["json", "yaml"]) {
|
|
4502
|
+
const packageFile = path_1.default.join(currentDir, `package.${ext}`);
|
|
4503
|
+
if (await __privateMethod(this, _Explorer_instances, fileExists_fn).call(this, packageFile)) {
|
|
4504
|
+
break;
|
|
4505
|
+
}
|
|
4506
|
+
}
|
|
4507
|
+
const parentDir = path_1.default.dirname(currentDir);
|
|
4508
|
+
if (parentDir === currentDir) {
|
|
4509
|
+
break;
|
|
4510
|
+
}
|
|
4511
|
+
currentDir = parentDir;
|
|
4512
|
+
}
|
|
4513
|
+
return;
|
|
4514
|
+
}
|
|
4515
|
+
case "global": {
|
|
4516
|
+
yield* this.getGlobalDirs(startDir);
|
|
4517
|
+
}
|
|
4518
|
+
}
|
|
4519
|
+
};
|
|
4520
|
+
exports.Explorer = Explorer;
|
|
4521
|
+
}
|
|
4522
|
+
});
|
|
4523
|
+
|
|
4524
|
+
// node_modules/cosmiconfig/dist/ExplorerSync.js
|
|
4525
|
+
var require_ExplorerSync = __commonJS({
|
|
4526
|
+
"node_modules/cosmiconfig/dist/ExplorerSync.js"(exports) {
|
|
4527
|
+
"use strict";
|
|
4528
|
+
init_esm_shims();
|
|
4529
|
+
var __importDefault = exports && exports.__importDefault || function(mod) {
|
|
4530
|
+
return mod && mod.__esModule ? mod : { "default": mod };
|
|
4531
|
+
};
|
|
4532
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4533
|
+
exports.ExplorerSync = void 0;
|
|
4534
|
+
var fs_1 = __importDefault(__require("fs"));
|
|
4535
|
+
var path_1 = __importDefault(__require("path"));
|
|
4536
|
+
var defaults_1 = require_defaults();
|
|
4537
|
+
var ExplorerBase_js_1 = require_ExplorerBase();
|
|
4538
|
+
var merge_1 = require_merge2();
|
|
4539
|
+
var util_js_1 = require_util();
|
|
4540
|
+
var _ExplorerSync_instances, readConfiguration_fn, loadConfigFileWithImports_fn, loadConfiguration_fn, fileExists_fn, getDirs_fn;
|
|
4541
|
+
var ExplorerSync = class extends ExplorerBase_js_1.ExplorerBase {
|
|
4542
|
+
constructor() {
|
|
4543
|
+
super(...arguments);
|
|
4544
|
+
__privateAdd(this, _ExplorerSync_instances);
|
|
4545
|
+
}
|
|
4546
|
+
load(filepath) {
|
|
4547
|
+
filepath = path_1.default.resolve(filepath);
|
|
4548
|
+
const load = () => {
|
|
4549
|
+
return this.config.transform(__privateMethod(this, _ExplorerSync_instances, readConfiguration_fn).call(this, filepath));
|
|
4550
|
+
};
|
|
4551
|
+
if (this.loadCache) {
|
|
4552
|
+
return (0, util_js_1.emplace)(this.loadCache, filepath, load);
|
|
4553
|
+
}
|
|
4554
|
+
return load();
|
|
4555
|
+
}
|
|
4556
|
+
search(from = "") {
|
|
4557
|
+
if (this.config.metaConfigFilePath) {
|
|
4558
|
+
this.loadingMetaConfig = true;
|
|
4559
|
+
const config = this.load(this.config.metaConfigFilePath);
|
|
4560
|
+
this.loadingMetaConfig = false;
|
|
4561
|
+
if (config && !config.isEmpty) {
|
|
4562
|
+
return config;
|
|
4563
|
+
}
|
|
4564
|
+
}
|
|
4565
|
+
from = path_1.default.resolve(from);
|
|
4566
|
+
const dirs = __privateMethod(this, _ExplorerSync_instances, getDirs_fn).call(this, from);
|
|
4567
|
+
const firstDirIter = dirs.next();
|
|
4568
|
+
if (firstDirIter.done) {
|
|
4569
|
+
throw new Error(`Could not find any folders to iterate through (start from ${from})`);
|
|
4570
|
+
}
|
|
4571
|
+
let currentDir = firstDirIter.value;
|
|
4572
|
+
const search = () => {
|
|
4573
|
+
if ((0, util_js_1.isDirectorySync)(currentDir.path)) {
|
|
4574
|
+
for (const filepath of this.getSearchPlacesForDir(currentDir, defaults_1.globalConfigSearchPlacesSync)) {
|
|
4575
|
+
try {
|
|
4576
|
+
const result = __privateMethod(this, _ExplorerSync_instances, readConfiguration_fn).call(this, filepath);
|
|
4577
|
+
if (result !== null && !(result.isEmpty && this.config.ignoreEmptySearchPlaces)) {
|
|
4578
|
+
return this.config.transform(result);
|
|
4579
|
+
}
|
|
4580
|
+
} catch (error) {
|
|
4581
|
+
if (error.code === "ENOENT" || error.code === "EISDIR" || error.code === "ENOTDIR" || error.code === "EACCES") {
|
|
4582
|
+
continue;
|
|
4583
|
+
}
|
|
4584
|
+
throw error;
|
|
4585
|
+
}
|
|
4586
|
+
}
|
|
4587
|
+
}
|
|
4588
|
+
const nextDirIter = dirs.next();
|
|
4589
|
+
if (!nextDirIter.done) {
|
|
4590
|
+
currentDir = nextDirIter.value;
|
|
4591
|
+
if (this.searchCache) {
|
|
4592
|
+
return (0, util_js_1.emplace)(this.searchCache, currentDir.path, search);
|
|
4593
|
+
}
|
|
4594
|
+
return search();
|
|
4595
|
+
}
|
|
4596
|
+
return this.config.transform(null);
|
|
4597
|
+
};
|
|
4598
|
+
if (this.searchCache) {
|
|
4599
|
+
return (0, util_js_1.emplace)(this.searchCache, from, search);
|
|
4600
|
+
}
|
|
4601
|
+
return search();
|
|
4602
|
+
}
|
|
4603
|
+
/**
|
|
4604
|
+
* @deprecated Use {@link ExplorerSync.prototype.load}.
|
|
4605
|
+
*/
|
|
4606
|
+
/* istanbul ignore next */
|
|
4607
|
+
loadSync(filepath) {
|
|
4608
|
+
return this.load(filepath);
|
|
4609
|
+
}
|
|
4610
|
+
/**
|
|
4611
|
+
* @deprecated Use {@link ExplorerSync.prototype.search}.
|
|
4612
|
+
*/
|
|
4613
|
+
/* istanbul ignore next */
|
|
4614
|
+
searchSync(from = "") {
|
|
4615
|
+
return this.search(from);
|
|
4616
|
+
}
|
|
4617
|
+
};
|
|
4618
|
+
_ExplorerSync_instances = new WeakSet();
|
|
4619
|
+
readConfiguration_fn = function(filepath, importStack = []) {
|
|
4620
|
+
const contents = fs_1.default.readFileSync(filepath, "utf8");
|
|
4621
|
+
return this.toCosmiconfigResult(filepath, __privateMethod(this, _ExplorerSync_instances, loadConfigFileWithImports_fn).call(this, filepath, contents, importStack));
|
|
4622
|
+
};
|
|
4623
|
+
loadConfigFileWithImports_fn = function(filepath, contents, importStack) {
|
|
4624
|
+
const loadedContent = __privateMethod(this, _ExplorerSync_instances, loadConfiguration_fn).call(this, filepath, contents);
|
|
4625
|
+
if (!loadedContent || !(0, merge_1.hasOwn)(loadedContent, "$import")) {
|
|
4626
|
+
return loadedContent;
|
|
4627
|
+
}
|
|
4628
|
+
const fileDirectory = path_1.default.dirname(filepath);
|
|
4629
|
+
const { $import: imports, ...ownContent } = loadedContent;
|
|
4630
|
+
const importPaths = Array.isArray(imports) ? imports : [imports];
|
|
4631
|
+
const newImportStack = [...importStack, filepath];
|
|
4632
|
+
this.validateImports(filepath, importPaths, newImportStack);
|
|
4633
|
+
const importedConfigs = importPaths.map((importPath) => {
|
|
4634
|
+
const fullPath = path_1.default.resolve(fileDirectory, importPath);
|
|
4635
|
+
const result = __privateMethod(this, _ExplorerSync_instances, readConfiguration_fn).call(this, fullPath, newImportStack);
|
|
4636
|
+
return result?.config;
|
|
4637
|
+
});
|
|
4638
|
+
return (0, merge_1.mergeAll)([...importedConfigs, ownContent], {
|
|
4639
|
+
mergeArrays: this.config.mergeImportArrays
|
|
4640
|
+
});
|
|
4641
|
+
};
|
|
4642
|
+
loadConfiguration_fn = function(filepath, contents) {
|
|
4643
|
+
if (contents.trim() === "") {
|
|
4644
|
+
return;
|
|
4645
|
+
}
|
|
4646
|
+
const extension = path_1.default.extname(filepath);
|
|
4647
|
+
const loader = this.config.loaders[extension || "noExt"] ?? this.config.loaders["default"];
|
|
4648
|
+
if (!loader) {
|
|
4649
|
+
throw new Error(`No loader specified for ${(0, ExplorerBase_js_1.getExtensionDescription)(extension)}`);
|
|
4650
|
+
}
|
|
4651
|
+
try {
|
|
4652
|
+
const loadedContents = loader(filepath, contents);
|
|
4653
|
+
if (path_1.default.basename(filepath, extension) !== "package") {
|
|
4654
|
+
return loadedContents;
|
|
4655
|
+
}
|
|
4656
|
+
return (0, util_js_1.getPropertyByPath)(loadedContents, this.config.packageProp ?? this.config.moduleName) ?? null;
|
|
4657
|
+
} catch (error) {
|
|
4658
|
+
error.filepath = filepath;
|
|
4659
|
+
throw error;
|
|
4660
|
+
}
|
|
4661
|
+
};
|
|
4662
|
+
fileExists_fn = function(path) {
|
|
4663
|
+
try {
|
|
4664
|
+
fs_1.default.statSync(path);
|
|
4665
|
+
return true;
|
|
4666
|
+
} catch (e) {
|
|
4667
|
+
return false;
|
|
4668
|
+
}
|
|
4669
|
+
};
|
|
4670
|
+
getDirs_fn = function* (startDir) {
|
|
4671
|
+
switch (this.config.searchStrategy) {
|
|
4672
|
+
case "none": {
|
|
4673
|
+
yield { path: startDir, isGlobalConfig: false };
|
|
4674
|
+
return;
|
|
4675
|
+
}
|
|
4676
|
+
case "project": {
|
|
4677
|
+
let currentDir = startDir;
|
|
4678
|
+
while (true) {
|
|
4679
|
+
yield { path: currentDir, isGlobalConfig: false };
|
|
4680
|
+
for (const ext of ["json", "yaml"]) {
|
|
4681
|
+
const packageFile = path_1.default.join(currentDir, `package.${ext}`);
|
|
4682
|
+
if (__privateMethod(this, _ExplorerSync_instances, fileExists_fn).call(this, packageFile)) {
|
|
4683
|
+
break;
|
|
4684
|
+
}
|
|
4685
|
+
}
|
|
4686
|
+
const parentDir = path_1.default.dirname(currentDir);
|
|
4687
|
+
if (parentDir === currentDir) {
|
|
4688
|
+
break;
|
|
4689
|
+
}
|
|
4690
|
+
currentDir = parentDir;
|
|
4691
|
+
}
|
|
4692
|
+
return;
|
|
4693
|
+
}
|
|
4694
|
+
case "global": {
|
|
4695
|
+
yield* this.getGlobalDirs(startDir);
|
|
4696
|
+
}
|
|
4697
|
+
}
|
|
4698
|
+
};
|
|
4699
|
+
exports.ExplorerSync = ExplorerSync;
|
|
4700
|
+
}
|
|
4701
|
+
});
|
|
4702
|
+
|
|
4703
|
+
// node_modules/cosmiconfig/dist/index.js
|
|
4704
|
+
var require_dist = __commonJS({
|
|
4705
|
+
"node_modules/cosmiconfig/dist/index.js"(exports) {
|
|
4706
|
+
"use strict";
|
|
4707
|
+
init_esm_shims();
|
|
4708
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4709
|
+
exports.defaultLoadersSync = exports.defaultLoaders = exports.globalConfigSearchPlacesSync = exports.globalConfigSearchPlaces = exports.getDefaultSearchPlacesSync = exports.getDefaultSearchPlaces = exports.cosmiconfigSync = exports.cosmiconfig = void 0;
|
|
4710
|
+
var defaults_1 = require_defaults();
|
|
4711
|
+
Object.defineProperty(exports, "defaultLoaders", { enumerable: true, get: function() {
|
|
4712
|
+
return defaults_1.defaultLoaders;
|
|
4713
|
+
} });
|
|
4714
|
+
Object.defineProperty(exports, "defaultLoadersSync", { enumerable: true, get: function() {
|
|
4715
|
+
return defaults_1.defaultLoadersSync;
|
|
4716
|
+
} });
|
|
4717
|
+
Object.defineProperty(exports, "getDefaultSearchPlaces", { enumerable: true, get: function() {
|
|
4718
|
+
return defaults_1.getDefaultSearchPlaces;
|
|
4719
|
+
} });
|
|
4720
|
+
Object.defineProperty(exports, "getDefaultSearchPlacesSync", { enumerable: true, get: function() {
|
|
4721
|
+
return defaults_1.getDefaultSearchPlacesSync;
|
|
4722
|
+
} });
|
|
4723
|
+
Object.defineProperty(exports, "globalConfigSearchPlaces", { enumerable: true, get: function() {
|
|
4724
|
+
return defaults_1.globalConfigSearchPlaces;
|
|
4725
|
+
} });
|
|
4726
|
+
Object.defineProperty(exports, "globalConfigSearchPlacesSync", { enumerable: true, get: function() {
|
|
4727
|
+
return defaults_1.globalConfigSearchPlacesSync;
|
|
4728
|
+
} });
|
|
4729
|
+
var Explorer_js_1 = require_Explorer();
|
|
4730
|
+
var ExplorerSync_js_1 = require_ExplorerSync();
|
|
4731
|
+
var util_1 = require_util();
|
|
4732
|
+
var identity = function identity2(x) {
|
|
4733
|
+
return x;
|
|
4734
|
+
};
|
|
4735
|
+
function getUserDefinedOptionsFromMetaConfig() {
|
|
4736
|
+
const metaExplorer = new ExplorerSync_js_1.ExplorerSync({
|
|
4737
|
+
moduleName: "cosmiconfig",
|
|
4738
|
+
stopDir: process.cwd(),
|
|
4739
|
+
searchPlaces: defaults_1.metaSearchPlaces,
|
|
4740
|
+
ignoreEmptySearchPlaces: false,
|
|
4741
|
+
applyPackagePropertyPathToConfiguration: true,
|
|
4742
|
+
loaders: defaults_1.defaultLoaders,
|
|
4743
|
+
transform: identity,
|
|
4744
|
+
cache: true,
|
|
4745
|
+
metaConfigFilePath: null,
|
|
4746
|
+
mergeImportArrays: true,
|
|
4747
|
+
mergeSearchPlaces: true,
|
|
4748
|
+
searchStrategy: "none"
|
|
4749
|
+
});
|
|
4750
|
+
const metaConfig = metaExplorer.search();
|
|
4751
|
+
if (!metaConfig) {
|
|
4752
|
+
return null;
|
|
4753
|
+
}
|
|
4754
|
+
if (metaConfig.config?.loaders) {
|
|
4755
|
+
throw new Error("Can not specify loaders in meta config file");
|
|
4756
|
+
}
|
|
4757
|
+
if (metaConfig.config?.searchStrategy) {
|
|
4758
|
+
throw new Error("Can not specify searchStrategy in meta config file");
|
|
4759
|
+
}
|
|
4760
|
+
const overrideOptions = {
|
|
4761
|
+
mergeSearchPlaces: true,
|
|
4762
|
+
...metaConfig.config ?? {}
|
|
4763
|
+
};
|
|
4764
|
+
return {
|
|
4765
|
+
config: (0, util_1.removeUndefinedValuesFromObject)(overrideOptions),
|
|
4766
|
+
filepath: metaConfig.filepath
|
|
4767
|
+
};
|
|
4768
|
+
}
|
|
4769
|
+
function getResolvedSearchPlaces(moduleName, toolDefinedSearchPlaces, userConfiguredOptions) {
|
|
4770
|
+
const userConfiguredSearchPlaces = userConfiguredOptions.searchPlaces?.map((path) => path.replace("{name}", moduleName));
|
|
4771
|
+
if (userConfiguredOptions.mergeSearchPlaces) {
|
|
4772
|
+
return [...userConfiguredSearchPlaces ?? [], ...toolDefinedSearchPlaces];
|
|
4773
|
+
}
|
|
4774
|
+
return userConfiguredSearchPlaces ?? /* istanbul ignore next */
|
|
4775
|
+
toolDefinedSearchPlaces;
|
|
4776
|
+
}
|
|
4777
|
+
function mergeOptionsBase(moduleName, defaults, options) {
|
|
4778
|
+
const userDefinedConfig = getUserDefinedOptionsFromMetaConfig();
|
|
4779
|
+
if (!userDefinedConfig) {
|
|
4780
|
+
return {
|
|
4781
|
+
...defaults,
|
|
4782
|
+
...(0, util_1.removeUndefinedValuesFromObject)(options),
|
|
4783
|
+
loaders: {
|
|
4784
|
+
...defaults.loaders,
|
|
4785
|
+
...options.loaders
|
|
4786
|
+
}
|
|
4787
|
+
};
|
|
4788
|
+
}
|
|
4789
|
+
const userConfiguredOptions = userDefinedConfig.config;
|
|
4790
|
+
const toolDefinedSearchPlaces = options.searchPlaces ?? defaults.searchPlaces;
|
|
4791
|
+
return {
|
|
4792
|
+
...defaults,
|
|
4793
|
+
...(0, util_1.removeUndefinedValuesFromObject)(options),
|
|
4794
|
+
metaConfigFilePath: userDefinedConfig.filepath,
|
|
4795
|
+
...userConfiguredOptions,
|
|
4796
|
+
searchPlaces: getResolvedSearchPlaces(moduleName, toolDefinedSearchPlaces, userConfiguredOptions),
|
|
4797
|
+
loaders: {
|
|
4798
|
+
...defaults.loaders,
|
|
4799
|
+
...options.loaders
|
|
4800
|
+
}
|
|
4801
|
+
};
|
|
4802
|
+
}
|
|
4803
|
+
function validateOptions(options) {
|
|
4804
|
+
if (options.searchStrategy != null && options.searchStrategy !== "global" && options.stopDir) {
|
|
4805
|
+
throw new Error('Can not supply `stopDir` option with `searchStrategy` other than "global"');
|
|
4806
|
+
}
|
|
4807
|
+
}
|
|
4808
|
+
function mergeOptions(moduleName, options) {
|
|
4809
|
+
validateOptions(options);
|
|
4810
|
+
const defaults = {
|
|
4811
|
+
moduleName,
|
|
4812
|
+
searchPlaces: (0, defaults_1.getDefaultSearchPlaces)(moduleName),
|
|
4813
|
+
ignoreEmptySearchPlaces: true,
|
|
4814
|
+
cache: true,
|
|
4815
|
+
transform: identity,
|
|
4816
|
+
loaders: defaults_1.defaultLoaders,
|
|
4817
|
+
metaConfigFilePath: null,
|
|
4818
|
+
mergeImportArrays: true,
|
|
4819
|
+
mergeSearchPlaces: true,
|
|
4820
|
+
searchStrategy: options.stopDir ? "global" : "none"
|
|
4821
|
+
};
|
|
4822
|
+
return mergeOptionsBase(moduleName, defaults, options);
|
|
4823
|
+
}
|
|
4824
|
+
function mergeOptionsSync(moduleName, options) {
|
|
4825
|
+
validateOptions(options);
|
|
4826
|
+
const defaults = {
|
|
4827
|
+
moduleName,
|
|
4828
|
+
searchPlaces: (0, defaults_1.getDefaultSearchPlacesSync)(moduleName),
|
|
4829
|
+
ignoreEmptySearchPlaces: true,
|
|
4830
|
+
cache: true,
|
|
4831
|
+
transform: identity,
|
|
4832
|
+
loaders: defaults_1.defaultLoadersSync,
|
|
4833
|
+
metaConfigFilePath: null,
|
|
4834
|
+
mergeImportArrays: true,
|
|
4835
|
+
mergeSearchPlaces: true,
|
|
4836
|
+
searchStrategy: options.stopDir ? "global" : "none"
|
|
4837
|
+
};
|
|
4838
|
+
return mergeOptionsBase(moduleName, defaults, options);
|
|
4839
|
+
}
|
|
4840
|
+
function cosmiconfig2(moduleName, options = {}) {
|
|
4841
|
+
const normalizedOptions = mergeOptions(moduleName, options);
|
|
4842
|
+
const explorer = new Explorer_js_1.Explorer(normalizedOptions);
|
|
4843
|
+
return {
|
|
4844
|
+
search: explorer.search.bind(explorer),
|
|
4845
|
+
load: explorer.load.bind(explorer),
|
|
4846
|
+
clearLoadCache: explorer.clearLoadCache.bind(explorer),
|
|
4847
|
+
clearSearchCache: explorer.clearSearchCache.bind(explorer),
|
|
4848
|
+
clearCaches: explorer.clearCaches.bind(explorer)
|
|
4849
|
+
};
|
|
4850
|
+
}
|
|
4851
|
+
exports.cosmiconfig = cosmiconfig2;
|
|
4852
|
+
function cosmiconfigSync(moduleName, options = {}) {
|
|
4853
|
+
const normalizedOptions = mergeOptionsSync(moduleName, options);
|
|
4854
|
+
const explorerSync = new ExplorerSync_js_1.ExplorerSync(normalizedOptions);
|
|
4855
|
+
return {
|
|
4856
|
+
search: explorerSync.search.bind(explorerSync),
|
|
4857
|
+
load: explorerSync.load.bind(explorerSync),
|
|
4858
|
+
clearLoadCache: explorerSync.clearLoadCache.bind(explorerSync),
|
|
4859
|
+
clearSearchCache: explorerSync.clearSearchCache.bind(explorerSync),
|
|
4860
|
+
clearCaches: explorerSync.clearCaches.bind(explorerSync)
|
|
4861
|
+
};
|
|
4862
|
+
}
|
|
4863
|
+
exports.cosmiconfigSync = cosmiconfigSync;
|
|
4864
|
+
}
|
|
4865
|
+
});
|
|
4866
|
+
|
|
4867
|
+
// src/config.ts
|
|
4868
|
+
init_esm_shims();
|
|
4869
|
+
var import_cosmiconfig = __toESM(require_dist());
|
|
4870
|
+
async function loadConfig() {
|
|
4871
|
+
const explorer = (0, import_cosmiconfig.cosmiconfig)("stacksync");
|
|
4872
|
+
const result = await explorer.search();
|
|
4873
|
+
return result?.config || {
|
|
4874
|
+
ignore: [],
|
|
4875
|
+
aliases: {},
|
|
4876
|
+
logosPath: "/public/tech/"
|
|
4877
|
+
};
|
|
4878
|
+
}
|
|
4879
|
+
|
|
4880
|
+
export {
|
|
4881
|
+
loadConfig
|
|
4882
|
+
};
|
|
4883
|
+
/*! Bundled license information:
|
|
4884
|
+
|
|
4885
|
+
cosmiconfig/dist/loaders.js:
|
|
4886
|
+
cosmiconfig/dist/util.js:
|
|
4887
|
+
(* istanbul ignore next -- @preserve *)
|
|
4888
|
+
|
|
4889
|
+
cosmiconfig/dist/ExplorerBase.js:
|
|
4890
|
+
(* istanbul ignore if -- @preserve *)
|
|
4891
|
+
(* istanbul ignore next -- @preserve *)
|
|
4892
|
+
|
|
4893
|
+
cosmiconfig/dist/Explorer.js:
|
|
4894
|
+
cosmiconfig/dist/ExplorerSync.js:
|
|
4895
|
+
(* istanbul ignore if -- @preserve *)
|
|
4896
|
+
*/
|