prismic-ts-codegen 0.1.23 → 0.1.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_node_modules/@babel/code-frame/lib/index.cjs +101 -28
- package/dist/_node_modules/@babel/code-frame/lib/index.cjs.map +1 -1
- package/dist/_node_modules/@babel/code-frame/lib/index.js +102 -29
- package/dist/_node_modules/@babel/code-frame/lib/index.js.map +1 -1
- package/dist/_node_modules/@babel/helper-validator-identifier/lib/identifier.cjs +4 -4
- package/dist/_node_modules/@babel/helper-validator-identifier/lib/identifier.cjs.map +1 -1
- package/dist/_node_modules/@babel/helper-validator-identifier/lib/identifier.js +4 -4
- package/dist/_node_modules/@babel/helper-validator-identifier/lib/identifier.js.map +1 -1
- package/dist/_node_modules/@babel/helper-validator-identifier/lib/index.cjs +1 -1
- package/dist/_node_modules/@babel/helper-validator-identifier/lib/index.cjs.map +1 -1
- package/dist/_node_modules/@babel/helper-validator-identifier/lib/index.js +1 -1
- package/dist/_node_modules/@babel/helper-validator-identifier/lib/index.js.map +1 -1
- package/dist/_node_modules/@prismicio/client/dist/Client.cjs.map +1 -1
- package/dist/_node_modules/@prismicio/client/dist/Client.js.map +1 -1
- package/dist/_node_modules/@prismicio/client/dist/buildQueryURL.cjs.map +1 -1
- package/dist/_node_modules/@prismicio/client/dist/buildQueryURL.js.map +1 -1
- package/dist/_node_modules/@prismicio/client/dist/filter.cjs.map +1 -1
- package/dist/_node_modules/@prismicio/client/dist/filter.js.map +1 -1
- package/dist/_node_modules/@prismicio/client/dist/getRepositoryEndpoint.cjs.map +1 -1
- package/dist/_node_modules/@prismicio/client/dist/getRepositoryEndpoint.js.map +1 -1
- package/dist/_node_modules/@prismicio/client/dist/getRepositoryName.cjs.map +1 -1
- package/dist/_node_modules/@prismicio/client/dist/getRepositoryName.js.map +1 -1
- package/dist/_node_modules/@prismicio/client/dist/lib/devMsg.cjs.map +1 -1
- package/dist/_node_modules/@prismicio/client/dist/lib/devMsg.js.map +1 -1
- package/dist/_node_modules/@prismicio/client/dist/package.json.cjs +1 -1
- package/dist/_node_modules/@prismicio/client/dist/package.json.cjs.map +1 -1
- package/dist/_node_modules/@prismicio/client/dist/package.json.js +1 -1
- package/dist/_node_modules/@prismicio/client/dist/package.json.js.map +1 -1
- package/dist/_node_modules/camelcase-keys/index.cjs.map +1 -1
- package/dist/_node_modules/camelcase-keys/index.js.map +1 -1
- package/dist/_node_modules/data-uri-to-buffer/dist/index.cjs.map +1 -1
- package/dist/_node_modules/data-uri-to-buffer/dist/index.js.map +1 -1
- package/dist/_node_modules/decamelize/index.cjs.map +1 -1
- package/dist/_node_modules/decamelize/index.js.map +1 -1
- package/dist/_node_modules/decamelize-keys/index.cjs.map +1 -1
- package/dist/_node_modules/decamelize-keys/index.js.map +1 -1
- package/dist/_node_modules/fetch-blob/file.cjs.map +1 -1
- package/dist/_node_modules/fetch-blob/file.js.map +1 -1
- package/dist/_node_modules/fetch-blob/index.cjs.map +1 -1
- package/dist/_node_modules/fetch-blob/index.js.map +1 -1
- package/dist/_node_modules/formdata-polyfill/esm.min.cjs.map +1 -1
- package/dist/_node_modules/formdata-polyfill/esm.min.js.map +1 -1
- package/dist/_node_modules/hard-rejection/index.cjs.map +1 -1
- package/dist/_node_modules/hard-rejection/index.js.map +1 -1
- package/dist/_node_modules/hosted-git-info/lib/from-url.cjs.map +1 -1
- package/dist/_node_modules/hosted-git-info/lib/from-url.js.map +1 -1
- package/dist/_node_modules/hosted-git-info/lib/hosts.cjs +1 -1
- package/dist/_node_modules/hosted-git-info/lib/hosts.cjs.map +1 -1
- package/dist/_node_modules/hosted-git-info/lib/hosts.js +1 -1
- package/dist/_node_modules/hosted-git-info/lib/hosts.js.map +1 -1
- package/dist/_node_modules/hosted-git-info/lib/index.cjs +4 -4
- package/dist/_node_modules/hosted-git-info/lib/index.cjs.map +1 -1
- package/dist/_node_modules/hosted-git-info/lib/index.js +4 -4
- package/dist/_node_modules/hosted-git-info/lib/index.js.map +1 -1
- package/dist/_node_modules/hosted-git-info/lib/parse-url.cjs.map +1 -1
- package/dist/_node_modules/hosted-git-info/lib/parse-url.js.map +1 -1
- package/dist/_node_modules/indent-string/index.cjs.map +1 -1
- package/dist/_node_modules/indent-string/index.js.map +1 -1
- package/dist/_node_modules/js-tokens/index.cjs +1 -1
- package/dist/_node_modules/js-tokens/index.js +1 -1
- package/dist/_node_modules/json-parse-even-better-errors/index.cjs.map +1 -1
- package/dist/_node_modules/json-parse-even-better-errors/index.js.map +1 -1
- package/dist/_node_modules/lru-cache/index.cjs.map +1 -1
- package/dist/_node_modules/lru-cache/index.js.map +1 -1
- package/dist/_node_modules/map-obj/index.cjs.map +1 -1
- package/dist/_node_modules/map-obj/index.js.map +1 -1
- package/dist/_node_modules/meow/source/index.cjs.map +1 -1
- package/dist/_node_modules/meow/source/index.js.map +1 -1
- package/dist/_node_modules/meow/source/options.cjs.map +1 -1
- package/dist/_node_modules/meow/source/options.js.map +1 -1
- package/dist/_node_modules/meow/source/parser.cjs.map +1 -1
- package/dist/_node_modules/meow/source/parser.js.map +1 -1
- package/dist/_node_modules/meow/source/utils.cjs.map +1 -1
- package/dist/_node_modules/meow/source/utils.js.map +1 -1
- package/dist/_node_modules/meow/source/validate.cjs.map +1 -1
- package/dist/_node_modules/meow/source/validate.js.map +1 -1
- package/dist/_node_modules/minimist-options/index.cjs.map +1 -1
- package/dist/_node_modules/minimist-options/index.js.map +1 -1
- package/dist/_node_modules/node-fetch/src/body.cjs.map +1 -1
- package/dist/_node_modules/node-fetch/src/body.js.map +1 -1
- package/dist/_node_modules/node-fetch/src/headers.cjs.map +1 -1
- package/dist/_node_modules/node-fetch/src/headers.js.map +1 -1
- package/dist/_node_modules/node-fetch/src/index.cjs.map +1 -1
- package/dist/_node_modules/node-fetch/src/index.js.map +1 -1
- package/dist/_node_modules/node-fetch/src/request.cjs +0 -3
- package/dist/_node_modules/node-fetch/src/request.cjs.map +1 -1
- package/dist/_node_modules/node-fetch/src/request.js +0 -3
- package/dist/_node_modules/node-fetch/src/request.js.map +1 -1
- package/dist/_node_modules/node-fetch/src/utils/is.cjs.map +1 -1
- package/dist/_node_modules/node-fetch/src/utils/is.js.map +1 -1
- package/dist/_node_modules/node-fetch/src/utils/multipart-parser.cjs.map +1 -1
- package/dist/_node_modules/node-fetch/src/utils/multipart-parser.js.map +1 -1
- package/dist/_node_modules/node-fetch/src/utils/referrer.cjs.map +1 -1
- package/dist/_node_modules/node-fetch/src/utils/referrer.js.map +1 -1
- package/dist/_node_modules/picocolors/picocolors.browser.cjs +12 -0
- package/dist/_node_modules/picocolors/picocolors.browser.cjs.map +1 -0
- package/dist/_node_modules/picocolors/picocolors.browser.js +12 -0
- package/dist/_node_modules/picocolors/picocolors.browser.js.map +1 -0
- package/dist/_node_modules/quick-lru/index.cjs +1 -0
- package/dist/_node_modules/quick-lru/index.cjs.map +1 -1
- package/dist/_node_modules/quick-lru/index.js +1 -0
- package/dist/_node_modules/quick-lru/index.js.map +1 -1
- package/dist/_node_modules/read-pkg/_node_modules/hosted-git-info/git-host-info.cjs.map +1 -1
- package/dist/_node_modules/read-pkg/_node_modules/hosted-git-info/git-host-info.js.map +1 -1
- package/dist/_node_modules/read-pkg/_node_modules/hosted-git-info/git-host.cjs.map +1 -1
- package/dist/_node_modules/read-pkg/_node_modules/hosted-git-info/git-host.js.map +1 -1
- package/dist/_node_modules/read-pkg/_node_modules/hosted-git-info/index.cjs +1 -1
- package/dist/_node_modules/read-pkg/_node_modules/hosted-git-info/index.cjs.map +1 -1
- package/dist/_node_modules/read-pkg/_node_modules/hosted-git-info/index.js +1 -1
- package/dist/_node_modules/read-pkg/_node_modules/hosted-git-info/index.js.map +1 -1
- package/dist/_node_modules/read-pkg-up/_node_modules/locate-path/index.cjs.map +1 -1
- package/dist/_node_modules/read-pkg-up/_node_modules/locate-path/index.js.map +1 -1
- package/dist/_node_modules/semver/classes/semver.cjs.map +1 -1
- package/dist/_node_modules/semver/classes/semver.js.map +1 -1
- package/dist/_node_modules/semver/internal/re.cjs.map +1 -1
- package/dist/_node_modules/semver/internal/re.js.map +1 -1
- package/dist/_node_modules/strip-indent/index.cjs.map +1 -1
- package/dist/_node_modules/strip-indent/index.js.map +1 -1
- package/dist/_node_modules/web-streams-polyfill/dist/ponyfill.es2018.cjs.map +1 -1
- package/dist/_node_modules/web-streams-polyfill/dist/ponyfill.es2018.js.map +1 -1
- package/dist/_node_modules/yargs-parser/build/lib/index.cjs.map +1 -1
- package/dist/_node_modules/yargs-parser/build/lib/index.js.map +1 -1
- package/dist/_node_modules/yargs-parser/build/lib/string-utils.cjs.map +1 -1
- package/dist/_node_modules/yargs-parser/build/lib/string-utils.js.map +1 -1
- package/dist/_node_modules/yargs-parser/build/lib/yargs-parser.cjs.map +1 -1
- package/dist/_node_modules/yargs-parser/build/lib/yargs-parser.js.map +1 -1
- package/dist/_virtual/index6.cjs +2 -2
- package/dist/_virtual/index6.js +2 -2
- package/dist/_virtual/index7.cjs +2 -2
- package/dist/_virtual/index7.js +2 -2
- package/dist/_virtual/index8.cjs +2 -2
- package/dist/_virtual/index8.js +2 -2
- package/dist/_virtual/picocolors.browser.cjs +5 -0
- package/dist/_virtual/picocolors.browser.cjs.map +1 -0
- package/dist/_virtual/picocolors.browser.js +5 -0
- package/dist/_virtual/picocolors.browser.js.map +1 -0
- package/dist/cli/loadConfig.cjs.map +1 -1
- package/dist/cli/loadConfig.js.map +1 -1
- package/dist/cli/loadLocaleIDs.cjs.map +1 -1
- package/dist/cli/loadLocaleIDs.js.map +1 -1
- package/dist/cli/loadModels.cjs.map +1 -1
- package/dist/cli/loadModels.js.map +1 -1
- package/dist/cli.cjs +2 -1
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/detectTypesProvider.cjs.map +1 -1
- package/dist/detectTypesProvider.js.map +1 -1
- package/dist/generateTypes.cjs.map +1 -1
- package/dist/generateTypes.js.map +1 -1
- package/dist/lib/addBlankLine.cjs.map +1 -1
- package/dist/lib/addBlankLine.js.map +1 -1
- package/dist/lib/addTrailingNewLine.cjs.map +1 -1
- package/dist/lib/addTrailingNewLine.js.map +1 -1
- package/dist/lib/buildCustomTypeDataType.cjs.map +1 -1
- package/dist/lib/buildCustomTypeDataType.js.map +1 -1
- package/dist/lib/buildCustomTypeType.cjs.map +1 -1
- package/dist/lib/buildCustomTypeType.js.map +1 -1
- package/dist/lib/buildFieldDocs.cjs.map +1 -1
- package/dist/lib/buildFieldDocs.js.map +1 -1
- package/dist/lib/buildFieldProperties.cjs +6 -2
- package/dist/lib/buildFieldProperties.cjs.map +1 -1
- package/dist/lib/buildFieldProperties.js +6 -2
- package/dist/lib/buildFieldProperties.js.map +1 -1
- package/dist/lib/buildSharedSliceType.cjs.map +1 -1
- package/dist/lib/buildSharedSliceType.js.map +1 -1
- package/dist/lib/buildTypeName.cjs.map +1 -1
- package/dist/lib/buildTypeName.js.map +1 -1
- package/dist/lib/getAPIIDPath.cjs.map +1 -1
- package/dist/lib/getAPIIDPath.js.map +1 -1
- package/dist/lib/getHumanReadableModelName.cjs.map +1 -1
- package/dist/lib/getHumanReadableModelName.js.map +1 -1
- package/dist/lib/getHumanReadablePath.cjs.map +1 -1
- package/dist/lib/getHumanReadablePath.js.map +1 -1
- package/package.json +15 -15
- package/src/lib/buildFieldProperties.ts +20 -4
- package/dist/_node_modules/@babel/highlight/lib/index.cjs +0 -100
- package/dist/_node_modules/@babel/highlight/lib/index.cjs.map +0 -1
- package/dist/_node_modules/@babel/highlight/lib/index.js +0 -99
- package/dist/_node_modules/@babel/highlight/lib/index.js.map +0 -1
- package/dist/_node_modules/ansi-styles/index.cjs +0 -146
- package/dist/_node_modules/ansi-styles/index.cjs.map +0 -1
- package/dist/_node_modules/ansi-styles/index.js +0 -146
- package/dist/_node_modules/ansi-styles/index.js.map +0 -1
- package/dist/_node_modules/chalk/index.cjs +0 -172
- package/dist/_node_modules/chalk/index.cjs.map +0 -1
- package/dist/_node_modules/chalk/index.js +0 -172
- package/dist/_node_modules/chalk/index.js.map +0 -1
- package/dist/_node_modules/chalk/templates.cjs +0 -108
- package/dist/_node_modules/chalk/templates.cjs.map +0 -1
- package/dist/_node_modules/chalk/templates.js +0 -108
- package/dist/_node_modules/chalk/templates.js.map +0 -1
- package/dist/_node_modules/color-convert/conversions.cjs +0 -710
- package/dist/_node_modules/color-convert/conversions.cjs.map +0 -1
- package/dist/_node_modules/color-convert/conversions.js +0 -710
- package/dist/_node_modules/color-convert/conversions.js.map +0 -1
- package/dist/_node_modules/color-convert/index.cjs +0 -59
- package/dist/_node_modules/color-convert/index.cjs.map +0 -1
- package/dist/_node_modules/color-convert/index.js +0 -59
- package/dist/_node_modules/color-convert/index.js.map +0 -1
- package/dist/_node_modules/color-convert/route.cjs +0 -69
- package/dist/_node_modules/color-convert/route.cjs.map +0 -1
- package/dist/_node_modules/color-convert/route.js +0 -69
- package/dist/_node_modules/color-convert/route.js.map +0 -1
- package/dist/_node_modules/color-name/index.cjs +0 -154
- package/dist/_node_modules/color-name/index.cjs.map +0 -1
- package/dist/_node_modules/color-name/index.js +0 -154
- package/dist/_node_modules/color-name/index.js.map +0 -1
- package/dist/_node_modules/escape-string-regexp/index.cjs +0 -11
- package/dist/_node_modules/escape-string-regexp/index.cjs.map +0 -1
- package/dist/_node_modules/escape-string-regexp/index.js +0 -11
- package/dist/_node_modules/escape-string-regexp/index.js.map +0 -1
- package/dist/_node_modules/supports-color/browser.cjs +0 -8
- package/dist/_node_modules/supports-color/browser.cjs.map +0 -1
- package/dist/_node_modules/supports-color/browser.js +0 -8
- package/dist/_node_modules/supports-color/browser.js.map +0 -1
- package/dist/_virtual/conversions.cjs +0 -5
- package/dist/_virtual/conversions.cjs.map +0 -1
- package/dist/_virtual/conversions.js +0 -5
- package/dist/_virtual/conversions.js.map +0 -1
- package/dist/_virtual/index10.cjs +0 -5
- package/dist/_virtual/index10.cjs.map +0 -1
- package/dist/_virtual/index10.js +0 -5
- package/dist/_virtual/index10.js.map +0 -1
- package/dist/_virtual/index11.cjs +0 -5
- package/dist/_virtual/index11.cjs.map +0 -1
- package/dist/_virtual/index11.js +0 -5
- package/dist/_virtual/index11.js.map +0 -1
- package/dist/_virtual/index9.cjs +0 -5
- package/dist/_virtual/index9.cjs.map +0 -1
- package/dist/_virtual/index9.js +0 -5
- package/dist/_virtual/index9.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hosts.js","sources":["../../../../node_modules/hosted-git-info/lib/hosts.js"],"sourcesContent":["/* eslint-disable max-len */\n\n'use strict'\n\nconst maybeJoin = (...args) => args.every(arg => arg) ? args.join('') : ''\nconst maybeEncode = (arg) => arg ? encodeURIComponent(arg) : ''\nconst formatHashFragment = (f) => f.toLowerCase().replace(/^\\W+|\\/|\\W+$/g, '').replace(/\\W+/g, '-')\n\nconst defaults = {\n sshtemplate: ({ domain, user, project, committish }) =>\n `git@${domain}:${user}/${project}.git${maybeJoin('#', committish)}`,\n sshurltemplate: ({ domain, user, project, committish }) =>\n `git+ssh://git@${domain}/${user}/${project}.git${maybeJoin('#', committish)}`,\n edittemplate: ({ domain, user, project, committish, editpath, path }) =>\n `https://${domain}/${user}/${project}${maybeJoin('/', editpath, '/', maybeEncode(committish || 'HEAD'), '/', path)}`,\n browsetemplate: ({ domain, user, project, committish, treepath }) =>\n `https://${domain}/${user}/${project}${maybeJoin('/', treepath, '/', maybeEncode(committish))}`,\n browsetreetemplate: ({ domain, user, project, committish, treepath, path, fragment, hashformat }) =>\n `https://${domain}/${user}/${project}/${treepath}/${maybeEncode(committish || 'HEAD')}/${path}${maybeJoin('#', hashformat(fragment || ''))}`,\n browseblobtemplate: ({ domain, user, project, committish, blobpath, path, fragment, hashformat }) =>\n `https://${domain}/${user}/${project}/${blobpath}/${maybeEncode(committish || 'HEAD')}/${path}${maybeJoin('#', hashformat(fragment || ''))}`,\n docstemplate: ({ domain, user, project, treepath, committish }) =>\n `https://${domain}/${user}/${project}${maybeJoin('/', treepath, '/', maybeEncode(committish))}#readme`,\n httpstemplate: ({ auth, domain, user, project, committish }) =>\n `git+https://${maybeJoin(auth, '@')}${domain}/${user}/${project}.git${maybeJoin('#', committish)}`,\n filetemplate: ({ domain, user, project, committish, path }) =>\n `https://${domain}/${user}/${project}/raw/${maybeEncode(committish || 'HEAD')}/${path}`,\n shortcuttemplate: ({ type, user, project, committish }) =>\n `${type}:${user}/${project}${maybeJoin('#', committish)}`,\n pathtemplate: ({ user, project, committish }) =>\n `${user}/${project}${maybeJoin('#', committish)}`,\n bugstemplate: ({ domain, user, project }) =>\n `https://${domain}/${user}/${project}/issues`,\n hashformat: formatHashFragment,\n}\n\nconst hosts = {}\nhosts.github = {\n // First two are insecure and generally shouldn't be used any more, but\n // they are still supported.\n protocols: ['git:', 'http:', 'git+ssh:', 'git+https:', 'ssh:', 'https:'],\n domain: 'github.com',\n treepath: 'tree',\n blobpath: 'blob',\n editpath: 'edit',\n filetemplate: ({ auth, user, project, committish, path }) =>\n `https://${maybeJoin(auth, '@')}raw.githubusercontent.com/${user}/${project}/${maybeEncode(committish || 'HEAD')}/${path}`,\n gittemplate: ({ auth, domain, user, project, committish }) =>\n `git://${maybeJoin(auth, '@')}${domain}/${user}/${project}.git${maybeJoin('#', committish)}`,\n tarballtemplate: ({ domain, user, project, committish }) =>\n `https://codeload.${domain}/${user}/${project}/tar.gz/${maybeEncode(committish || 'HEAD')}`,\n extract: (url) => {\n let [, user, project, type, committish] = url.pathname.split('/', 5)\n if (type && type !== 'tree') {\n return\n }\n\n if (!type) {\n committish = url.hash.slice(1)\n }\n\n if (project && project.endsWith('.git')) {\n project = project.slice(0, -4)\n }\n\n if (!user || !project) {\n return\n }\n\n return { user, project, committish }\n },\n}\n\nhosts.bitbucket = {\n protocols: ['git+ssh:', 'git+https:', 'ssh:', 'https:'],\n domain: 'bitbucket.org',\n treepath: 'src',\n blobpath: 'src',\n editpath: '?mode=edit',\n edittemplate: ({ domain, user, project, committish, treepath, path, editpath }) =>\n `https://${domain}/${user}/${project}${maybeJoin('/', treepath, '/', maybeEncode(committish || 'HEAD'), '/', path, editpath)}`,\n tarballtemplate: ({ domain, user, project, committish }) =>\n `https://${domain}/${user}/${project}/get/${maybeEncode(committish || 'HEAD')}.tar.gz`,\n extract: (url) => {\n let [, user, project, aux] = url.pathname.split('/', 4)\n if (['get'].includes(aux)) {\n return\n }\n\n if (project && project.endsWith('.git')) {\n project = project.slice(0, -4)\n }\n\n if (!user || !project) {\n return\n }\n\n return { user, project, committish: url.hash.slice(1) }\n },\n}\n\nhosts.gitlab = {\n protocols: ['git+ssh:', 'git+https:', 'ssh:', 'https:'],\n domain: 'gitlab.com',\n treepath: 'tree',\n blobpath: 'tree',\n editpath: '-/edit',\n httpstemplate: ({ auth, domain, user, project, committish }) =>\n `git+https://${maybeJoin(auth, '@')}${domain}/${user}/${project}.git${maybeJoin('#', committish)}`,\n tarballtemplate: ({ domain, user, project, committish }) =>\n `https://${domain}/${user}/${project}/repository/archive.tar.gz?ref=${maybeEncode(committish || 'HEAD')}`,\n extract: (url) => {\n const path = url.pathname.slice(1)\n if (path.includes('/-/') || path.includes('/archive.tar.gz')) {\n return\n }\n\n const segments = path.split('/')\n let project = segments.pop()\n if (project.endsWith('.git')) {\n project = project.slice(0, -4)\n }\n\n const user = segments.join('/')\n if (!user || !project) {\n return\n }\n\n return { user, project, committish: url.hash.slice(1) }\n },\n}\n\nhosts.gist = {\n protocols: ['git:', 'git+ssh:', 'git+https:', 'ssh:', 'https:'],\n domain: 'gist.github.com',\n editpath: 'edit',\n sshtemplate: ({ domain, project, committish }) =>\n `git@${domain}:${project}.git${maybeJoin('#', committish)}`,\n sshurltemplate: ({ domain, project, committish }) =>\n `git+ssh://git@${domain}/${project}.git${maybeJoin('#', committish)}`,\n edittemplate: ({ domain, user, project, committish, editpath }) =>\n `https://${domain}/${user}/${project}${maybeJoin('/', maybeEncode(committish))}/${editpath}`,\n browsetemplate: ({ domain, project, committish }) =>\n `https://${domain}/${project}${maybeJoin('/', maybeEncode(committish))}`,\n browsetreetemplate: ({ domain, project, committish, path, hashformat }) =>\n `https://${domain}/${project}${maybeJoin('/', maybeEncode(committish))}${maybeJoin('#', hashformat(path))}`,\n browseblobtemplate: ({ domain, project, committish, path, hashformat }) =>\n `https://${domain}/${project}${maybeJoin('/', maybeEncode(committish))}${maybeJoin('#', hashformat(path))}`,\n docstemplate: ({ domain, project, committish }) =>\n `https://${domain}/${project}${maybeJoin('/', maybeEncode(committish))}`,\n httpstemplate: ({ domain, project, committish }) =>\n `git+https://${domain}/${project}.git${maybeJoin('#', committish)}`,\n filetemplate: ({ user, project, committish, path }) =>\n `https://gist.githubusercontent.com/${user}/${project}/raw${maybeJoin('/', maybeEncode(committish))}/${path}`,\n shortcuttemplate: ({ type, project, committish }) =>\n `${type}:${project}${maybeJoin('#', committish)}`,\n pathtemplate: ({ project, committish }) =>\n `${project}${maybeJoin('#', committish)}`,\n bugstemplate: ({ domain, project }) =>\n `https://${domain}/${project}`,\n gittemplate: ({ domain, project, committish }) =>\n `git://${domain}/${project}.git${maybeJoin('#', committish)}`,\n tarballtemplate: ({ project, committish }) =>\n `https://codeload.github.com/gist/${project}/tar.gz/${maybeEncode(committish || 'HEAD')}`,\n extract: (url) => {\n let [, user, project, aux] = url.pathname.split('/', 4)\n if (aux === 'raw') {\n return\n }\n\n if (!project) {\n if (!user) {\n return\n }\n\n project = user\n user = null\n }\n\n if (project.endsWith('.git')) {\n project = project.slice(0, -4)\n }\n\n return { user, project, committish: url.hash.slice(1) }\n },\n hashformat: function (fragment) {\n return fragment && 'file-' + formatHashFragment(fragment)\n },\n}\n\nhosts.sourcehut = {\n protocols: ['git+ssh:', 'https:'],\n domain: 'git.sr.ht',\n treepath: 'tree',\n blobpath: 'tree',\n filetemplate: ({ domain, user, project, committish, path }) =>\n `https://${domain}/${user}/${project}/blob/${maybeEncode(committish) || 'HEAD'}/${path}`,\n httpstemplate: ({ domain, user, project, committish }) =>\n `https://${domain}/${user}/${project}.git${maybeJoin('#', committish)}`,\n tarballtemplate: ({ domain, user, project, committish }) =>\n `https://${domain}/${user}/${project}/archive/${maybeEncode(committish) || 'HEAD'}.tar.gz`,\n bugstemplate: ({ user, project }) =>\n `https://todo.sr.ht/${user}/${project}`,\n extract: (url) => {\n let [, user, project, aux] = url.pathname.split('/', 4)\n\n // tarball url\n if (['archive'].includes(aux)) {\n return\n }\n\n if (project && project.endsWith('.git')) {\n project = project.slice(0, -4)\n }\n\n if (!user || !project) {\n return\n }\n\n return { user, project, committish: url.hash.slice(1) }\n },\n}\n\nfor (const [name, host] of Object.entries(hosts)) {\n hosts[name] = Object.assign({}, defaults, host)\n}\n\nmodule.exports = hosts\n"],"names":[],"mappings":"AAIA,MAAM,YAAY,IAAI,SAAS,KAAK,MAAM,SAAO,GAAG,IAAI,KAAK,KAAK,EAAE,IAAI;AACxE,MAAM,cAAc,CAAC,QAAQ,MAAM,mBAAmB,GAAG,IAAI;AAC7D,MAAM,qBAAqB,CAAC,MAAM,EAAE,YAAW,EAAG,QAAQ,iBAAiB,EAAE,EAAE,QAAQ,QAAQ,GAAG;AAElG,MAAM,WAAW;AAAA,EACf,aAAa,CAAC,EAAE,QAAQ,MAAM,SAAS,WAAY,MACjD,OAAO,UAAU,QAAQ,cAAc,UAAU,KAAK,UAAU;AAAA,EAClE,gBAAgB,CAAC,EAAE,QAAQ,MAAM,SAAS,WAAY,MACpD,iBAAiB,UAAU,QAAQ,cAAc,UAAU,KAAK,UAAU;AAAA,EAC5E,cAAc,CAAC,EAAE,QAAQ,MAAM,SAAS,YAAY,UAAU,KAAM,MAClE,WAAW,UAAU,QAAQ,UAAU,UAAU,KAAK,UAAU,KAAK,YAAY,cAAc,MAAM,GAAG,KAAK,IAAI;AAAA,EACnH,gBAAgB,CAAC,EAAE,QAAQ,MAAM,SAAS,YAAY,SAAU,MAC9D,WAAW,UAAU,QAAQ,UAAU,UAAU,KAAK,UAAU,KAAK,YAAY,UAAU,CAAC;AAAA,EAC9F,oBAAoB,CAAC,EAAE,QA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QAAQ,MAAM,SAAS,WAAY,MACrD,WAAW,UAAU,QAAQ,mBAAmB,YAAY,UAAU,KAAK;AAAA,EAC7E,cAAc,CAAC,EAAE,MAAM,QAAS,MAC9B,sBAAsB,QAAQ;AAAA,EAChC,SAAS,CAAC,QAAQ;AAChB,QAAI,CAAG,EAAA,MAAM,SAAS,GAAG,IAAI,IAAI,SAAS,MAAM,KAAK,CAAC;AAGtD,QAAI,CAAC,SAAS,EAAE,SAAS,GAAG,GAAG;AAC7B;AAAA,IACD;AAED,QAAI,WAAW,QAAQ,SAAS,MAAM,GAAG;AACvC,gBAAU,QAAQ,MAAM,GAAG,EAAE;AAAA,IAC9B;AAED,QAAI,CAAC,QAAQ,CAAC,SAAS;AACrB;AAAA,IACD;AAED,WAAO,EAAE,MAAM,SAAS,YAAY,IAAI,KAAK,MAAM,CAAC,EAAG;AAAA,EACxD;AACH;AAEA,WAAW,CAAC,MAAM,IAAI,KAAK,OAAO,QAAQ,KAAK,GAAG;AAChD,QAAM,IAAI,IAAI,OAAO,OAAO,CAAE,GAAE,UAAU,IAAI;AAChD;AAEA,IAAA,UAAiB;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"hosts.js","sources":["../../../../node_modules/hosted-git-info/lib/hosts.js"],"sourcesContent":["/* eslint-disable max-len */\n\n'use strict'\n\nconst maybeJoin = (...args) => args.every(arg => arg) ? args.join('') : ''\nconst maybeEncode = (arg) => arg ? encodeURIComponent(arg) : ''\nconst formatHashFragment = (f) => f.toLowerCase()\n .replace(/^\\W+/g, '') // strip leading non-characters\n .replace(/(?<!\\W)\\W+$/, '') // strip trailing non-characters\n .replace(/\\//g, '') // strip all slashes\n .replace(/\\W+/g, '-') // replace remaining non-characters with '-'\n\nconst defaults = {\n sshtemplate: ({ domain, user, project, committish }) =>\n `git@${domain}:${user}/${project}.git${maybeJoin('#', committish)}`,\n sshurltemplate: ({ domain, user, project, committish }) =>\n `git+ssh://git@${domain}/${user}/${project}.git${maybeJoin('#', committish)}`,\n edittemplate: ({ domain, user, project, committish, editpath, path }) =>\n `https://${domain}/${user}/${project}${maybeJoin('/', editpath, '/', maybeEncode(committish || 'HEAD'), '/', path)}`,\n browsetemplate: ({ domain, user, project, committish, treepath }) =>\n `https://${domain}/${user}/${project}${maybeJoin('/', treepath, '/', maybeEncode(committish))}`,\n browsetreetemplate: ({ domain, user, project, committish, treepath, path, fragment, hashformat }) =>\n `https://${domain}/${user}/${project}/${treepath}/${maybeEncode(committish || 'HEAD')}/${path}${maybeJoin('#', hashformat(fragment || ''))}`,\n browseblobtemplate: ({ domain, user, project, committish, blobpath, path, fragment, hashformat }) =>\n `https://${domain}/${user}/${project}/${blobpath}/${maybeEncode(committish || 'HEAD')}/${path}${maybeJoin('#', hashformat(fragment || ''))}`,\n docstemplate: ({ domain, user, project, treepath, committish }) =>\n `https://${domain}/${user}/${project}${maybeJoin('/', treepath, '/', maybeEncode(committish))}#readme`,\n httpstemplate: ({ auth, domain, user, project, committish }) =>\n `git+https://${maybeJoin(auth, '@')}${domain}/${user}/${project}.git${maybeJoin('#', committish)}`,\n filetemplate: ({ domain, user, project, committish, path }) =>\n `https://${domain}/${user}/${project}/raw/${maybeEncode(committish || 'HEAD')}/${path}`,\n shortcuttemplate: ({ type, user, project, committish }) =>\n `${type}:${user}/${project}${maybeJoin('#', committish)}`,\n pathtemplate: ({ user, project, committish }) =>\n `${user}/${project}${maybeJoin('#', committish)}`,\n bugstemplate: ({ domain, user, project }) =>\n `https://${domain}/${user}/${project}/issues`,\n hashformat: formatHashFragment,\n}\n\nconst hosts = {}\nhosts.github = {\n // First two are insecure and generally shouldn't be used any more, but\n // they are still supported.\n protocols: ['git:', 'http:', 'git+ssh:', 'git+https:', 'ssh:', 'https:'],\n domain: 'github.com',\n treepath: 'tree',\n blobpath: 'blob',\n editpath: 'edit',\n filetemplate: ({ auth, user, project, committish, path }) =>\n `https://${maybeJoin(auth, '@')}raw.githubusercontent.com/${user}/${project}/${maybeEncode(committish || 'HEAD')}/${path}`,\n gittemplate: ({ auth, domain, user, project, committish }) =>\n `git://${maybeJoin(auth, '@')}${domain}/${user}/${project}.git${maybeJoin('#', committish)}`,\n tarballtemplate: ({ domain, user, project, committish }) =>\n `https://codeload.${domain}/${user}/${project}/tar.gz/${maybeEncode(committish || 'HEAD')}`,\n extract: (url) => {\n let [, user, project, type, committish] = url.pathname.split('/', 5)\n if (type && type !== 'tree') {\n return\n }\n\n if (!type) {\n committish = url.hash.slice(1)\n }\n\n if (project && project.endsWith('.git')) {\n project = project.slice(0, -4)\n }\n\n if (!user || !project) {\n return\n }\n\n return { user, project, committish }\n },\n}\n\nhosts.bitbucket = {\n protocols: ['git+ssh:', 'git+https:', 'ssh:', 'https:'],\n domain: 'bitbucket.org',\n treepath: 'src',\n blobpath: 'src',\n editpath: '?mode=edit',\n edittemplate: ({ domain, user, project, committish, treepath, path, editpath }) =>\n `https://${domain}/${user}/${project}${maybeJoin('/', treepath, '/', maybeEncode(committish || 'HEAD'), '/', path, editpath)}`,\n tarballtemplate: ({ domain, user, project, committish }) =>\n `https://${domain}/${user}/${project}/get/${maybeEncode(committish || 'HEAD')}.tar.gz`,\n extract: (url) => {\n let [, user, project, aux] = url.pathname.split('/', 4)\n if (['get'].includes(aux)) {\n return\n }\n\n if (project && project.endsWith('.git')) {\n project = project.slice(0, -4)\n }\n\n if (!user || !project) {\n return\n }\n\n return { user, project, committish: url.hash.slice(1) }\n },\n}\n\nhosts.gitlab = {\n protocols: ['git+ssh:', 'git+https:', 'ssh:', 'https:'],\n domain: 'gitlab.com',\n treepath: 'tree',\n blobpath: 'tree',\n editpath: '-/edit',\n httpstemplate: ({ auth, domain, user, project, committish }) =>\n `git+https://${maybeJoin(auth, '@')}${domain}/${user}/${project}.git${maybeJoin('#', committish)}`,\n tarballtemplate: ({ domain, user, project, committish }) =>\n `https://${domain}/${user}/${project}/repository/archive.tar.gz?ref=${maybeEncode(committish || 'HEAD')}`,\n extract: (url) => {\n const path = url.pathname.slice(1)\n if (path.includes('/-/') || path.includes('/archive.tar.gz')) {\n return\n }\n\n const segments = path.split('/')\n let project = segments.pop()\n if (project.endsWith('.git')) {\n project = project.slice(0, -4)\n }\n\n const user = segments.join('/')\n if (!user || !project) {\n return\n }\n\n return { user, project, committish: url.hash.slice(1) }\n },\n}\n\nhosts.gist = {\n protocols: ['git:', 'git+ssh:', 'git+https:', 'ssh:', 'https:'],\n domain: 'gist.github.com',\n editpath: 'edit',\n sshtemplate: ({ domain, project, committish }) =>\n `git@${domain}:${project}.git${maybeJoin('#', committish)}`,\n sshurltemplate: ({ domain, project, committish }) =>\n `git+ssh://git@${domain}/${project}.git${maybeJoin('#', committish)}`,\n edittemplate: ({ domain, user, project, committish, editpath }) =>\n `https://${domain}/${user}/${project}${maybeJoin('/', maybeEncode(committish))}/${editpath}`,\n browsetemplate: ({ domain, project, committish }) =>\n `https://${domain}/${project}${maybeJoin('/', maybeEncode(committish))}`,\n browsetreetemplate: ({ domain, project, committish, path, hashformat }) =>\n `https://${domain}/${project}${maybeJoin('/', maybeEncode(committish))}${maybeJoin('#', hashformat(path))}`,\n browseblobtemplate: ({ domain, project, committish, path, hashformat }) =>\n `https://${domain}/${project}${maybeJoin('/', maybeEncode(committish))}${maybeJoin('#', hashformat(path))}`,\n docstemplate: ({ domain, project, committish }) =>\n `https://${domain}/${project}${maybeJoin('/', maybeEncode(committish))}`,\n httpstemplate: ({ domain, project, committish }) =>\n `git+https://${domain}/${project}.git${maybeJoin('#', committish)}`,\n filetemplate: ({ user, project, committish, path }) =>\n `https://gist.githubusercontent.com/${user}/${project}/raw${maybeJoin('/', maybeEncode(committish))}/${path}`,\n shortcuttemplate: ({ type, project, committish }) =>\n `${type}:${project}${maybeJoin('#', committish)}`,\n pathtemplate: ({ project, committish }) =>\n `${project}${maybeJoin('#', committish)}`,\n bugstemplate: ({ domain, project }) =>\n `https://${domain}/${project}`,\n gittemplate: ({ domain, project, committish }) =>\n `git://${domain}/${project}.git${maybeJoin('#', committish)}`,\n tarballtemplate: ({ project, committish }) =>\n `https://codeload.github.com/gist/${project}/tar.gz/${maybeEncode(committish || 'HEAD')}`,\n extract: (url) => {\n let [, user, project, aux] = url.pathname.split('/', 4)\n if (aux === 'raw') {\n return\n }\n\n if (!project) {\n if (!user) {\n return\n }\n\n project = user\n user = null\n }\n\n if (project.endsWith('.git')) {\n project = project.slice(0, -4)\n }\n\n return { user, project, committish: url.hash.slice(1) }\n },\n hashformat: function (fragment) {\n return fragment && 'file-' + formatHashFragment(fragment)\n },\n}\n\nhosts.sourcehut = {\n protocols: ['git+ssh:', 'https:'],\n domain: 'git.sr.ht',\n treepath: 'tree',\n blobpath: 'tree',\n filetemplate: ({ domain, user, project, committish, path }) =>\n `https://${domain}/${user}/${project}/blob/${maybeEncode(committish) || 'HEAD'}/${path}`,\n httpstemplate: ({ domain, user, project, committish }) =>\n `https://${domain}/${user}/${project}.git${maybeJoin('#', committish)}`,\n tarballtemplate: ({ domain, user, project, committish }) =>\n `https://${domain}/${user}/${project}/archive/${maybeEncode(committish) || 'HEAD'}.tar.gz`,\n bugstemplate: ({ user, project }) =>\n `https://todo.sr.ht/${user}/${project}`,\n extract: (url) => {\n let [, user, project, aux] = url.pathname.split('/', 4)\n\n // tarball url\n if (['archive'].includes(aux)) {\n return\n }\n\n if (project && project.endsWith('.git')) {\n project = project.slice(0, -4)\n }\n\n if (!user || !project) {\n return\n }\n\n return { user, project, committish: url.hash.slice(1) }\n },\n}\n\nfor (const [name, host] of Object.entries(hosts)) {\n hosts[name] = Object.assign({}, defaults, host)\n}\n\nmodule.exports = hosts\n"],"names":[],"mappings":"AAIA,MAAM,YAAY,IAAI,SAAS,KAAK,MAAM,SAAO,GAAG,IAAI,KAAK,KAAK,EAAE,IAAI;AACxE,MAAM,cAAc,CAAC,QAAQ,MAAM,mBAAmB,GAAG,IAAI;AAC7D,MAAM,qBAAqB,CAAC,MAAM,EAAE,YAAa,EAC9C,QAAQ,SAAS,EAAE,EACnB,QAAQ,WAAa,eAAA,G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AS,YAAY,UAAU,KAAK,MAAM,IAAI,IAAI;AAAA,EACxF,eAAe,CAAC,EAAE,QAAQ,MAAM,SAAS,WAAY,MACnD,WAAW,MAAM,IAAI,IAAI,IAAI,OAAO,OAAO,UAAU,KAAK,UAAU,CAAC;AAAA,EACvE,iBAAiB,CAAC,EAAE,QAAQ,MAAM,SAAS,WAAY,MACrD,WAAW,MAAM,IAAI,IAAI,IAAI,OAAO,YAAY,YAAY,UAAU,KAAK,MAAM;AAAA,EACnF,cAAc,CAAC,EAAE,MAAM,QAAS,MAC9B,sBAAsB,IAAI,IAAI,OAAO;AAAA,EACvC,SAAS,CAAC,QAAQ;AAChB,QAAI,CAAG,EAAA,MAAM,SAAS,GAAG,IAAI,IAAI,SAAS,MAAM,KAAK,CAAC;AAGtD,QAAI,CAAC,SAAS,EAAE,SAAS,GAAG,GAAG;AAC7B;AAAA,IACD;AAED,QAAI,WAAW,QAAQ,SAAS,MAAM,GAAG;AACvC,gBAAU,QAAQ,MAAM,GAAG,EAAE;AAAA,IAC9B;AAED,QAAI,CAAC,QAAQ,CAAC,SAAS;AACrB;AAAA,IACD;AAED,WAAO,EAAE,MAAM,SAAS,YAAY,IAAI,KAAK,MAAM,CAAC,EAAG;AAAA,EACxD;AACH;AAEA,WAAW,CAAC,MAAM,IAAI,KAAK,OAAO,QAAQ,KAAK,GAAG;AAChD,QAAM,IAAI,IAAI,OAAO,OAAO,CAAE,GAAE,UAAU,IAAI;AAChD;AAEA,IAAA,UAAiB;","x_google_ignoreList":[0]}
|
|
@@ -27,7 +27,7 @@ const hosts = hosts$1.hosts_1;
|
|
|
27
27
|
const fromUrl = fromUrl$1.fromUrl;
|
|
28
28
|
const parseUrl = parseUrl$1.parseUrl;
|
|
29
29
|
const cache = new LRU({ max: 1e3 });
|
|
30
|
-
const _GitHost = class {
|
|
30
|
+
const _GitHost = class _GitHost {
|
|
31
31
|
constructor(type, user, auth, project, committish, defaultRepresentation, opts = {}) {
|
|
32
32
|
__privateAdd(this, _fill);
|
|
33
33
|
Object.assign(this, __privateGet(_GitHost, _gitHosts)[type], {
|
|
@@ -129,7 +129,6 @@ const _GitHost = class {
|
|
|
129
129
|
return this.sshurl(opts);
|
|
130
130
|
}
|
|
131
131
|
};
|
|
132
|
-
let GitHost = _GitHost;
|
|
133
132
|
_gitHosts = new WeakMap();
|
|
134
133
|
_protocols = new WeakMap();
|
|
135
134
|
_fill = new WeakSet();
|
|
@@ -150,8 +149,8 @@ fill_fn = function(template, opts) {
|
|
|
150
149
|
const result = template(options);
|
|
151
150
|
return options.noGitPlus && result.startsWith("git+") ? result.slice(4) : result;
|
|
152
151
|
};
|
|
153
|
-
__privateAdd(
|
|
154
|
-
__privateAdd(
|
|
152
|
+
__privateAdd(_GitHost, _gitHosts, { byShortcut: {}, byDomain: {} });
|
|
153
|
+
__privateAdd(_GitHost, _protocols, {
|
|
155
154
|
"git+ssh:": { name: "sshurl" },
|
|
156
155
|
"ssh:": { name: "sshurl" },
|
|
157
156
|
"git+https:": { name: "https", auth: true },
|
|
@@ -160,6 +159,7 @@ __privateAdd(GitHost, _protocols, {
|
|
|
160
159
|
"https:": { auth: true },
|
|
161
160
|
"git+http:": { auth: true }
|
|
162
161
|
});
|
|
162
|
+
let GitHost = _GitHost;
|
|
163
163
|
for (const [name, host] of Object.entries(hosts)) {
|
|
164
164
|
GitHost.addHost(name, host);
|
|
165
165
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../../node_modules/hosted-git-info/lib/index.js"],"sourcesContent":["'use strict'\n\nconst LRU = require('lru-cache')\nconst hosts = require('./hosts.js')\nconst fromUrl = require('./from-url.js')\nconst parseUrl = require('./parse-url.js')\n\nconst cache = new LRU({ max: 1000 })\n\nclass GitHost {\n constructor (type, user, auth, project, committish, defaultRepresentation, opts = {}) {\n Object.assign(this, GitHost.#gitHosts[type], {\n type,\n user,\n auth,\n project,\n committish,\n default: defaultRepresentation,\n opts,\n })\n }\n\n static #gitHosts = { byShortcut: {}, byDomain: {} }\n static #protocols = {\n 'git+ssh:': { name: 'sshurl' },\n 'ssh:': { name: 'sshurl' },\n 'git+https:': { name: 'https', auth: true },\n 'git:': { auth: true },\n 'http:': { auth: true },\n 'https:': { auth: true },\n 'git+http:': { auth: true },\n }\n\n static addHost (name, host) {\n GitHost.#gitHosts[name] = host\n GitHost.#gitHosts.byDomain[host.domain] = name\n GitHost.#gitHosts.byShortcut[`${name}:`] = name\n GitHost.#protocols[`${name}:`] = { name }\n }\n\n static fromUrl (giturl, opts) {\n if (typeof giturl !== 'string') {\n return\n }\n\n const key = giturl + JSON.stringify(opts || {})\n\n if (!cache.has(key)) {\n const hostArgs = fromUrl(giturl, opts, {\n gitHosts: GitHost.#gitHosts,\n protocols: GitHost.#protocols,\n })\n cache.set(key, hostArgs ? new GitHost(...hostArgs) : undefined)\n }\n\n return cache.get(key)\n }\n\n static parseUrl (url) {\n return parseUrl(url)\n }\n\n #fill (template, opts) {\n if (typeof template !== 'function') {\n return null\n }\n\n const options = { ...this, ...this.opts, ...opts }\n\n // the path should always be set so we don't end up with 'undefined' in urls\n if (!options.path) {\n options.path = ''\n }\n\n // template functions will insert the leading slash themselves\n if (options.path.startsWith('/')) {\n options.path = options.path.slice(1)\n }\n\n if (options.noCommittish) {\n options.committish = null\n }\n\n const result = template(options)\n return options.noGitPlus && result.startsWith('git+') ? result.slice(4) : result\n }\n\n hash () {\n return this.committish ? `#${this.committish}` : ''\n }\n\n ssh (opts) {\n return this.#fill(this.sshtemplate, opts)\n }\n\n sshurl (opts) {\n return this.#fill(this.sshurltemplate, opts)\n }\n\n browse (path, ...args) {\n // not a string, treat path as opts\n if (typeof path !== 'string') {\n return this.#fill(this.browsetemplate, path)\n }\n\n if (typeof args[0] !== 'string') {\n return this.#fill(this.browsetreetemplate, { ...args[0], path })\n }\n\n return this.#fill(this.browsetreetemplate, { ...args[1], fragment: args[0], path })\n }\n\n // If the path is known to be a file, then browseFile should be used. For some hosts\n // the url is the same as browse, but for others like GitHub a file can use both `/tree/`\n // and `/blob/` in the path. When using a default committish of `HEAD` then the `/tree/`\n // path will redirect to a specific commit. Using the `/blob/` path avoids this and\n // does not redirect to a different commit.\n browseFile (path, ...args) {\n if (typeof args[0] !== 'string') {\n return this.#fill(this.browseblobtemplate, { ...args[0], path })\n }\n\n return this.#fill(this.browseblobtemplate, { ...args[1], fragment: args[0], path })\n }\n\n docs (opts) {\n return this.#fill(this.docstemplate, opts)\n }\n\n bugs (opts) {\n return this.#fill(this.bugstemplate, opts)\n }\n\n https (opts) {\n return this.#fill(this.httpstemplate, opts)\n }\n\n git (opts) {\n return this.#fill(this.gittemplate, opts)\n }\n\n shortcut (opts) {\n return this.#fill(this.shortcuttemplate, opts)\n }\n\n path (opts) {\n return this.#fill(this.pathtemplate, opts)\n }\n\n tarball (opts) {\n return this.#fill(this.tarballtemplate, { ...opts, noCommittish: false })\n }\n\n file (path, opts) {\n return this.#fill(this.filetemplate, { ...opts, path })\n }\n\n edit (path, opts) {\n return this.#fill(this.edittemplate, { ...opts, path })\n }\n\n getDefaultRepresentation () {\n return this.default\n }\n\n toString (opts) {\n if (this.default && typeof this[this.default] === 'function') {\n return this[this.default](opts)\n }\n\n return this.sshurl(opts)\n }\n}\n\nfor (const [name, host] of Object.entries(hosts)) {\n GitHost.addHost(name, host)\n}\n\nmodule.exports = GitHost\n"],"names":["require$$0","require$$1","require$$2","require$$3"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAEA,MAAM,MAAMA,MAAoB;AAChC,MAAM,QAAQC,QAAqB;AACnC,MAAM,UAAUC,UAAwB;AACxC,MAAM,WAAWC,WAAyB;AAE1C,MAAM,QAAQ,IAAI,IAAI,EAAE,KAAK,IAAI,CAAE;AAEnC,MAAM,WAAN,
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../../node_modules/hosted-git-info/lib/index.js"],"sourcesContent":["'use strict'\n\nconst LRU = require('lru-cache')\nconst hosts = require('./hosts.js')\nconst fromUrl = require('./from-url.js')\nconst parseUrl = require('./parse-url.js')\n\nconst cache = new LRU({ max: 1000 })\n\nclass GitHost {\n constructor (type, user, auth, project, committish, defaultRepresentation, opts = {}) {\n Object.assign(this, GitHost.#gitHosts[type], {\n type,\n user,\n auth,\n project,\n committish,\n default: defaultRepresentation,\n opts,\n })\n }\n\n static #gitHosts = { byShortcut: {}, byDomain: {} }\n static #protocols = {\n 'git+ssh:': { name: 'sshurl' },\n 'ssh:': { name: 'sshurl' },\n 'git+https:': { name: 'https', auth: true },\n 'git:': { auth: true },\n 'http:': { auth: true },\n 'https:': { auth: true },\n 'git+http:': { auth: true },\n }\n\n static addHost (name, host) {\n GitHost.#gitHosts[name] = host\n GitHost.#gitHosts.byDomain[host.domain] = name\n GitHost.#gitHosts.byShortcut[`${name}:`] = name\n GitHost.#protocols[`${name}:`] = { name }\n }\n\n static fromUrl (giturl, opts) {\n if (typeof giturl !== 'string') {\n return\n }\n\n const key = giturl + JSON.stringify(opts || {})\n\n if (!cache.has(key)) {\n const hostArgs = fromUrl(giturl, opts, {\n gitHosts: GitHost.#gitHosts,\n protocols: GitHost.#protocols,\n })\n cache.set(key, hostArgs ? new GitHost(...hostArgs) : undefined)\n }\n\n return cache.get(key)\n }\n\n static parseUrl (url) {\n return parseUrl(url)\n }\n\n #fill (template, opts) {\n if (typeof template !== 'function') {\n return null\n }\n\n const options = { ...this, ...this.opts, ...opts }\n\n // the path should always be set so we don't end up with 'undefined' in urls\n if (!options.path) {\n options.path = ''\n }\n\n // template functions will insert the leading slash themselves\n if (options.path.startsWith('/')) {\n options.path = options.path.slice(1)\n }\n\n if (options.noCommittish) {\n options.committish = null\n }\n\n const result = template(options)\n return options.noGitPlus && result.startsWith('git+') ? result.slice(4) : result\n }\n\n hash () {\n return this.committish ? `#${this.committish}` : ''\n }\n\n ssh (opts) {\n return this.#fill(this.sshtemplate, opts)\n }\n\n sshurl (opts) {\n return this.#fill(this.sshurltemplate, opts)\n }\n\n browse (path, ...args) {\n // not a string, treat path as opts\n if (typeof path !== 'string') {\n return this.#fill(this.browsetemplate, path)\n }\n\n if (typeof args[0] !== 'string') {\n return this.#fill(this.browsetreetemplate, { ...args[0], path })\n }\n\n return this.#fill(this.browsetreetemplate, { ...args[1], fragment: args[0], path })\n }\n\n // If the path is known to be a file, then browseFile should be used. For some hosts\n // the url is the same as browse, but for others like GitHub a file can use both `/tree/`\n // and `/blob/` in the path. When using a default committish of `HEAD` then the `/tree/`\n // path will redirect to a specific commit. Using the `/blob/` path avoids this and\n // does not redirect to a different commit.\n browseFile (path, ...args) {\n if (typeof args[0] !== 'string') {\n return this.#fill(this.browseblobtemplate, { ...args[0], path })\n }\n\n return this.#fill(this.browseblobtemplate, { ...args[1], fragment: args[0], path })\n }\n\n docs (opts) {\n return this.#fill(this.docstemplate, opts)\n }\n\n bugs (opts) {\n return this.#fill(this.bugstemplate, opts)\n }\n\n https (opts) {\n return this.#fill(this.httpstemplate, opts)\n }\n\n git (opts) {\n return this.#fill(this.gittemplate, opts)\n }\n\n shortcut (opts) {\n return this.#fill(this.shortcuttemplate, opts)\n }\n\n path (opts) {\n return this.#fill(this.pathtemplate, opts)\n }\n\n tarball (opts) {\n return this.#fill(this.tarballtemplate, { ...opts, noCommittish: false })\n }\n\n file (path, opts) {\n return this.#fill(this.filetemplate, { ...opts, path })\n }\n\n edit (path, opts) {\n return this.#fill(this.edittemplate, { ...opts, path })\n }\n\n getDefaultRepresentation () {\n return this.default\n }\n\n toString (opts) {\n if (this.default && typeof this[this.default] === 'function') {\n return this[this.default](opts)\n }\n\n return this.sshurl(opts)\n }\n}\n\nfor (const [name, host] of Object.entries(hosts)) {\n GitHost.addHost(name, host)\n}\n\nmodule.exports = GitHost\n"],"names":["require$$0","require$$1","require$$2","require$$3"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAEA,MAAM,MAAMA,MAAoB;AAChC,MAAM,QAAQC,QAAqB;AACnC,MAAM,UAAUC,UAAwB;AACxC,MAAM,WAAWC,WAAyB;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,MAAM,KAAM;AAAA,EACtB,SAAS,EAAE,MAAM,KAAM;AAAA,EACvB,UAAU,EAAE,MAAM,KAAM;AAAA,EACxB,aAAa,EAAE,MAAM,KAAM;AAC5B;AAtBH,IAAM,UAAN;AAqKA,WAAW,CAAC,MAAM,IAAI,KAAK,OAAO,QAAQ,KAAK,GAAG;AAChD,UAAQ,QAAQ,MAAM,IAAI;AAC5B;AAEA,IAAA,MAAiB;;","x_google_ignoreList":[0]}
|
|
@@ -25,7 +25,7 @@ const hosts = hosts_1;
|
|
|
25
25
|
const fromUrl = fromUrl$1;
|
|
26
26
|
const parseUrl = parseUrl$1;
|
|
27
27
|
const cache = new LRU({ max: 1e3 });
|
|
28
|
-
const _GitHost = class {
|
|
28
|
+
const _GitHost = class _GitHost {
|
|
29
29
|
constructor(type, user, auth, project, committish, defaultRepresentation, opts = {}) {
|
|
30
30
|
__privateAdd(this, _fill);
|
|
31
31
|
Object.assign(this, __privateGet(_GitHost, _gitHosts)[type], {
|
|
@@ -127,7 +127,6 @@ const _GitHost = class {
|
|
|
127
127
|
return this.sshurl(opts);
|
|
128
128
|
}
|
|
129
129
|
};
|
|
130
|
-
let GitHost = _GitHost;
|
|
131
130
|
_gitHosts = new WeakMap();
|
|
132
131
|
_protocols = new WeakMap();
|
|
133
132
|
_fill = new WeakSet();
|
|
@@ -148,8 +147,8 @@ fill_fn = function(template, opts) {
|
|
|
148
147
|
const result = template(options);
|
|
149
148
|
return options.noGitPlus && result.startsWith("git+") ? result.slice(4) : result;
|
|
150
149
|
};
|
|
151
|
-
__privateAdd(
|
|
152
|
-
__privateAdd(
|
|
150
|
+
__privateAdd(_GitHost, _gitHosts, { byShortcut: {}, byDomain: {} });
|
|
151
|
+
__privateAdd(_GitHost, _protocols, {
|
|
153
152
|
"git+ssh:": { name: "sshurl" },
|
|
154
153
|
"ssh:": { name: "sshurl" },
|
|
155
154
|
"git+https:": { name: "https", auth: true },
|
|
@@ -158,6 +157,7 @@ __privateAdd(GitHost, _protocols, {
|
|
|
158
157
|
"https:": { auth: true },
|
|
159
158
|
"git+http:": { auth: true }
|
|
160
159
|
});
|
|
160
|
+
let GitHost = _GitHost;
|
|
161
161
|
for (const [name, host] of Object.entries(hosts)) {
|
|
162
162
|
GitHost.addHost(name, host);
|
|
163
163
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../node_modules/hosted-git-info/lib/index.js"],"sourcesContent":["'use strict'\n\nconst LRU = require('lru-cache')\nconst hosts = require('./hosts.js')\nconst fromUrl = require('./from-url.js')\nconst parseUrl = require('./parse-url.js')\n\nconst cache = new LRU({ max: 1000 })\n\nclass GitHost {\n constructor (type, user, auth, project, committish, defaultRepresentation, opts = {}) {\n Object.assign(this, GitHost.#gitHosts[type], {\n type,\n user,\n auth,\n project,\n committish,\n default: defaultRepresentation,\n opts,\n })\n }\n\n static #gitHosts = { byShortcut: {}, byDomain: {} }\n static #protocols = {\n 'git+ssh:': { name: 'sshurl' },\n 'ssh:': { name: 'sshurl' },\n 'git+https:': { name: 'https', auth: true },\n 'git:': { auth: true },\n 'http:': { auth: true },\n 'https:': { auth: true },\n 'git+http:': { auth: true },\n }\n\n static addHost (name, host) {\n GitHost.#gitHosts[name] = host\n GitHost.#gitHosts.byDomain[host.domain] = name\n GitHost.#gitHosts.byShortcut[`${name}:`] = name\n GitHost.#protocols[`${name}:`] = { name }\n }\n\n static fromUrl (giturl, opts) {\n if (typeof giturl !== 'string') {\n return\n }\n\n const key = giturl + JSON.stringify(opts || {})\n\n if (!cache.has(key)) {\n const hostArgs = fromUrl(giturl, opts, {\n gitHosts: GitHost.#gitHosts,\n protocols: GitHost.#protocols,\n })\n cache.set(key, hostArgs ? new GitHost(...hostArgs) : undefined)\n }\n\n return cache.get(key)\n }\n\n static parseUrl (url) {\n return parseUrl(url)\n }\n\n #fill (template, opts) {\n if (typeof template !== 'function') {\n return null\n }\n\n const options = { ...this, ...this.opts, ...opts }\n\n // the path should always be set so we don't end up with 'undefined' in urls\n if (!options.path) {\n options.path = ''\n }\n\n // template functions will insert the leading slash themselves\n if (options.path.startsWith('/')) {\n options.path = options.path.slice(1)\n }\n\n if (options.noCommittish) {\n options.committish = null\n }\n\n const result = template(options)\n return options.noGitPlus && result.startsWith('git+') ? result.slice(4) : result\n }\n\n hash () {\n return this.committish ? `#${this.committish}` : ''\n }\n\n ssh (opts) {\n return this.#fill(this.sshtemplate, opts)\n }\n\n sshurl (opts) {\n return this.#fill(this.sshurltemplate, opts)\n }\n\n browse (path, ...args) {\n // not a string, treat path as opts\n if (typeof path !== 'string') {\n return this.#fill(this.browsetemplate, path)\n }\n\n if (typeof args[0] !== 'string') {\n return this.#fill(this.browsetreetemplate, { ...args[0], path })\n }\n\n return this.#fill(this.browsetreetemplate, { ...args[1], fragment: args[0], path })\n }\n\n // If the path is known to be a file, then browseFile should be used. For some hosts\n // the url is the same as browse, but for others like GitHub a file can use both `/tree/`\n // and `/blob/` in the path. When using a default committish of `HEAD` then the `/tree/`\n // path will redirect to a specific commit. Using the `/blob/` path avoids this and\n // does not redirect to a different commit.\n browseFile (path, ...args) {\n if (typeof args[0] !== 'string') {\n return this.#fill(this.browseblobtemplate, { ...args[0], path })\n }\n\n return this.#fill(this.browseblobtemplate, { ...args[1], fragment: args[0], path })\n }\n\n docs (opts) {\n return this.#fill(this.docstemplate, opts)\n }\n\n bugs (opts) {\n return this.#fill(this.bugstemplate, opts)\n }\n\n https (opts) {\n return this.#fill(this.httpstemplate, opts)\n }\n\n git (opts) {\n return this.#fill(this.gittemplate, opts)\n }\n\n shortcut (opts) {\n return this.#fill(this.shortcuttemplate, opts)\n }\n\n path (opts) {\n return this.#fill(this.pathtemplate, opts)\n }\n\n tarball (opts) {\n return this.#fill(this.tarballtemplate, { ...opts, noCommittish: false })\n }\n\n file (path, opts) {\n return this.#fill(this.filetemplate, { ...opts, path })\n }\n\n edit (path, opts) {\n return this.#fill(this.edittemplate, { ...opts, path })\n }\n\n getDefaultRepresentation () {\n return this.default\n }\n\n toString (opts) {\n if (this.default && typeof this[this.default] === 'function') {\n return this[this.default](opts)\n }\n\n return this.sshurl(opts)\n }\n}\n\nfor (const [name, host] of Object.entries(hosts)) {\n GitHost.addHost(name, host)\n}\n\nmodule.exports = GitHost\n"],"names":["require$$0","require$$1","require$$2","require$$3"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAEA,MAAM,MAAMA;AACZ,MAAM,QAAQC;AACd,MAAM,UAAUC;AAChB,MAAM,WAAWC;AAEjB,MAAM,QAAQ,IAAI,IAAI,EAAE,KAAK,IAAI,CAAE;AAEnC,MAAM,WAAN,
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../node_modules/hosted-git-info/lib/index.js"],"sourcesContent":["'use strict'\n\nconst LRU = require('lru-cache')\nconst hosts = require('./hosts.js')\nconst fromUrl = require('./from-url.js')\nconst parseUrl = require('./parse-url.js')\n\nconst cache = new LRU({ max: 1000 })\n\nclass GitHost {\n constructor (type, user, auth, project, committish, defaultRepresentation, opts = {}) {\n Object.assign(this, GitHost.#gitHosts[type], {\n type,\n user,\n auth,\n project,\n committish,\n default: defaultRepresentation,\n opts,\n })\n }\n\n static #gitHosts = { byShortcut: {}, byDomain: {} }\n static #protocols = {\n 'git+ssh:': { name: 'sshurl' },\n 'ssh:': { name: 'sshurl' },\n 'git+https:': { name: 'https', auth: true },\n 'git:': { auth: true },\n 'http:': { auth: true },\n 'https:': { auth: true },\n 'git+http:': { auth: true },\n }\n\n static addHost (name, host) {\n GitHost.#gitHosts[name] = host\n GitHost.#gitHosts.byDomain[host.domain] = name\n GitHost.#gitHosts.byShortcut[`${name}:`] = name\n GitHost.#protocols[`${name}:`] = { name }\n }\n\n static fromUrl (giturl, opts) {\n if (typeof giturl !== 'string') {\n return\n }\n\n const key = giturl + JSON.stringify(opts || {})\n\n if (!cache.has(key)) {\n const hostArgs = fromUrl(giturl, opts, {\n gitHosts: GitHost.#gitHosts,\n protocols: GitHost.#protocols,\n })\n cache.set(key, hostArgs ? new GitHost(...hostArgs) : undefined)\n }\n\n return cache.get(key)\n }\n\n static parseUrl (url) {\n return parseUrl(url)\n }\n\n #fill (template, opts) {\n if (typeof template !== 'function') {\n return null\n }\n\n const options = { ...this, ...this.opts, ...opts }\n\n // the path should always be set so we don't end up with 'undefined' in urls\n if (!options.path) {\n options.path = ''\n }\n\n // template functions will insert the leading slash themselves\n if (options.path.startsWith('/')) {\n options.path = options.path.slice(1)\n }\n\n if (options.noCommittish) {\n options.committish = null\n }\n\n const result = template(options)\n return options.noGitPlus && result.startsWith('git+') ? result.slice(4) : result\n }\n\n hash () {\n return this.committish ? `#${this.committish}` : ''\n }\n\n ssh (opts) {\n return this.#fill(this.sshtemplate, opts)\n }\n\n sshurl (opts) {\n return this.#fill(this.sshurltemplate, opts)\n }\n\n browse (path, ...args) {\n // not a string, treat path as opts\n if (typeof path !== 'string') {\n return this.#fill(this.browsetemplate, path)\n }\n\n if (typeof args[0] !== 'string') {\n return this.#fill(this.browsetreetemplate, { ...args[0], path })\n }\n\n return this.#fill(this.browsetreetemplate, { ...args[1], fragment: args[0], path })\n }\n\n // If the path is known to be a file, then browseFile should be used. For some hosts\n // the url is the same as browse, but for others like GitHub a file can use both `/tree/`\n // and `/blob/` in the path. When using a default committish of `HEAD` then the `/tree/`\n // path will redirect to a specific commit. Using the `/blob/` path avoids this and\n // does not redirect to a different commit.\n browseFile (path, ...args) {\n if (typeof args[0] !== 'string') {\n return this.#fill(this.browseblobtemplate, { ...args[0], path })\n }\n\n return this.#fill(this.browseblobtemplate, { ...args[1], fragment: args[0], path })\n }\n\n docs (opts) {\n return this.#fill(this.docstemplate, opts)\n }\n\n bugs (opts) {\n return this.#fill(this.bugstemplate, opts)\n }\n\n https (opts) {\n return this.#fill(this.httpstemplate, opts)\n }\n\n git (opts) {\n return this.#fill(this.gittemplate, opts)\n }\n\n shortcut (opts) {\n return this.#fill(this.shortcuttemplate, opts)\n }\n\n path (opts) {\n return this.#fill(this.pathtemplate, opts)\n }\n\n tarball (opts) {\n return this.#fill(this.tarballtemplate, { ...opts, noCommittish: false })\n }\n\n file (path, opts) {\n return this.#fill(this.filetemplate, { ...opts, path })\n }\n\n edit (path, opts) {\n return this.#fill(this.edittemplate, { ...opts, path })\n }\n\n getDefaultRepresentation () {\n return this.default\n }\n\n toString (opts) {\n if (this.default && typeof this[this.default] === 'function') {\n return this[this.default](opts)\n }\n\n return this.sshurl(opts)\n }\n}\n\nfor (const [name, host] of Object.entries(hosts)) {\n GitHost.addHost(name, host)\n}\n\nmodule.exports = GitHost\n"],"names":["require$$0","require$$1","require$$2","require$$3"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAEA,MAAM,MAAMA;AACZ,MAAM,QAAQC;AACd,MAAM,UAAUC;AAChB,MAAM,WAAWC;AAEjB,MAAM,QAAQ,IAAI,IAAI,EAAE,KAAK,IAAI,CAAE;AAEnC,MAAM,WAAN,MAAM,SAAQ;AAAA,EACZ,YAAa,MAAM,MAAM,MAAM,SAAS,YAAY,uBAAuB,OAAO,IAAI;AAoDtF;AAnDE,WAAO,OAAO,MAAM,uBAAQ,WAAU,IAAI,GAAG;AAAA,MAC3C;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,SAAS;AAAA,MACT;AAAA,IACN,CAAK;AAAA,EACF;AAAA,EAaD,OAAO,QAAS,MAAM,MAAM;AAC1B,2BAAQ,WAAU,IAAI,IAAI;AAC1B,2BAAQ,WAAU,SAAS,KAAK,MAAM,IAAI;AAC1C,2BAAQ,WAAU,WAAW,GAAG,IAAI,GAAG,IAAI;AAC3C,2BAAQ,YAAW,GAAG,IAAI,GAAG,IAAI,EAAE,KAAM;AAAA,EAC1C;AAAA,EAED,OAAO,QAAS,QAAQ,MAAM;AAC5B,QAAI,OAAO,WAAW,UAAU;AAC9B;AAAA,IACD;AAED,UAAM,MAAM,SAAS,KAAK,UAAU,QAAQ,CAAA,CAAE;AAE9C,QAAI,CAAC,MAAM,IAAI,GAAG,G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AAK,WAAW,GAAG,GAAG;AAChC,YAAQ,OAAO,QAAQ,KAAK,MAAM,CAAC;AAAA,EACpC;AAED,MAAI,QAAQ,cAAc;AACxB,YAAQ,aAAa;AAAA,EACtB;AAED,QAAM,SAAS,SAAS,OAAO;AAC/B,SAAO,QAAQ,aAAa,OAAO,WAAW,MAAM,IAAI,OAAO,MAAM,CAAC,IAAI;AAC3E;AA/DD,aAbI,UAaG,WAAY,EAAE,YAAY,CAAA,GAAI,UAAU,CAAA,EAAI;AACnD,aAdI,UAcG,YAAa;AAAA,EAClB,YAAY,EAAE,MAAM,SAAU;AAAA,EAC9B,QAAQ,EAAE,MAAM,SAAU;AAAA,EAC1B,cAAc,EAAE,MAAM,SAAS,MAAM,KAAM;AAAA,EAC3C,QAAQ,EAAE,MAAM,KAAM;AAAA,EACtB,SAAS,EAAE,MAAM,KAAM;AAAA,EACvB,UAAU,EAAE,MAAM,KAAM;AAAA,EACxB,aAAa,EAAE,MAAM,KAAM;AAC5B;AAtBH,IAAM,UAAN;AAqKA,WAAW,CAAC,MAAM,IAAI,KAAK,OAAO,QAAQ,KAAK,GAAG;AAChD,UAAQ,QAAQ,MAAM,IAAI;AAC5B;AAEA,IAAA,MAAiB;","x_google_ignoreList":[0]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse-url.cjs","sources":["../../../../node_modules/hosted-git-info/lib/parse-url.js"],"sourcesContent":["const url = require('url')\n\nconst lastIndexOfBefore = (str, char, beforeChar) => {\n const startPosition = str.indexOf(beforeChar)\n return str.lastIndexOf(char, startPosition > -1 ? startPosition : Infinity)\n}\n\nconst safeUrl = (u) => {\n try {\n return new url.URL(u)\n } catch {\n // this fn should never throw\n }\n}\n\n// accepts input like git:github.com:user/repo and inserts the // after the first :\nconst correctProtocol = (arg, protocols) => {\n const firstColon = arg.indexOf(':')\n const proto = arg.slice(0, firstColon + 1)\n if (Object.prototype.hasOwnProperty.call(protocols, proto)) {\n return arg\n }\n\n const firstAt = arg.indexOf('@')\n if (firstAt > -1) {\n if (firstAt > firstColon) {\n return `git+ssh://${arg}`\n } else {\n return arg\n }\n }\n\n const doubleSlash = arg.indexOf('//')\n if (doubleSlash === firstColon + 1) {\n return arg\n }\n\n return `${arg.slice(0, firstColon + 1)}//${arg.slice(firstColon + 1)}`\n}\n\n// attempt to correct an scp style url so that it will parse with `new URL()`\nconst correctUrl = (giturl) => {\n // ignore @ that come after the first hash since the denotes the start\n // of a committish which can contain @ characters\n const firstAt = lastIndexOfBefore(giturl, '@', '#')\n // ignore colons that come after the hash since that could include colons such as:\n // git@github.com:user/package-2#semver:^1.0.0\n const lastColonBeforeHash = lastIndexOfBefore(giturl, ':', '#')\n\n if (lastColonBeforeHash > firstAt) {\n // the last : comes after the first @ (or there is no @)\n // like it would in:\n // proto://hostname.com:user/repo\n // username@hostname.com:user/repo\n // :password@hostname.com:user/repo\n // username:password@hostname.com:user/repo\n // proto://username@hostname.com:user/repo\n // proto://:password@hostname.com:user/repo\n // proto://username:password@hostname.com:user/repo\n // then we replace the last : with a / to create a valid path\n giturl = giturl.slice(0, lastColonBeforeHash) + '/' + giturl.slice(lastColonBeforeHash + 1)\n }\n\n if (lastIndexOfBefore(giturl, ':', '#') === -1 && giturl.indexOf('//') === -1) {\n // we have no : at all\n // as it would be in:\n // username@hostname.com/user/repo\n // then we prepend a protocol\n giturl = `git+ssh://${giturl}`\n }\n\n return giturl\n}\n\nmodule.exports = (giturl, protocols) => {\n const withProtocol = protocols ? correctProtocol(giturl, protocols) : giturl\n return safeUrl(withProtocol) || safeUrl(correctUrl(withProtocol))\n}\n"],"names":[],"mappings":";;;AAAA,MAAM,MAAM;AAEZ,MAAM,oBAAoB,CAAC,KAAK,MAAM,eAAe;AACnD,QAAM,gBAAgB,IAAI,QAAQ,UAAU;AAC5C,SAAO,IAAI,YAAY,MAAM,gBAAgB,KAAK,gBAAgB,QAAQ;AAC5E;AAEA,MAAM,UAAU,CAAC,MAAM;AACrB,MAAI;AACF,WAAO,IAAI,IAAI,IAAI,CAAC;AAAA,EACxB,QAAI;AAAA,EAED;AACH;AAGA,MAAM,kBAAkB,CAAC,KAAK,cAAc;AAC1C,QAAM,aAAa,IAAI,QAAQ,GAAG;AAClC,QAAM,QAAQ,IAAI,MAAM,GAAG,aAAa,CAAC;AACzC,MAAI,OAAO,UAAU,eAAe,KAAK,WAAW,KAAK,GAAG;AAC1D,WAAO;AAAA,EACR;AAED,QAAM,UAAU,IAAI,QAAQ,GAAG;AAC/B,MAAI,UAAU,IAAI;AAChB,QAAI,UAAU,YAAY;AACxB,aAAO,aAAa;AAAA,
|
|
1
|
+
{"version":3,"file":"parse-url.cjs","sources":["../../../../node_modules/hosted-git-info/lib/parse-url.js"],"sourcesContent":["const url = require('url')\n\nconst lastIndexOfBefore = (str, char, beforeChar) => {\n const startPosition = str.indexOf(beforeChar)\n return str.lastIndexOf(char, startPosition > -1 ? startPosition : Infinity)\n}\n\nconst safeUrl = (u) => {\n try {\n return new url.URL(u)\n } catch {\n // this fn should never throw\n }\n}\n\n// accepts input like git:github.com:user/repo and inserts the // after the first :\nconst correctProtocol = (arg, protocols) => {\n const firstColon = arg.indexOf(':')\n const proto = arg.slice(0, firstColon + 1)\n if (Object.prototype.hasOwnProperty.call(protocols, proto)) {\n return arg\n }\n\n const firstAt = arg.indexOf('@')\n if (firstAt > -1) {\n if (firstAt > firstColon) {\n return `git+ssh://${arg}`\n } else {\n return arg\n }\n }\n\n const doubleSlash = arg.indexOf('//')\n if (doubleSlash === firstColon + 1) {\n return arg\n }\n\n return `${arg.slice(0, firstColon + 1)}//${arg.slice(firstColon + 1)}`\n}\n\n// attempt to correct an scp style url so that it will parse with `new URL()`\nconst correctUrl = (giturl) => {\n // ignore @ that come after the first hash since the denotes the start\n // of a committish which can contain @ characters\n const firstAt = lastIndexOfBefore(giturl, '@', '#')\n // ignore colons that come after the hash since that could include colons such as:\n // git@github.com:user/package-2#semver:^1.0.0\n const lastColonBeforeHash = lastIndexOfBefore(giturl, ':', '#')\n\n if (lastColonBeforeHash > firstAt) {\n // the last : comes after the first @ (or there is no @)\n // like it would in:\n // proto://hostname.com:user/repo\n // username@hostname.com:user/repo\n // :password@hostname.com:user/repo\n // username:password@hostname.com:user/repo\n // proto://username@hostname.com:user/repo\n // proto://:password@hostname.com:user/repo\n // proto://username:password@hostname.com:user/repo\n // then we replace the last : with a / to create a valid path\n giturl = giturl.slice(0, lastColonBeforeHash) + '/' + giturl.slice(lastColonBeforeHash + 1)\n }\n\n if (lastIndexOfBefore(giturl, ':', '#') === -1 && giturl.indexOf('//') === -1) {\n // we have no : at all\n // as it would be in:\n // username@hostname.com/user/repo\n // then we prepend a protocol\n giturl = `git+ssh://${giturl}`\n }\n\n return giturl\n}\n\nmodule.exports = (giturl, protocols) => {\n const withProtocol = protocols ? correctProtocol(giturl, protocols) : giturl\n return safeUrl(withProtocol) || safeUrl(correctUrl(withProtocol))\n}\n"],"names":[],"mappings":";;;AAAA,MAAM,MAAM;AAEZ,MAAM,oBAAoB,CAAC,KAAK,MAAM,eAAe;AACnD,QAAM,gBAAgB,IAAI,QAAQ,UAAU;AAC5C,SAAO,IAAI,YAAY,MAAM,gBAAgB,KAAK,gBAAgB,QAAQ;AAC5E;AAEA,MAAM,UAAU,CAAC,MAAM;AACrB,MAAI;AACF,WAAO,IAAI,IAAI,IAAI,CAAC;AAAA,EACxB,QAAI;AAAA,EAED;AACH;AAGA,MAAM,kBAAkB,CAAC,KAAK,cAAc;AAC1C,QAAM,aAAa,IAAI,QAAQ,GAAG;AAClC,QAAM,QAAQ,IAAI,MAAM,GAAG,aAAa,CAAC;AACzC,MAAI,OAAO,UAAU,eAAe,KAAK,WAAW,KAAK,GAAG;AAC1D,WAAO;AAAA,EACR;AAED,QAAM,UAAU,IAAI,QAAQ,GAAG;AAC/B,MAAI,UAAU,IAAI;AAChB,QAAI,UAAU,YAAY;AACxB,aAAO,aAAa,GAAG;AAAA,IAC7B,OAAW;AACL,aAAO;AAAA,IACR;AAAA,EACF;AAED,QAAM,cAAc,IAAI,QAAQ,IAAI;AACpC,MAAI,gBAAgB,aAAa,GAAG;AAClC,WAAO;AAAA,EACR;AAED,SAAO,GAAG,IAAI,MAAM,GAAG,aAAa,CAAC,CAAC,KAAK,IAAI,MAAM,aAAa,CAAC,CAAC;AACtE;AAGA,MAAM,aAAa,CAAC,WAAW;AAG7B,QAAM,UAAU,kBAAkB,QAAQ,KAAK,GAAG;AAGlD,QAAM,sBAAsB,kBAAkB,QAAQ,KAAK,GAAG;AAE9D,MAAI,sBAAsB,SAAS;AAWjC,aAAS,OAAO,MAAM,GAAG,mBAAmB,IAAI,MAAM,OAAO,MAAM,sBAAsB,CAAC;AAAA,EAC3F;AAED,MAAI,kBAAkB,QAAQ,KAAK,GAAG,MAAM,MAAM,OAAO,QAAQ,IAAI,MAAM,IAAI;AAK7E,aAAS,aAAa,MAAM;AAAA,EAC7B;AAED,SAAO;AACT;AAEA,IAAA,WAAiB,CAAC,QAAQ,cAAc;AACtC,QAAM,eAAe,YAAY,gBAAgB,QAAQ,SAAS,IAAI;AACtE,SAAO,QAAQ,YAAY,KAAK,QAAQ,WAAW,YAAY,CAAC;AAClE;;","x_google_ignoreList":[0]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse-url.js","sources":["../../../../node_modules/hosted-git-info/lib/parse-url.js"],"sourcesContent":["const url = require('url')\n\nconst lastIndexOfBefore = (str, char, beforeChar) => {\n const startPosition = str.indexOf(beforeChar)\n return str.lastIndexOf(char, startPosition > -1 ? startPosition : Infinity)\n}\n\nconst safeUrl = (u) => {\n try {\n return new url.URL(u)\n } catch {\n // this fn should never throw\n }\n}\n\n// accepts input like git:github.com:user/repo and inserts the // after the first :\nconst correctProtocol = (arg, protocols) => {\n const firstColon = arg.indexOf(':')\n const proto = arg.slice(0, firstColon + 1)\n if (Object.prototype.hasOwnProperty.call(protocols, proto)) {\n return arg\n }\n\n const firstAt = arg.indexOf('@')\n if (firstAt > -1) {\n if (firstAt > firstColon) {\n return `git+ssh://${arg}`\n } else {\n return arg\n }\n }\n\n const doubleSlash = arg.indexOf('//')\n if (doubleSlash === firstColon + 1) {\n return arg\n }\n\n return `${arg.slice(0, firstColon + 1)}//${arg.slice(firstColon + 1)}`\n}\n\n// attempt to correct an scp style url so that it will parse with `new URL()`\nconst correctUrl = (giturl) => {\n // ignore @ that come after the first hash since the denotes the start\n // of a committish which can contain @ characters\n const firstAt = lastIndexOfBefore(giturl, '@', '#')\n // ignore colons that come after the hash since that could include colons such as:\n // git@github.com:user/package-2#semver:^1.0.0\n const lastColonBeforeHash = lastIndexOfBefore(giturl, ':', '#')\n\n if (lastColonBeforeHash > firstAt) {\n // the last : comes after the first @ (or there is no @)\n // like it would in:\n // proto://hostname.com:user/repo\n // username@hostname.com:user/repo\n // :password@hostname.com:user/repo\n // username:password@hostname.com:user/repo\n // proto://username@hostname.com:user/repo\n // proto://:password@hostname.com:user/repo\n // proto://username:password@hostname.com:user/repo\n // then we replace the last : with a / to create a valid path\n giturl = giturl.slice(0, lastColonBeforeHash) + '/' + giturl.slice(lastColonBeforeHash + 1)\n }\n\n if (lastIndexOfBefore(giturl, ':', '#') === -1 && giturl.indexOf('//') === -1) {\n // we have no : at all\n // as it would be in:\n // username@hostname.com/user/repo\n // then we prepend a protocol\n giturl = `git+ssh://${giturl}`\n }\n\n return giturl\n}\n\nmodule.exports = (giturl, protocols) => {\n const withProtocol = protocols ? correctProtocol(giturl, protocols) : giturl\n return safeUrl(withProtocol) || safeUrl(correctUrl(withProtocol))\n}\n"],"names":[],"mappings":";AAAA,MAAM,MAAM;AAEZ,MAAM,oBAAoB,CAAC,KAAK,MAAM,eAAe;AACnD,QAAM,gBAAgB,IAAI,QAAQ,UAAU;AAC5C,SAAO,IAAI,YAAY,MAAM,gBAAgB,KAAK,gBAAgB,QAAQ;AAC5E;AAEA,MAAM,UAAU,CAAC,MAAM;AACrB,MAAI;AACF,WAAO,IAAI,IAAI,IAAI,CAAC;AAAA,EACxB,QAAI;AAAA,EAED;AACH;AAGA,MAAM,kBAAkB,CAAC,KAAK,cAAc;AAC1C,QAAM,aAAa,IAAI,QAAQ,GAAG;AAClC,QAAM,QAAQ,IAAI,MAAM,GAAG,aAAa,CAAC;AACzC,MAAI,OAAO,UAAU,eAAe,KAAK,WAAW,KAAK,GAAG;AAC1D,WAAO;AAAA,EACR;AAED,QAAM,UAAU,IAAI,QAAQ,GAAG;AAC/B,MAAI,UAAU,IAAI;AAChB,QAAI,UAAU,YAAY;AACxB,aAAO,aAAa;AAAA,
|
|
1
|
+
{"version":3,"file":"parse-url.js","sources":["../../../../node_modules/hosted-git-info/lib/parse-url.js"],"sourcesContent":["const url = require('url')\n\nconst lastIndexOfBefore = (str, char, beforeChar) => {\n const startPosition = str.indexOf(beforeChar)\n return str.lastIndexOf(char, startPosition > -1 ? startPosition : Infinity)\n}\n\nconst safeUrl = (u) => {\n try {\n return new url.URL(u)\n } catch {\n // this fn should never throw\n }\n}\n\n// accepts input like git:github.com:user/repo and inserts the // after the first :\nconst correctProtocol = (arg, protocols) => {\n const firstColon = arg.indexOf(':')\n const proto = arg.slice(0, firstColon + 1)\n if (Object.prototype.hasOwnProperty.call(protocols, proto)) {\n return arg\n }\n\n const firstAt = arg.indexOf('@')\n if (firstAt > -1) {\n if (firstAt > firstColon) {\n return `git+ssh://${arg}`\n } else {\n return arg\n }\n }\n\n const doubleSlash = arg.indexOf('//')\n if (doubleSlash === firstColon + 1) {\n return arg\n }\n\n return `${arg.slice(0, firstColon + 1)}//${arg.slice(firstColon + 1)}`\n}\n\n// attempt to correct an scp style url so that it will parse with `new URL()`\nconst correctUrl = (giturl) => {\n // ignore @ that come after the first hash since the denotes the start\n // of a committish which can contain @ characters\n const firstAt = lastIndexOfBefore(giturl, '@', '#')\n // ignore colons that come after the hash since that could include colons such as:\n // git@github.com:user/package-2#semver:^1.0.0\n const lastColonBeforeHash = lastIndexOfBefore(giturl, ':', '#')\n\n if (lastColonBeforeHash > firstAt) {\n // the last : comes after the first @ (or there is no @)\n // like it would in:\n // proto://hostname.com:user/repo\n // username@hostname.com:user/repo\n // :password@hostname.com:user/repo\n // username:password@hostname.com:user/repo\n // proto://username@hostname.com:user/repo\n // proto://:password@hostname.com:user/repo\n // proto://username:password@hostname.com:user/repo\n // then we replace the last : with a / to create a valid path\n giturl = giturl.slice(0, lastColonBeforeHash) + '/' + giturl.slice(lastColonBeforeHash + 1)\n }\n\n if (lastIndexOfBefore(giturl, ':', '#') === -1 && giturl.indexOf('//') === -1) {\n // we have no : at all\n // as it would be in:\n // username@hostname.com/user/repo\n // then we prepend a protocol\n giturl = `git+ssh://${giturl}`\n }\n\n return giturl\n}\n\nmodule.exports = (giturl, protocols) => {\n const withProtocol = protocols ? correctProtocol(giturl, protocols) : giturl\n return safeUrl(withProtocol) || safeUrl(correctUrl(withProtocol))\n}\n"],"names":[],"mappings":";AAAA,MAAM,MAAM;AAEZ,MAAM,oBAAoB,CAAC,KAAK,MAAM,eAAe;AACnD,QAAM,gBAAgB,IAAI,QAAQ,UAAU;AAC5C,SAAO,IAAI,YAAY,MAAM,gBAAgB,KAAK,gBAAgB,QAAQ;AAC5E;AAEA,MAAM,UAAU,CAAC,MAAM;AACrB,MAAI;AACF,WAAO,IAAI,IAAI,IAAI,CAAC;AAAA,EACxB,QAAI;AAAA,EAED;AACH;AAGA,MAAM,kBAAkB,CAAC,KAAK,cAAc;AAC1C,QAAM,aAAa,IAAI,QAAQ,GAAG;AAClC,QAAM,QAAQ,IAAI,MAAM,GAAG,aAAa,CAAC;AACzC,MAAI,OAAO,UAAU,eAAe,KAAK,WAAW,KAAK,GAAG;AAC1D,WAAO;AAAA,EACR;AAED,QAAM,UAAU,IAAI,QAAQ,GAAG;AAC/B,MAAI,UAAU,IAAI;AAChB,QAAI,UAAU,YAAY;AACxB,aAAO,aAAa,GAAG;AAAA,IAC7B,OAAW;AACL,aAAO;AAAA,IACR;AAAA,EACF;AAED,QAAM,cAAc,IAAI,QAAQ,IAAI;AACpC,MAAI,gBAAgB,aAAa,GAAG;AAClC,WAAO;AAAA,EACR;AAED,SAAO,GAAG,IAAI,MAAM,GAAG,aAAa,CAAC,CAAC,KAAK,IAAI,MAAM,aAAa,CAAC,CAAC;AACtE;AAGA,MAAM,aAAa,CAAC,WAAW;AAG7B,QAAM,UAAU,kBAAkB,QAAQ,KAAK,GAAG;AAGlD,QAAM,sBAAsB,kBAAkB,QAAQ,KAAK,GAAG;AAE9D,MAAI,sBAAsB,SAAS;AAWjC,aAAS,OAAO,MAAM,GAAG,mBAAmB,IAAI,MAAM,OAAO,MAAM,sBAAsB,CAAC;AAAA,EAC3F;AAED,MAAI,kBAAkB,QAAQ,KAAK,GAAG,MAAM,MAAM,OAAO,QAAQ,IAAI,MAAM,IAAI;AAK7E,aAAS,aAAa,MAAM;AAAA,EAC7B;AAED,SAAO;AACT;AAEA,IAAA,WAAiB,CAAC,QAAQ,cAAc;AACtC,QAAM,eAAe,YAAY,gBAAgB,QAAQ,SAAS,IAAI;AACtE,SAAO,QAAQ,YAAY,KAAK,QAAQ,WAAW,YAAY,CAAC;AAClE;","x_google_ignoreList":[0]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../node_modules/indent-string/index.js"],"sourcesContent":["export default function indentString(string, count = 1, options = {}) {\n\tconst {\n\t\tindent = ' ',\n\t\tincludeEmptyLines = false\n\t} = options;\n\n\tif (typeof string !== 'string') {\n\t\tthrow new TypeError(\n\t\t\t`Expected \\`input\\` to be a \\`string\\`, got \\`${typeof string}\\``\n\t\t);\n\t}\n\n\tif (typeof count !== 'number') {\n\t\tthrow new TypeError(\n\t\t\t`Expected \\`count\\` to be a \\`number\\`, got \\`${typeof count}\\``\n\t\t);\n\t}\n\n\tif (count < 0) {\n\t\tthrow new RangeError(\n\t\t\t`Expected \\`count\\` to be at least 0, got \\`${count}\\``\n\t\t);\n\t}\n\n\tif (typeof indent !== 'string') {\n\t\tthrow new TypeError(\n\t\t\t`Expected \\`options.indent\\` to be a \\`string\\`, got \\`${typeof indent}\\``\n\t\t);\n\t}\n\n\tif (count === 0) {\n\t\treturn string;\n\t}\n\n\tconst regex = includeEmptyLines ? /^/gm : /^(?!\\s*$)/gm;\n\n\treturn string.replace(regex, indent.repeat(count));\n}\n"],"names":[],"mappings":";AAAe,SAAS,aAAa,QAAQ,QAAQ,GAAG,UAAU,CAAA,GAAI;AACrE,QAAM;AAAA,IACL,SAAS;AAAA,IACT,oBAAoB;AAAA,EACpB,IAAG;AAEJ,MAAI,OAAO,WAAW,UAAU;AAC/B,UAAM,IAAI;AAAA,MACT,gDAAgD,OAAO;AAAA,
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../node_modules/indent-string/index.js"],"sourcesContent":["export default function indentString(string, count = 1, options = {}) {\n\tconst {\n\t\tindent = ' ',\n\t\tincludeEmptyLines = false\n\t} = options;\n\n\tif (typeof string !== 'string') {\n\t\tthrow new TypeError(\n\t\t\t`Expected \\`input\\` to be a \\`string\\`, got \\`${typeof string}\\``\n\t\t);\n\t}\n\n\tif (typeof count !== 'number') {\n\t\tthrow new TypeError(\n\t\t\t`Expected \\`count\\` to be a \\`number\\`, got \\`${typeof count}\\``\n\t\t);\n\t}\n\n\tif (count < 0) {\n\t\tthrow new RangeError(\n\t\t\t`Expected \\`count\\` to be at least 0, got \\`${count}\\``\n\t\t);\n\t}\n\n\tif (typeof indent !== 'string') {\n\t\tthrow new TypeError(\n\t\t\t`Expected \\`options.indent\\` to be a \\`string\\`, got \\`${typeof indent}\\``\n\t\t);\n\t}\n\n\tif (count === 0) {\n\t\treturn string;\n\t}\n\n\tconst regex = includeEmptyLines ? /^/gm : /^(?!\\s*$)/gm;\n\n\treturn string.replace(regex, indent.repeat(count));\n}\n"],"names":[],"mappings":";AAAe,SAAS,aAAa,QAAQ,QAAQ,GAAG,UAAU,CAAA,GAAI;AACrE,QAAM;AAAA,IACL,SAAS;AAAA,IACT,oBAAoB;AAAA,EACpB,IAAG;AAEJ,MAAI,OAAO,WAAW,UAAU;AAC/B,UAAM,IAAI;AAAA,MACT,gDAAgD,OAAO,MAAM;AAAA,IAChE;AAAA,EACE;AAED,MAAI,OAAO,UAAU,UAAU;AAC9B,UAAM,IAAI;AAAA,MACT,gDAAgD,OAAO,KAAK;AAAA,IAC/D;AAAA,EACE;AAED,MAAI,QAAQ,GAAG;AACd,UAAM,IAAI;AAAA,MACT,8CAA8C,KAAK;AAAA,IACtD;AAAA,EACE;AAED,MAAI,OAAO,WAAW,UAAU;AAC/B,UAAM,IAAI;AAAA,MACT,yDAAyD,OAAO,MAAM;AAAA,IACzE;AAAA,EACE;AAED,MAAI,UAAU,GAAG;AAChB,WAAO;AAAA,EACP;AAED,QAAM,QAAQ,oBAAoB,QAAQ;AAE1C,SAAO,OAAO,QAAQ,OAAO,OAAO,OAAO,KAAK,CAAC;AAClD;;","x_google_ignoreList":[0]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../node_modules/indent-string/index.js"],"sourcesContent":["export default function indentString(string, count = 1, options = {}) {\n\tconst {\n\t\tindent = ' ',\n\t\tincludeEmptyLines = false\n\t} = options;\n\n\tif (typeof string !== 'string') {\n\t\tthrow new TypeError(\n\t\t\t`Expected \\`input\\` to be a \\`string\\`, got \\`${typeof string}\\``\n\t\t);\n\t}\n\n\tif (typeof count !== 'number') {\n\t\tthrow new TypeError(\n\t\t\t`Expected \\`count\\` to be a \\`number\\`, got \\`${typeof count}\\``\n\t\t);\n\t}\n\n\tif (count < 0) {\n\t\tthrow new RangeError(\n\t\t\t`Expected \\`count\\` to be at least 0, got \\`${count}\\``\n\t\t);\n\t}\n\n\tif (typeof indent !== 'string') {\n\t\tthrow new TypeError(\n\t\t\t`Expected \\`options.indent\\` to be a \\`string\\`, got \\`${typeof indent}\\``\n\t\t);\n\t}\n\n\tif (count === 0) {\n\t\treturn string;\n\t}\n\n\tconst regex = includeEmptyLines ? /^/gm : /^(?!\\s*$)/gm;\n\n\treturn string.replace(regex, indent.repeat(count));\n}\n"],"names":[],"mappings":"AAAe,SAAS,aAAa,QAAQ,QAAQ,GAAG,UAAU,CAAA,GAAI;AACrE,QAAM;AAAA,IACL,SAAS;AAAA,IACT,oBAAoB;AAAA,EACpB,IAAG;AAEJ,MAAI,OAAO,WAAW,UAAU;AAC/B,UAAM,IAAI;AAAA,MACT,gDAAgD,OAAO;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../node_modules/indent-string/index.js"],"sourcesContent":["export default function indentString(string, count = 1, options = {}) {\n\tconst {\n\t\tindent = ' ',\n\t\tincludeEmptyLines = false\n\t} = options;\n\n\tif (typeof string !== 'string') {\n\t\tthrow new TypeError(\n\t\t\t`Expected \\`input\\` to be a \\`string\\`, got \\`${typeof string}\\``\n\t\t);\n\t}\n\n\tif (typeof count !== 'number') {\n\t\tthrow new TypeError(\n\t\t\t`Expected \\`count\\` to be a \\`number\\`, got \\`${typeof count}\\``\n\t\t);\n\t}\n\n\tif (count < 0) {\n\t\tthrow new RangeError(\n\t\t\t`Expected \\`count\\` to be at least 0, got \\`${count}\\``\n\t\t);\n\t}\n\n\tif (typeof indent !== 'string') {\n\t\tthrow new TypeError(\n\t\t\t`Expected \\`options.indent\\` to be a \\`string\\`, got \\`${typeof indent}\\``\n\t\t);\n\t}\n\n\tif (count === 0) {\n\t\treturn string;\n\t}\n\n\tconst regex = includeEmptyLines ? /^/gm : /^(?!\\s*$)/gm;\n\n\treturn string.replace(regex, indent.repeat(count));\n}\n"],"names":[],"mappings":"AAAe,SAAS,aAAa,QAAQ,QAAQ,GAAG,UAAU,CAAA,GAAI;AACrE,QAAM;AAAA,IACL,SAAS;AAAA,IACT,oBAAoB;AAAA,EACpB,IAAG;AAEJ,MAAI,OAAO,WAAW,UAAU;AAC/B,UAAM,IAAI;AAAA,MACT,gDAAgD,OAAO,MAAM;AAAA,IAChE;AAAA,EACE;AAED,MAAI,OAAO,UAAU,UAAU;AAC9B,UAAM,IAAI;AAAA,MACT,gDAAgD,OAAO,KAAK;AAAA,IAC/D;AAAA,EACE;AAED,MAAI,QAAQ,GAAG;AACd,UAAM,IAAI;AAAA,MACT,8CAA8C,KAAK;AAAA,IACtD;AAAA,EACE;AAED,MAAI,OAAO,WAAW,UAAU;AAC/B,UAAM,IAAI;AAAA,MACT,yDAAyD,OAAO,MAAM;AAAA,IACzE;AAAA,EACE;AAED,MAAI,UAAU,GAAG;AAChB,WAAO;AAAA,EACP;AAED,QAAM,QAAQ,oBAAoB,QAAQ;AAE1C,SAAO,OAAO,QAAQ,OAAO,OAAO,OAAO,KAAK,CAAC;AAClD;","x_google_ignoreList":[0]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../node_modules/json-parse-even-better-errors/index.js"],"sourcesContent":["'use strict'\n\nconst hexify = char => {\n const h = char.charCodeAt(0).toString(16).toUpperCase()\n return '0x' + (h.length % 2 ? '0' : '') + h\n}\n\nconst parseError = (e, txt, context) => {\n if (!txt) {\n return {\n message: e.message + ' while parsing empty string',\n position: 0,\n }\n }\n const badToken = e.message.match(/^Unexpected token (.) .*position\\s+(\\d+)/i)\n const errIdx = badToken ? +badToken[2]\n : e.message.match(/^Unexpected end of JSON.*/i) ? txt.length - 1\n : null\n\n const msg = badToken ? e.message.replace(/^Unexpected token ./, `Unexpected token ${\n JSON.stringify(badToken[1])\n } (${hexify(badToken[1])})`)\n : e.message\n\n if (errIdx !== null && errIdx !== undefined) {\n const start = errIdx <= context ? 0\n : errIdx - context\n\n const end = errIdx + context >= txt.length ? txt.length\n : errIdx + context\n\n const slice = (start === 0 ? '' : '...') +\n txt.slice(start, end) +\n (end === txt.length ? '' : '...')\n\n const near = txt === slice ? '' : 'near '\n\n return {\n message: msg + ` while parsing ${near}${JSON.stringify(slice)}`,\n position: errIdx,\n }\n } else {\n return {\n message: msg + ` while parsing '${txt.slice(0, context * 2)}'`,\n position: 0,\n }\n }\n}\n\nclass JSONParseError extends SyntaxError {\n constructor (er, txt, context, caller) {\n context = context || 20\n const metadata = parseError(er, txt, context)\n super(metadata.message)\n Object.assign(this, metadata)\n this.code = 'EJSONPARSE'\n this.systemError = er\n Error.captureStackTrace(this, caller || this.constructor)\n }\n get name () { return this.constructor.name }\n set name (n) {}\n get [Symbol.toStringTag] () { return this.constructor.name }\n}\n\nconst kIndent = Symbol.for('indent')\nconst kNewline = Symbol.for('newline')\n// only respect indentation if we got a line break, otherwise squash it\n// things other than objects and arrays aren't indented, so ignore those\n// Important: in both of these regexps, the $1 capture group is the newline\n// or undefined, and the $2 capture group is the indent, or undefined.\nconst formatRE = /^\\s*[{\\[]((?:\\r?\\n)+)([\\s\\t]*)/\nconst emptyRE = /^(?:\\{\\}|\\[\\])((?:\\r?\\n)+)?$/\n\nconst parseJson = (txt, reviver, context) => {\n const parseText = stripBOM(txt)\n context = context || 20\n try {\n // get the indentation so that we can save it back nicely\n // if the file starts with {\" then we have an indent of '', ie, none\n // otherwise, pick the indentation of the next line after the first \\n\n // If the pattern doesn't match, then it means no indentation.\n // JSON.stringify ignores symbols, so this is reasonably safe.\n // if the string is '{}' or '[]', then use the default 2-space indent.\n const [, newline = '\\n', indent = ' '] = parseText.match(emptyRE) ||\n parseText.match(formatRE) ||\n [, '', '']\n\n const result = JSON.parse(parseText, reviver)\n if (result && typeof result === 'object') {\n result[kNewline] = newline\n result[kIndent] = indent\n }\n return result\n } catch (e) {\n if (typeof txt !== 'string' && !Buffer.isBuffer(txt)) {\n const isEmptyArray = Array.isArray(txt) && txt.length === 0\n throw Object.assign(new TypeError(\n `Cannot parse ${isEmptyArray ? 'an empty array' : String(txt)}`\n ), {\n code: 'EJSONPARSE',\n systemError: e,\n })\n }\n\n throw new JSONParseError(e, parseText, context, parseJson)\n }\n}\n\n// Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)\n// because the buffer-to-string conversion in `fs.readFileSync()`\n// translates it to FEFF, the UTF-16 BOM.\nconst stripBOM = txt => String(txt).replace(/^\\uFEFF/, '')\n\nmodule.exports = parseJson\nparseJson.JSONParseError = JSONParseError\n\nparseJson.noExceptions = (txt, reviver) => {\n try {\n return JSON.parse(stripBOM(txt), reviver)\n } catch (e) {}\n}\n"],"names":[],"mappings":";;AAEA,MAAM,SAAS,UAAQ;AACrB,QAAM,IAAI,KAAK,WAAW,CAAC,EAAE,SAAS,EAAE,EAAE,YAAa;AACvD,SAAO,QAAQ,EAAE,SAAS,IAAI,MAAM,MAAM;AAC5C;AAEA,MAAM,aAAa,CAAC,GAAG,KAAK,YAAY;AACtC,MAAI,CAAC,KAAK;AACR,WAAO;AAAA,MACL,SAAS,EAAE,UAAU;AAAA,MACrB,UAAU;AAAA,IACX;AAAA,EACF;AACD,QAAM,WAAW,EAAE,QAAQ,MAAM,2CAA2C;AAC5E,QAAM,SAAS,WAAW,CAAC,SAAS,CAAC,IACjC,EAAE,QAAQ,MAAM,4BAA4B,IAAI,IAAI,SAAS,IAC7D;AAEJ,QAAM,MAAM,WAAW,EAAE,QAAQ,QAAQ,uBAAuB,oBAC5D,KAAK,UAAU,SAAS,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../node_modules/json-parse-even-better-errors/index.js"],"sourcesContent":["'use strict'\n\nconst hexify = char => {\n const h = char.charCodeAt(0).toString(16).toUpperCase()\n return '0x' + (h.length % 2 ? '0' : '') + h\n}\n\nconst parseError = (e, txt, context) => {\n if (!txt) {\n return {\n message: e.message + ' while parsing empty string',\n position: 0,\n }\n }\n const badToken = e.message.match(/^Unexpected token (.) .*position\\s+(\\d+)/i)\n const errIdx = badToken ? +badToken[2]\n : e.message.match(/^Unexpected end of JSON.*/i) ? txt.length - 1\n : null\n\n const msg = badToken ? e.message.replace(/^Unexpected token ./, `Unexpected token ${\n JSON.stringify(badToken[1])\n } (${hexify(badToken[1])})`)\n : e.message\n\n if (errIdx !== null && errIdx !== undefined) {\n const start = errIdx <= context ? 0\n : errIdx - context\n\n const end = errIdx + context >= txt.length ? txt.length\n : errIdx + context\n\n const slice = (start === 0 ? '' : '...') +\n txt.slice(start, end) +\n (end === txt.length ? '' : '...')\n\n const near = txt === slice ? '' : 'near '\n\n return {\n message: msg + ` while parsing ${near}${JSON.stringify(slice)}`,\n position: errIdx,\n }\n } else {\n return {\n message: msg + ` while parsing '${txt.slice(0, context * 2)}'`,\n position: 0,\n }\n }\n}\n\nclass JSONParseError extends SyntaxError {\n constructor (er, txt, context, caller) {\n context = context || 20\n const metadata = parseError(er, txt, context)\n super(metadata.message)\n Object.assign(this, metadata)\n this.code = 'EJSONPARSE'\n this.systemError = er\n Error.captureStackTrace(this, caller || this.constructor)\n }\n get name () { return this.constructor.name }\n set name (n) {}\n get [Symbol.toStringTag] () { return this.constructor.name }\n}\n\nconst kIndent = Symbol.for('indent')\nconst kNewline = Symbol.for('newline')\n// only respect indentation if we got a line break, otherwise squash it\n// things other than objects and arrays aren't indented, so ignore those\n// Important: in both of these regexps, the $1 capture group is the newline\n// or undefined, and the $2 capture group is the indent, or undefined.\nconst formatRE = /^\\s*[{\\[]((?:\\r?\\n)+)([\\s\\t]*)/\nconst emptyRE = /^(?:\\{\\}|\\[\\])((?:\\r?\\n)+)?$/\n\nconst parseJson = (txt, reviver, context) => {\n const parseText = stripBOM(txt)\n context = context || 20\n try {\n // get the indentation so that we can save it back nicely\n // if the file starts with {\" then we have an indent of '', ie, none\n // otherwise, pick the indentation of the next line after the first \\n\n // If the pattern doesn't match, then it means no indentation.\n // JSON.stringify ignores symbols, so this is reasonably safe.\n // if the string is '{}' or '[]', then use the default 2-space indent.\n const [, newline = '\\n', indent = ' '] = parseText.match(emptyRE) ||\n parseText.match(formatRE) ||\n [, '', '']\n\n const result = JSON.parse(parseText, reviver)\n if (result && typeof result === 'object') {\n result[kNewline] = newline\n result[kIndent] = indent\n }\n return result\n } catch (e) {\n if (typeof txt !== 'string' && !Buffer.isBuffer(txt)) {\n const isEmptyArray = Array.isArray(txt) && txt.length === 0\n throw Object.assign(new TypeError(\n `Cannot parse ${isEmptyArray ? 'an empty array' : String(txt)}`\n ), {\n code: 'EJSONPARSE',\n systemError: e,\n })\n }\n\n throw new JSONParseError(e, parseText, context, parseJson)\n }\n}\n\n// Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)\n// because the buffer-to-string conversion in `fs.readFileSync()`\n// translates it to FEFF, the UTF-16 BOM.\nconst stripBOM = txt => String(txt).replace(/^\\uFEFF/, '')\n\nmodule.exports = parseJson\nparseJson.JSONParseError = JSONParseError\n\nparseJson.noExceptions = (txt, reviver) => {\n try {\n return JSON.parse(stripBOM(txt), reviver)\n } catch (e) {}\n}\n"],"names":[],"mappings":";;AAEA,MAAM,SAAS,UAAQ;AACrB,QAAM,IAAI,KAAK,WAAW,CAAC,EAAE,SAAS,EAAE,EAAE,YAAa;AACvD,SAAO,QAAQ,EAAE,SAAS,IAAI,MAAM,MAAM;AAC5C;AAEA,MAAM,aAAa,CAAC,GAAG,KAAK,YAAY;AACtC,MAAI,CAAC,KAAK;AACR,WAAO;AAAA,MACL,SAAS,EAAE,UAAU;AAAA,MACrB,UAAU;AAAA,IACX;AAAA,EACF;AACD,QAAM,WAAW,EAAE,QAAQ,MAAM,2CAA2C;AAC5E,QAAM,SAAS,WAAW,CAAC,SAAS,CAAC,IACjC,EAAE,QAAQ,MAAM,4BAA4B,IAAI,IAAI,SAAS,IAC7D;AAEJ,QAAM,MAAM,WAAW,EAAE,QAAQ,QAAQ,uBAAuB,oBAC5D,KAAK,UAAU,SAAS,CAAC,CAAC,CAChC,KAAS,OAAO,SAAS,CAAC,CAAC,CAAC,GAAG,IACzB,EAAE;AAEN,MAAI,WAAW,QAAQ,WAAW,QAAW;AAC3C,UAAM,QAAQ,UAAU,UAAU,IAC9B,SAAS;AAEb,UAAM,MAAM,SAAS,WAAW,IAAI,SAAS,IAAI,SAC7C,SAAS;AAEb,UAAM,SAAS,UAAU,IAAI,KAAK,SAChC,IAAI,MAAM,OAAO,GAAG,KACnB,QAAQ,IAAI,SAAS,KAAK;AAE7B,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ACD,WAAO;AAAA,EACR,SAAQ,GAAP;AACA,QAAI,OAAO,QAAQ,YAAY,CAAC,OAAO,SAAS,GAAG,GAAG;AACpD,YAAM,eAAe,MAAM,QAAQ,GAAG,KAAK,IAAI,WAAW;AAC1D,YAAM,OAAO,OAAO,IAAI;AAAA,QACtB,gBAAgB,eAAe,mBAAmB,OAAO,GAAG,CAAC;AAAA,MACrE,GAAS;AAAA,QACD,MAAM;AAAA,QACN,aAAa;AAAA,MACrB,CAAO;AAAA,IACF;AAED,UAAM,IAAI,eAAe,GAAG,WAAW,SAAS,SAAS;AAAA,EAC1D;AACH;AAKA,MAAM,WAAW,SAAO,OAAO,GAAG,EAAE,QAAQ,WAAW,EAAE;AAEzD,IAAA,4BAAiB;AACjB,UAAU,iBAAiB;AAE3B,UAAU,eAAe,CAAC,KAAK,YAAY;AACzC,MAAI;AACF,WAAO,KAAK,MAAM,SAAS,GAAG,GAAG,OAAO;AAAA,EAC5C,SAAW,GAAP;AAAA,EAAY;AAChB;;","x_google_ignoreList":[0]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../node_modules/json-parse-even-better-errors/index.js"],"sourcesContent":["'use strict'\n\nconst hexify = char => {\n const h = char.charCodeAt(0).toString(16).toUpperCase()\n return '0x' + (h.length % 2 ? '0' : '') + h\n}\n\nconst parseError = (e, txt, context) => {\n if (!txt) {\n return {\n message: e.message + ' while parsing empty string',\n position: 0,\n }\n }\n const badToken = e.message.match(/^Unexpected token (.) .*position\\s+(\\d+)/i)\n const errIdx = badToken ? +badToken[2]\n : e.message.match(/^Unexpected end of JSON.*/i) ? txt.length - 1\n : null\n\n const msg = badToken ? e.message.replace(/^Unexpected token ./, `Unexpected token ${\n JSON.stringify(badToken[1])\n } (${hexify(badToken[1])})`)\n : e.message\n\n if (errIdx !== null && errIdx !== undefined) {\n const start = errIdx <= context ? 0\n : errIdx - context\n\n const end = errIdx + context >= txt.length ? txt.length\n : errIdx + context\n\n const slice = (start === 0 ? '' : '...') +\n txt.slice(start, end) +\n (end === txt.length ? '' : '...')\n\n const near = txt === slice ? '' : 'near '\n\n return {\n message: msg + ` while parsing ${near}${JSON.stringify(slice)}`,\n position: errIdx,\n }\n } else {\n return {\n message: msg + ` while parsing '${txt.slice(0, context * 2)}'`,\n position: 0,\n }\n }\n}\n\nclass JSONParseError extends SyntaxError {\n constructor (er, txt, context, caller) {\n context = context || 20\n const metadata = parseError(er, txt, context)\n super(metadata.message)\n Object.assign(this, metadata)\n this.code = 'EJSONPARSE'\n this.systemError = er\n Error.captureStackTrace(this, caller || this.constructor)\n }\n get name () { return this.constructor.name }\n set name (n) {}\n get [Symbol.toStringTag] () { return this.constructor.name }\n}\n\nconst kIndent = Symbol.for('indent')\nconst kNewline = Symbol.for('newline')\n// only respect indentation if we got a line break, otherwise squash it\n// things other than objects and arrays aren't indented, so ignore those\n// Important: in both of these regexps, the $1 capture group is the newline\n// or undefined, and the $2 capture group is the indent, or undefined.\nconst formatRE = /^\\s*[{\\[]((?:\\r?\\n)+)([\\s\\t]*)/\nconst emptyRE = /^(?:\\{\\}|\\[\\])((?:\\r?\\n)+)?$/\n\nconst parseJson = (txt, reviver, context) => {\n const parseText = stripBOM(txt)\n context = context || 20\n try {\n // get the indentation so that we can save it back nicely\n // if the file starts with {\" then we have an indent of '', ie, none\n // otherwise, pick the indentation of the next line after the first \\n\n // If the pattern doesn't match, then it means no indentation.\n // JSON.stringify ignores symbols, so this is reasonably safe.\n // if the string is '{}' or '[]', then use the default 2-space indent.\n const [, newline = '\\n', indent = ' '] = parseText.match(emptyRE) ||\n parseText.match(formatRE) ||\n [, '', '']\n\n const result = JSON.parse(parseText, reviver)\n if (result && typeof result === 'object') {\n result[kNewline] = newline\n result[kIndent] = indent\n }\n return result\n } catch (e) {\n if (typeof txt !== 'string' && !Buffer.isBuffer(txt)) {\n const isEmptyArray = Array.isArray(txt) && txt.length === 0\n throw Object.assign(new TypeError(\n `Cannot parse ${isEmptyArray ? 'an empty array' : String(txt)}`\n ), {\n code: 'EJSONPARSE',\n systemError: e,\n })\n }\n\n throw new JSONParseError(e, parseText, context, parseJson)\n }\n}\n\n// Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)\n// because the buffer-to-string conversion in `fs.readFileSync()`\n// translates it to FEFF, the UTF-16 BOM.\nconst stripBOM = txt => String(txt).replace(/^\\uFEFF/, '')\n\nmodule.exports = parseJson\nparseJson.JSONParseError = JSONParseError\n\nparseJson.noExceptions = (txt, reviver) => {\n try {\n return JSON.parse(stripBOM(txt), reviver)\n } catch (e) {}\n}\n"],"names":[],"mappings":"AAEA,MAAM,SAAS,UAAQ;AACrB,QAAM,IAAI,KAAK,WAAW,CAAC,EAAE,SAAS,EAAE,EAAE,YAAa;AACvD,SAAO,QAAQ,EAAE,SAAS,IAAI,MAAM,MAAM;AAC5C;AAEA,MAAM,aAAa,CAAC,GAAG,KAAK,YAAY;AACtC,MAAI,CAAC,KAAK;AACR,WAAO;AAAA,MACL,SAAS,EAAE,UAAU;AAAA,MACrB,UAAU;AAAA,IACX;AAAA,EACF;AACD,QAAM,WAAW,EAAE,QAAQ,MAAM,2CAA2C;AAC5E,QAAM,SAAS,WAAW,CAAC,SAAS,CAAC,IACjC,EAAE,QAAQ,MAAM,4BAA4B,IAAI,IAAI,SAAS,IAC7D;AAEJ,QAAM,MAAM,WAAW,EAAE,QAAQ,QAAQ,uBAAuB,oBAC5D,KAAK,UAAU,SAAS,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../node_modules/json-parse-even-better-errors/index.js"],"sourcesContent":["'use strict'\n\nconst hexify = char => {\n const h = char.charCodeAt(0).toString(16).toUpperCase()\n return '0x' + (h.length % 2 ? '0' : '') + h\n}\n\nconst parseError = (e, txt, context) => {\n if (!txt) {\n return {\n message: e.message + ' while parsing empty string',\n position: 0,\n }\n }\n const badToken = e.message.match(/^Unexpected token (.) .*position\\s+(\\d+)/i)\n const errIdx = badToken ? +badToken[2]\n : e.message.match(/^Unexpected end of JSON.*/i) ? txt.length - 1\n : null\n\n const msg = badToken ? e.message.replace(/^Unexpected token ./, `Unexpected token ${\n JSON.stringify(badToken[1])\n } (${hexify(badToken[1])})`)\n : e.message\n\n if (errIdx !== null && errIdx !== undefined) {\n const start = errIdx <= context ? 0\n : errIdx - context\n\n const end = errIdx + context >= txt.length ? txt.length\n : errIdx + context\n\n const slice = (start === 0 ? '' : '...') +\n txt.slice(start, end) +\n (end === txt.length ? '' : '...')\n\n const near = txt === slice ? '' : 'near '\n\n return {\n message: msg + ` while parsing ${near}${JSON.stringify(slice)}`,\n position: errIdx,\n }\n } else {\n return {\n message: msg + ` while parsing '${txt.slice(0, context * 2)}'`,\n position: 0,\n }\n }\n}\n\nclass JSONParseError extends SyntaxError {\n constructor (er, txt, context, caller) {\n context = context || 20\n const metadata = parseError(er, txt, context)\n super(metadata.message)\n Object.assign(this, metadata)\n this.code = 'EJSONPARSE'\n this.systemError = er\n Error.captureStackTrace(this, caller || this.constructor)\n }\n get name () { return this.constructor.name }\n set name (n) {}\n get [Symbol.toStringTag] () { return this.constructor.name }\n}\n\nconst kIndent = Symbol.for('indent')\nconst kNewline = Symbol.for('newline')\n// only respect indentation if we got a line break, otherwise squash it\n// things other than objects and arrays aren't indented, so ignore those\n// Important: in both of these regexps, the $1 capture group is the newline\n// or undefined, and the $2 capture group is the indent, or undefined.\nconst formatRE = /^\\s*[{\\[]((?:\\r?\\n)+)([\\s\\t]*)/\nconst emptyRE = /^(?:\\{\\}|\\[\\])((?:\\r?\\n)+)?$/\n\nconst parseJson = (txt, reviver, context) => {\n const parseText = stripBOM(txt)\n context = context || 20\n try {\n // get the indentation so that we can save it back nicely\n // if the file starts with {\" then we have an indent of '', ie, none\n // otherwise, pick the indentation of the next line after the first \\n\n // If the pattern doesn't match, then it means no indentation.\n // JSON.stringify ignores symbols, so this is reasonably safe.\n // if the string is '{}' or '[]', then use the default 2-space indent.\n const [, newline = '\\n', indent = ' '] = parseText.match(emptyRE) ||\n parseText.match(formatRE) ||\n [, '', '']\n\n const result = JSON.parse(parseText, reviver)\n if (result && typeof result === 'object') {\n result[kNewline] = newline\n result[kIndent] = indent\n }\n return result\n } catch (e) {\n if (typeof txt !== 'string' && !Buffer.isBuffer(txt)) {\n const isEmptyArray = Array.isArray(txt) && txt.length === 0\n throw Object.assign(new TypeError(\n `Cannot parse ${isEmptyArray ? 'an empty array' : String(txt)}`\n ), {\n code: 'EJSONPARSE',\n systemError: e,\n })\n }\n\n throw new JSONParseError(e, parseText, context, parseJson)\n }\n}\n\n// Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)\n// because the buffer-to-string conversion in `fs.readFileSync()`\n// translates it to FEFF, the UTF-16 BOM.\nconst stripBOM = txt => String(txt).replace(/^\\uFEFF/, '')\n\nmodule.exports = parseJson\nparseJson.JSONParseError = JSONParseError\n\nparseJson.noExceptions = (txt, reviver) => {\n try {\n return JSON.parse(stripBOM(txt), reviver)\n } catch (e) {}\n}\n"],"names":[],"mappings":"AAEA,MAAM,SAAS,UAAQ;AACrB,QAAM,IAAI,KAAK,WAAW,CAAC,EAAE,SAAS,EAAE,EAAE,YAAa;AACvD,SAAO,QAAQ,EAAE,SAAS,IAAI,MAAM,MAAM;AAC5C;AAEA,MAAM,aAAa,CAAC,GAAG,KAAK,YAAY;AACtC,MAAI,CAAC,KAAK;AACR,WAAO;AAAA,MACL,SAAS,EAAE,UAAU;AAAA,MACrB,UAAU;AAAA,IACX;AAAA,EACF;AACD,QAAM,WAAW,EAAE,QAAQ,MAAM,2CAA2C;AAC5E,QAAM,SAAS,WAAW,CAAC,SAAS,CAAC,IACjC,EAAE,QAAQ,MAAM,4BAA4B,IAAI,IAAI,SAAS,IAC7D;AAEJ,QAAM,MAAM,WAAW,EAAE,QAAQ,QAAQ,uBAAuB,oBAC5D,KAAK,UAAU,SAAS,CAAC,CAAC,CAChC,KAAS,OAAO,SAAS,CAAC,CAAC,CAAC,GAAG,IACzB,EAAE;AAEN,MAAI,WAA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