prismic-ts-codegen 0.1.16 → 0.1.17
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/bin/prismic-ts-codegen.js +3 -0
- package/dist/_node_modules/@babel/code-frame/lib/index.cjs +144 -0
- package/dist/_node_modules/@babel/code-frame/lib/index.cjs.map +1 -0
- package/dist/_node_modules/@babel/code-frame/lib/index.js +143 -0
- package/dist/_node_modules/@babel/code-frame/lib/index.js.map +1 -0
- package/dist/_node_modules/@babel/helper-validator-identifier/lib/identifier.cjs +82 -0
- package/dist/_node_modules/@babel/helper-validator-identifier/lib/identifier.cjs.map +1 -0
- package/dist/_node_modules/@babel/helper-validator-identifier/lib/identifier.js +83 -0
- package/dist/_node_modules/@babel/helper-validator-identifier/lib/identifier.js.map +1 -0
- package/dist/_node_modules/@babel/helper-validator-identifier/lib/index.cjs +62 -0
- package/dist/_node_modules/@babel/helper-validator-identifier/lib/index.cjs.map +1 -0
- package/dist/_node_modules/@babel/helper-validator-identifier/lib/index.js +61 -0
- package/dist/_node_modules/@babel/helper-validator-identifier/lib/index.js.map +1 -0
- package/dist/_node_modules/@babel/helper-validator-identifier/lib/keyword.cjs +35 -0
- package/dist/_node_modules/@babel/helper-validator-identifier/lib/keyword.cjs.map +1 -0
- package/dist/_node_modules/@babel/helper-validator-identifier/lib/keyword.js +36 -0
- package/dist/_node_modules/@babel/helper-validator-identifier/lib/keyword.js.map +1 -0
- package/dist/_node_modules/@babel/highlight/lib/index.cjs +100 -0
- package/dist/_node_modules/@babel/highlight/lib/index.cjs.map +1 -0
- package/dist/_node_modules/@babel/highlight/lib/index.js +99 -0
- package/dist/_node_modules/@babel/highlight/lib/index.js.map +1 -0
- package/dist/_node_modules/ansi-styles/index.cjs +146 -0
- package/dist/_node_modules/ansi-styles/index.cjs.map +1 -0
- package/dist/_node_modules/ansi-styles/index.js +146 -0
- package/dist/_node_modules/ansi-styles/index.js.map +1 -0
- package/dist/_node_modules/arrify/index.cjs +10 -0
- package/dist/_node_modules/arrify/index.cjs.map +1 -0
- package/dist/_node_modules/arrify/index.js +10 -0
- package/dist/_node_modules/arrify/index.js.map +1 -0
- package/dist/_node_modules/camelcase/index.cjs +83 -0
- package/dist/_node_modules/camelcase/index.cjs.map +1 -0
- package/dist/_node_modules/camelcase/index.js +84 -0
- package/dist/_node_modules/camelcase/index.js.map +1 -0
- package/dist/_node_modules/camelcase-keys/index.cjs +55 -0
- package/dist/_node_modules/camelcase-keys/index.cjs.map +1 -0
- package/dist/_node_modules/camelcase-keys/index.js +56 -0
- package/dist/_node_modules/camelcase-keys/index.js.map +1 -0
- package/dist/_node_modules/chalk/index.cjs +172 -0
- package/dist/_node_modules/chalk/index.cjs.map +1 -0
- package/dist/_node_modules/chalk/index.js +172 -0
- package/dist/_node_modules/chalk/index.js.map +1 -0
- package/dist/_node_modules/chalk/templates.cjs +108 -0
- package/dist/_node_modules/chalk/templates.cjs.map +1 -0
- package/dist/_node_modules/chalk/templates.js +108 -0
- package/dist/_node_modules/chalk/templates.js.map +1 -0
- package/dist/_node_modules/color-convert/conversions.cjs +710 -0
- package/dist/_node_modules/color-convert/conversions.cjs.map +1 -0
- package/dist/_node_modules/color-convert/conversions.js +710 -0
- package/dist/_node_modules/color-convert/conversions.js.map +1 -0
- package/dist/_node_modules/color-convert/index.cjs +59 -0
- package/dist/_node_modules/color-convert/index.cjs.map +1 -0
- package/dist/_node_modules/color-convert/index.js +59 -0
- package/dist/_node_modules/color-convert/index.js.map +1 -0
- package/dist/_node_modules/color-convert/route.cjs +69 -0
- package/dist/_node_modules/color-convert/route.cjs.map +1 -0
- package/dist/_node_modules/color-convert/route.js +69 -0
- package/dist/_node_modules/color-convert/route.js.map +1 -0
- package/dist/_node_modules/color-name/index.cjs +154 -0
- package/dist/_node_modules/color-name/index.cjs.map +1 -0
- package/dist/_node_modules/color-name/index.js +154 -0
- package/dist/_node_modules/color-name/index.js.map +1 -0
- package/dist/_node_modules/data-uri-to-buffer/dist/index.cjs +41 -0
- package/dist/_node_modules/data-uri-to-buffer/dist/index.cjs.map +1 -0
- package/dist/_node_modules/data-uri-to-buffer/dist/index.js +41 -0
- package/dist/_node_modules/data-uri-to-buffer/dist/index.js.map +1 -0
- package/dist/_node_modules/decamelize/index.cjs +38 -0
- package/dist/_node_modules/decamelize/index.cjs.map +1 -0
- package/dist/_node_modules/decamelize/index.js +39 -0
- package/dist/_node_modules/decamelize/index.js.map +1 -0
- package/dist/_node_modules/decamelize-keys/index.cjs +50 -0
- package/dist/_node_modules/decamelize-keys/index.cjs.map +1 -0
- package/dist/_node_modules/decamelize-keys/index.js +51 -0
- package/dist/_node_modules/decamelize-keys/index.js.map +1 -0
- package/dist/_node_modules/error-ex/index.cjs +109 -0
- package/dist/_node_modules/error-ex/index.cjs.map +1 -0
- package/dist/_node_modules/error-ex/index.js +109 -0
- package/dist/_node_modules/error-ex/index.js.map +1 -0
- package/dist/_node_modules/escape-string-regexp/index.cjs +11 -0
- package/dist/_node_modules/escape-string-regexp/index.cjs.map +1 -0
- package/dist/_node_modules/escape-string-regexp/index.js +11 -0
- package/dist/_node_modules/escape-string-regexp/index.js.map +1 -0
- package/dist/_node_modules/fetch-blob/file.cjs +61 -0
- package/dist/_node_modules/fetch-blob/file.cjs.map +1 -0
- package/dist/_node_modules/fetch-blob/file.js +61 -0
- package/dist/_node_modules/fetch-blob/file.js.map +1 -0
- package/dist/_node_modules/fetch-blob/index.cjs +223 -0
- package/dist/_node_modules/fetch-blob/index.cjs.map +1 -0
- package/dist/_node_modules/fetch-blob/index.js +223 -0
- package/dist/_node_modules/fetch-blob/index.js.map +1 -0
- package/dist/_node_modules/fetch-blob/streams.cjs +43 -0
- package/dist/_node_modules/fetch-blob/streams.cjs.map +1 -0
- package/dist/_node_modules/fetch-blob/streams.js +42 -0
- package/dist/_node_modules/fetch-blob/streams.js.map +1 -0
- package/dist/_node_modules/formdata-polyfill/esm.min.cjs +116 -0
- package/dist/_node_modules/formdata-polyfill/esm.min.cjs.map +1 -0
- package/dist/_node_modules/formdata-polyfill/esm.min.js +116 -0
- package/dist/_node_modules/formdata-polyfill/esm.min.js.map +1 -0
- package/dist/_node_modules/function-bind/implementation.cjs +47 -0
- package/dist/_node_modules/function-bind/implementation.cjs.map +1 -0
- package/dist/_node_modules/function-bind/implementation.js +47 -0
- package/dist/_node_modules/function-bind/implementation.js.map +1 -0
- package/dist/_node_modules/function-bind/index.cjs +7 -0
- package/dist/_node_modules/function-bind/index.cjs.map +1 -0
- package/dist/_node_modules/function-bind/index.js +7 -0
- package/dist/_node_modules/function-bind/index.js.map +1 -0
- package/dist/_node_modules/hard-rejection/index.cjs +25 -0
- package/dist/_node_modules/hard-rejection/index.cjs.map +1 -0
- package/dist/_node_modules/hard-rejection/index.js +26 -0
- package/dist/_node_modules/hard-rejection/index.js.map +1 -0
- package/dist/_node_modules/has/src/index.cjs +7 -0
- package/dist/_node_modules/has/src/index.cjs.map +1 -0
- package/dist/_node_modules/has/src/index.js +7 -0
- package/dist/_node_modules/has/src/index.js.map +1 -0
- package/dist/_node_modules/hosted-git-info/lib/from-url.cjs +93 -0
- package/dist/_node_modules/hosted-git-info/lib/from-url.cjs.map +1 -0
- package/dist/_node_modules/hosted-git-info/lib/from-url.js +93 -0
- package/dist/_node_modules/hosted-git-info/lib/from-url.js.map +1 -0
- package/dist/_node_modules/hosted-git-info/lib/hosts.cjs +164 -0
- package/dist/_node_modules/hosted-git-info/lib/hosts.cjs.map +1 -0
- package/dist/_node_modules/hosted-git-info/lib/hosts.js +164 -0
- package/dist/_node_modules/hosted-git-info/lib/hosts.js.map +1 -0
- package/dist/_node_modules/hosted-git-info/lib/index.cjs +168 -0
- package/dist/_node_modules/hosted-git-info/lib/index.cjs.map +1 -0
- package/dist/_node_modules/hosted-git-info/lib/index.js +168 -0
- package/dist/_node_modules/hosted-git-info/lib/index.js.map +1 -0
- package/dist/_node_modules/hosted-git-info/lib/parse-url.cjs +51 -0
- package/dist/_node_modules/hosted-git-info/lib/parse-url.cjs.map +1 -0
- package/dist/_node_modules/hosted-git-info/lib/parse-url.js +51 -0
- package/dist/_node_modules/hosted-git-info/lib/parse-url.js.map +1 -0
- package/dist/_node_modules/indent-string/index.cjs +34 -0
- package/dist/_node_modules/indent-string/index.cjs.map +1 -0
- package/dist/_node_modules/indent-string/index.js +35 -0
- package/dist/_node_modules/indent-string/index.js.map +1 -0
- package/dist/_node_modules/is-arrayish/index.cjs +10 -0
- package/dist/_node_modules/is-arrayish/index.cjs.map +1 -0
- package/dist/_node_modules/is-arrayish/index.js +10 -0
- package/dist/_node_modules/is-arrayish/index.js.map +1 -0
- package/dist/_node_modules/is-core-module/core.json.cjs +496 -0
- package/dist/_node_modules/is-core-module/core.json.cjs.map +1 -0
- package/dist/_node_modules/is-core-module/core.json.js +496 -0
- package/dist/_node_modules/is-core-module/core.json.js.map +1 -0
- package/dist/_node_modules/is-core-module/index.cjs +62 -0
- package/dist/_node_modules/is-core-module/index.cjs.map +1 -0
- package/dist/_node_modules/is-core-module/index.js +62 -0
- package/dist/_node_modules/is-core-module/index.js.map +1 -0
- package/dist/_node_modules/is-plain-obj/index.cjs +9 -0
- package/dist/_node_modules/is-plain-obj/index.cjs.map +1 -0
- package/dist/_node_modules/is-plain-obj/index.js +9 -0
- package/dist/_node_modules/is-plain-obj/index.js.map +1 -0
- package/dist/_node_modules/js-tokens/index.cjs +27 -0
- package/dist/_node_modules/js-tokens/index.cjs.map +1 -0
- package/dist/_node_modules/js-tokens/index.js +26 -0
- package/dist/_node_modules/js-tokens/index.js.map +1 -0
- package/dist/_node_modules/json-parse-even-better-errors/index.cjs +90 -0
- package/dist/_node_modules/json-parse-even-better-errors/index.cjs.map +1 -0
- package/dist/_node_modules/json-parse-even-better-errors/index.js +90 -0
- package/dist/_node_modules/json-parse-even-better-errors/index.js.map +1 -0
- package/dist/_node_modules/kind-of/index.cjs +129 -0
- package/dist/_node_modules/kind-of/index.cjs.map +1 -0
- package/dist/_node_modules/kind-of/index.js +129 -0
- package/dist/_node_modules/kind-of/index.js.map +1 -0
- package/dist/_node_modules/lines-and-columns/build/index.cjs +67 -0
- package/dist/_node_modules/lines-and-columns/build/index.cjs.map +1 -0
- package/dist/_node_modules/lines-and-columns/build/index.js +66 -0
- package/dist/_node_modules/lines-and-columns/build/index.js.map +1 -0
- package/dist/_node_modules/lru-cache/index.cjs +1015 -0
- package/dist/_node_modules/lru-cache/index.cjs.map +1 -0
- package/dist/_node_modules/lru-cache/index.js +1015 -0
- package/dist/_node_modules/lru-cache/index.js.map +1 -0
- package/dist/_node_modules/map-obj/index.cjs +49 -0
- package/dist/_node_modules/map-obj/index.cjs.map +1 -0
- package/dist/_node_modules/map-obj/index.js +50 -0
- package/dist/_node_modules/map-obj/index.js.map +1 -0
- package/dist/_node_modules/meow/source/index.cjs +88 -0
- package/dist/_node_modules/meow/source/index.cjs.map +1 -0
- package/dist/_node_modules/meow/source/index.js +89 -0
- package/dist/_node_modules/meow/source/index.js.map +1 -0
- package/dist/_node_modules/meow/source/options.cjs +83 -0
- package/dist/_node_modules/meow/source/options.cjs.map +1 -0
- package/dist/_node_modules/meow/source/options.js +83 -0
- package/dist/_node_modules/meow/source/options.js.map +1 -0
- package/dist/_node_modules/meow/source/parser.cjs +61 -0
- package/dist/_node_modules/meow/source/parser.cjs.map +1 -0
- package/dist/_node_modules/meow/source/parser.js +61 -0
- package/dist/_node_modules/meow/source/parser.js.map +1 -0
- package/dist/_node_modules/meow/source/utils.cjs +8 -0
- package/dist/_node_modules/meow/source/utils.cjs.map +1 -0
- package/dist/_node_modules/meow/source/utils.js +8 -0
- package/dist/_node_modules/meow/source/utils.js.map +1 -0
- package/dist/_node_modules/meow/source/validate.cjs +102 -0
- package/dist/_node_modules/meow/source/validate.cjs.map +1 -0
- package/dist/_node_modules/meow/source/validate.js +102 -0
- package/dist/_node_modules/meow/source/validate.js.map +1 -0
- package/dist/_node_modules/min-indent/index.cjs +12 -0
- package/dist/_node_modules/min-indent/index.cjs.map +1 -0
- package/dist/_node_modules/min-indent/index.js +13 -0
- package/dist/_node_modules/min-indent/index.js.map +1 -0
- package/dist/_node_modules/minimist-options/index.cjs +94 -0
- package/dist/_node_modules/minimist-options/index.cjs.map +1 -0
- package/dist/_node_modules/minimist-options/index.js +95 -0
- package/dist/_node_modules/minimist-options/index.js.map +1 -0
- package/dist/_node_modules/node-domexception/index.cjs +11 -0
- package/dist/_node_modules/node-domexception/index.cjs.map +1 -0
- package/dist/_node_modules/node-domexception/index.js +10 -0
- package/dist/_node_modules/node-domexception/index.js.map +1 -0
- package/dist/_node_modules/node-fetch/src/body.cjs +262 -0
- package/dist/_node_modules/node-fetch/src/body.cjs.map +1 -0
- package/dist/_node_modules/node-fetch/src/body.js +262 -0
- package/dist/_node_modules/node-fetch/src/body.js.map +1 -0
- package/dist/_node_modules/node-fetch/src/errors/abort-error.cjs +10 -0
- package/dist/_node_modules/node-fetch/src/errors/abort-error.cjs.map +1 -0
- package/dist/_node_modules/node-fetch/src/errors/abort-error.js +10 -0
- package/dist/_node_modules/node-fetch/src/errors/abort-error.js.map +1 -0
- package/dist/_node_modules/node-fetch/src/errors/base.cjs +17 -0
- package/dist/_node_modules/node-fetch/src/errors/base.cjs.map +1 -0
- package/dist/_node_modules/node-fetch/src/errors/base.js +17 -0
- package/dist/_node_modules/node-fetch/src/errors/base.js.map +1 -0
- package/dist/_node_modules/node-fetch/src/errors/fetch-error.cjs +19 -0
- package/dist/_node_modules/node-fetch/src/errors/fetch-error.cjs.map +1 -0
- package/dist/_node_modules/node-fetch/src/errors/fetch-error.js +19 -0
- package/dist/_node_modules/node-fetch/src/errors/fetch-error.js.map +1 -0
- package/dist/_node_modules/node-fetch/src/headers.cjs +190 -0
- package/dist/_node_modules/node-fetch/src/headers.cjs.map +1 -0
- package/dist/_node_modules/node-fetch/src/headers.js +190 -0
- package/dist/_node_modules/node-fetch/src/headers.js.map +1 -0
- package/dist/_node_modules/node-fetch/src/index.cjs +292 -0
- package/dist/_node_modules/node-fetch/src/index.cjs.map +1 -0
- package/dist/_node_modules/node-fetch/src/index.js +292 -0
- package/dist/_node_modules/node-fetch/src/index.js.map +1 -0
- package/dist/_node_modules/node-fetch/src/request.cjs +206 -0
- package/dist/_node_modules/node-fetch/src/request.cjs.map +1 -0
- package/dist/_node_modules/node-fetch/src/request.js +206 -0
- package/dist/_node_modules/node-fetch/src/request.js.map +1 -0
- package/dist/_node_modules/node-fetch/src/response.cjs +122 -0
- package/dist/_node_modules/node-fetch/src/response.cjs.map +1 -0
- package/dist/_node_modules/node-fetch/src/response.js +123 -0
- package/dist/_node_modules/node-fetch/src/response.js.map +1 -0
- package/dist/_node_modules/node-fetch/src/utils/get-search.cjs +12 -0
- package/dist/_node_modules/node-fetch/src/utils/get-search.cjs.map +1 -0
- package/dist/_node_modules/node-fetch/src/utils/get-search.js +12 -0
- package/dist/_node_modules/node-fetch/src/utils/get-search.js.map +1 -0
- package/dist/_node_modules/node-fetch/src/utils/is-redirect.cjs +8 -0
- package/dist/_node_modules/node-fetch/src/utils/is-redirect.cjs.map +1 -0
- package/dist/_node_modules/node-fetch/src/utils/is-redirect.js +8 -0
- package/dist/_node_modules/node-fetch/src/utils/is-redirect.js.map +1 -0
- package/dist/_node_modules/node-fetch/src/utils/is.cjs +28 -0
- package/dist/_node_modules/node-fetch/src/utils/is.cjs.map +1 -0
- package/dist/_node_modules/node-fetch/src/utils/is.js +28 -0
- package/dist/_node_modules/node-fetch/src/utils/is.js.map +1 -0
- package/dist/_node_modules/node-fetch/src/utils/multipart-parser.cjs +356 -0
- package/dist/_node_modules/node-fetch/src/utils/multipart-parser.cjs.map +1 -0
- package/dist/_node_modules/node-fetch/src/utils/multipart-parser.js +356 -0
- package/dist/_node_modules/node-fetch/src/utils/multipart-parser.js.map +1 -0
- package/dist/_node_modules/node-fetch/src/utils/referrer.cjs +149 -0
- package/dist/_node_modules/node-fetch/src/utils/referrer.cjs.map +1 -0
- package/dist/_node_modules/node-fetch/src/utils/referrer.js +149 -0
- package/dist/_node_modules/node-fetch/src/utils/referrer.js.map +1 -0
- package/dist/_node_modules/normalize-package-data/lib/extract_description.cjs +24 -0
- package/dist/_node_modules/normalize-package-data/lib/extract_description.cjs.map +1 -0
- package/dist/_node_modules/normalize-package-data/lib/extract_description.js +24 -0
- package/dist/_node_modules/normalize-package-data/lib/extract_description.js.map +1 -0
- package/dist/_node_modules/normalize-package-data/lib/fixer.cjs +438 -0
- package/dist/_node_modules/normalize-package-data/lib/fixer.cjs.map +1 -0
- package/dist/_node_modules/normalize-package-data/lib/fixer.js +438 -0
- package/dist/_node_modules/normalize-package-data/lib/fixer.js.map +1 -0
- package/dist/_node_modules/normalize-package-data/lib/make_warning.cjs +26 -0
- package/dist/_node_modules/normalize-package-data/lib/make_warning.cjs.map +1 -0
- package/dist/_node_modules/normalize-package-data/lib/make_warning.js +26 -0
- package/dist/_node_modules/normalize-package-data/lib/make_warning.js.map +1 -0
- package/dist/_node_modules/normalize-package-data/lib/normalize.cjs +58 -0
- package/dist/_node_modules/normalize-package-data/lib/normalize.cjs.map +1 -0
- package/dist/_node_modules/normalize-package-data/lib/normalize.js +59 -0
- package/dist/_node_modules/normalize-package-data/lib/normalize.js.map +1 -0
- package/dist/_node_modules/normalize-package-data/lib/typos.json.cjs +41 -0
- package/dist/_node_modules/normalize-package-data/lib/typos.json.cjs.map +1 -0
- package/dist/_node_modules/normalize-package-data/lib/typos.json.js +41 -0
- package/dist/_node_modules/normalize-package-data/lib/typos.json.js.map +1 -0
- package/dist/_node_modules/normalize-package-data/lib/warning_messages.json.cjs +90 -0
- package/dist/_node_modules/normalize-package-data/lib/warning_messages.json.cjs.map +1 -0
- package/dist/_node_modules/normalize-package-data/lib/warning_messages.json.js +90 -0
- package/dist/_node_modules/normalize-package-data/lib/warning_messages.json.js.map +1 -0
- package/dist/_node_modules/parse-json/index.cjs +54 -0
- package/dist/_node_modules/parse-json/index.cjs.map +1 -0
- package/dist/_node_modules/parse-json/index.js +55 -0
- package/dist/_node_modules/parse-json/index.js.map +1 -0
- package/dist/_node_modules/read-pkg/_node_modules/hosted-git-info/git-host-info.cjs +159 -0
- package/dist/_node_modules/read-pkg/_node_modules/hosted-git-info/git-host-info.cjs.map +1 -0
- package/dist/_node_modules/read-pkg/_node_modules/hosted-git-info/git-host-info.js +159 -0
- package/dist/_node_modules/read-pkg/_node_modules/hosted-git-info/git-host-info.js.map +1 -0
- package/dist/_node_modules/read-pkg/_node_modules/hosted-git-info/git-host.cjs +88 -0
- package/dist/_node_modules/read-pkg/_node_modules/hosted-git-info/git-host.cjs.map +1 -0
- package/dist/_node_modules/read-pkg/_node_modules/hosted-git-info/git-host.js +88 -0
- package/dist/_node_modules/read-pkg/_node_modules/hosted-git-info/git-host.js.map +1 -0
- package/dist/_node_modules/read-pkg/_node_modules/hosted-git-info/index.cjs +180 -0
- package/dist/_node_modules/read-pkg/_node_modules/hosted-git-info/index.cjs.map +1 -0
- package/dist/_node_modules/read-pkg/_node_modules/hosted-git-info/index.js +180 -0
- package/dist/_node_modules/read-pkg/_node_modules/hosted-git-info/index.js.map +1 -0
- package/dist/_node_modules/read-pkg/_node_modules/lru-cache/index.cjs +268 -0
- package/dist/_node_modules/read-pkg/_node_modules/lru-cache/index.cjs.map +1 -0
- package/dist/_node_modules/read-pkg/_node_modules/lru-cache/index.js +268 -0
- package/dist/_node_modules/read-pkg/_node_modules/lru-cache/index.js.map +1 -0
- package/dist/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/extract_description.cjs +20 -0
- package/dist/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/extract_description.cjs.map +1 -0
- package/dist/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/extract_description.js +20 -0
- package/dist/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/extract_description.js.map +1 -0
- package/dist/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/fixer.cjs +438 -0
- package/dist/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/fixer.cjs.map +1 -0
- package/dist/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/fixer.js +438 -0
- package/dist/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/fixer.js.map +1 -0
- package/dist/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/make_warning.cjs +26 -0
- package/dist/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/make_warning.cjs.map +1 -0
- package/dist/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/make_warning.js +26 -0
- package/dist/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/make_warning.js.map +1 -0
- package/dist/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/normalize.cjs +58 -0
- package/dist/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/normalize.cjs.map +1 -0
- package/dist/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/normalize.js +59 -0
- package/dist/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/normalize.js.map +1 -0
- package/dist/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/typos.json.cjs +41 -0
- package/dist/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/typos.json.cjs.map +1 -0
- package/dist/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/typos.json.js +41 -0
- package/dist/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/typos.json.js.map +1 -0
- package/dist/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/warning_messages.json.cjs +90 -0
- package/dist/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/warning_messages.json.cjs.map +1 -0
- package/dist/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/warning_messages.json.js +90 -0
- package/dist/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/warning_messages.json.js.map +1 -0
- package/dist/_node_modules/read-pkg/index.cjs +20 -0
- package/dist/_node_modules/read-pkg/index.cjs.map +1 -0
- package/dist/_node_modules/read-pkg/index.js +20 -0
- package/dist/_node_modules/read-pkg/index.js.map +1 -0
- package/dist/_node_modules/read-pkg-up/_node_modules/find-up/index.cjs +48 -0
- package/dist/_node_modules/read-pkg-up/_node_modules/find-up/index.cjs.map +1 -0
- package/dist/_node_modules/read-pkg-up/_node_modules/find-up/index.js +48 -0
- package/dist/_node_modules/read-pkg-up/_node_modules/find-up/index.js.map +1 -0
- package/dist/_node_modules/read-pkg-up/_node_modules/locate-path/index.cjs +43 -0
- package/dist/_node_modules/read-pkg-up/_node_modules/locate-path/index.cjs.map +1 -0
- package/dist/_node_modules/read-pkg-up/_node_modules/locate-path/index.js +43 -0
- package/dist/_node_modules/read-pkg-up/_node_modules/locate-path/index.js.map +1 -0
- package/dist/_node_modules/read-pkg-up/index.cjs +17 -0
- package/dist/_node_modules/read-pkg-up/index.cjs.map +1 -0
- package/dist/_node_modules/read-pkg-up/index.js +17 -0
- package/dist/_node_modules/read-pkg-up/index.js.map +1 -0
- package/dist/_node_modules/redent/index.cjs +8 -0
- package/dist/_node_modules/redent/index.cjs.map +1 -0
- package/dist/_node_modules/redent/index.js +9 -0
- package/dist/_node_modules/redent/index.js.map +1 -0
- package/dist/_node_modules/semver/classes/semver.cjs +245 -0
- package/dist/_node_modules/semver/classes/semver.cjs.map +1 -0
- package/dist/_node_modules/semver/classes/semver.js +245 -0
- package/dist/_node_modules/semver/classes/semver.js.map +1 -0
- package/dist/_node_modules/semver/functions/clean.cjs +11 -0
- package/dist/_node_modules/semver/functions/clean.cjs.map +1 -0
- package/dist/_node_modules/semver/functions/clean.js +11 -0
- package/dist/_node_modules/semver/functions/clean.js.map +1 -0
- package/dist/_node_modules/semver/functions/parse.cjs +20 -0
- package/dist/_node_modules/semver/functions/parse.cjs.map +1 -0
- package/dist/_node_modules/semver/functions/parse.js +20 -0
- package/dist/_node_modules/semver/functions/parse.js.map +1 -0
- package/dist/_node_modules/semver/functions/valid.cjs +11 -0
- package/dist/_node_modules/semver/functions/valid.cjs.map +1 -0
- package/dist/_node_modules/semver/functions/valid.js +11 -0
- package/dist/_node_modules/semver/functions/valid.js.map +1 -0
- package/dist/_node_modules/semver/internal/constants.cjs +29 -0
- package/dist/_node_modules/semver/internal/constants.cjs.map +1 -0
- package/dist/_node_modules/semver/internal/constants.js +29 -0
- package/dist/_node_modules/semver/internal/constants.js.map +1 -0
- package/dist/_node_modules/semver/internal/debug.cjs +7 -0
- package/dist/_node_modules/semver/internal/debug.cjs.map +1 -0
- package/dist/_node_modules/semver/internal/debug.js +7 -0
- package/dist/_node_modules/semver/internal/debug.js.map +1 -0
- package/dist/_node_modules/semver/internal/identifiers.cjs +19 -0
- package/dist/_node_modules/semver/internal/identifiers.cjs.map +1 -0
- package/dist/_node_modules/semver/internal/identifiers.js +19 -0
- package/dist/_node_modules/semver/internal/identifiers.js.map +1 -0
- package/dist/_node_modules/semver/internal/parse-options.cjs +16 -0
- package/dist/_node_modules/semver/internal/parse-options.cjs.map +1 -0
- package/dist/_node_modules/semver/internal/parse-options.js +16 -0
- package/dist/_node_modules/semver/internal/parse-options.js.map +1 -0
- package/dist/_node_modules/semver/internal/re.cjs +82 -0
- package/dist/_node_modules/semver/internal/re.cjs.map +1 -0
- package/dist/_node_modules/semver/internal/re.js +82 -0
- package/dist/_node_modules/semver/internal/re.js.map +1 -0
- package/dist/_node_modules/spdx-correct/index.cjs +334 -0
- package/dist/_node_modules/spdx-correct/index.cjs.map +1 -0
- package/dist/_node_modules/spdx-correct/index.js +334 -0
- package/dist/_node_modules/spdx-correct/index.js.map +1 -0
- package/dist/_node_modules/spdx-exceptions/index.json.cjs +43 -0
- package/dist/_node_modules/spdx-exceptions/index.json.cjs.map +1 -0
- package/dist/_node_modules/spdx-exceptions/index.json.js +44 -0
- package/dist/_node_modules/spdx-exceptions/index.json.js.map +1 -0
- package/dist/_node_modules/spdx-expression-parse/index.cjs +11 -0
- package/dist/_node_modules/spdx-expression-parse/index.cjs.map +1 -0
- package/dist/_node_modules/spdx-expression-parse/index.js +11 -0
- package/dist/_node_modules/spdx-expression-parse/index.js.map +1 -0
- package/dist/_node_modules/spdx-expression-parse/parse.cjs +111 -0
- package/dist/_node_modules/spdx-expression-parse/parse.cjs.map +1 -0
- package/dist/_node_modules/spdx-expression-parse/parse.js +111 -0
- package/dist/_node_modules/spdx-expression-parse/parse.js.map +1 -0
- package/dist/_node_modules/spdx-expression-parse/scan.cjs +104 -0
- package/dist/_node_modules/spdx-expression-parse/scan.cjs.map +1 -0
- package/dist/_node_modules/spdx-expression-parse/scan.js +104 -0
- package/dist/_node_modules/spdx-expression-parse/scan.js.map +1 -0
- package/dist/_node_modules/spdx-license-ids/deprecated.json.cjs +30 -0
- package/dist/_node_modules/spdx-license-ids/deprecated.json.cjs.map +1 -0
- package/dist/_node_modules/spdx-license-ids/deprecated.json.js +31 -0
- package/dist/_node_modules/spdx-license-ids/deprecated.json.js.map +1 -0
- package/dist/_node_modules/spdx-license-ids/index.json.cjs +510 -0
- package/dist/_node_modules/spdx-license-ids/index.json.cjs.map +1 -0
- package/dist/_node_modules/spdx-license-ids/index.json.js +511 -0
- package/dist/_node_modules/spdx-license-ids/index.json.js.map +1 -0
- package/dist/_node_modules/strip-indent/index.cjs +12 -0
- package/dist/_node_modules/strip-indent/index.cjs.map +1 -0
- package/dist/_node_modules/strip-indent/index.js +13 -0
- package/dist/_node_modules/strip-indent/index.js.map +1 -0
- package/dist/_node_modules/supports-color/browser.cjs +8 -0
- package/dist/_node_modules/supports-color/browser.cjs.map +1 -0
- package/dist/_node_modules/supports-color/browser.js +8 -0
- package/dist/_node_modules/supports-color/browser.js.map +1 -0
- package/dist/_node_modules/trim-newlines/index.cjs +15 -0
- package/dist/_node_modules/trim-newlines/index.cjs.map +1 -0
- package/dist/_node_modules/trim-newlines/index.js +15 -0
- package/dist/_node_modules/trim-newlines/index.js.map +1 -0
- package/dist/_node_modules/validate-npm-package-license/index.cjs +71 -0
- package/dist/_node_modules/validate-npm-package-license/index.cjs.map +1 -0
- package/dist/_node_modules/validate-npm-package-license/index.js +71 -0
- package/dist/_node_modules/validate-npm-package-license/index.js.map +1 -0
- package/dist/_node_modules/web-streams-polyfill/dist/ponyfill.es2018.cjs +3822 -0
- package/dist/_node_modules/web-streams-polyfill/dist/ponyfill.es2018.cjs.map +1 -0
- package/dist/_node_modules/web-streams-polyfill/dist/ponyfill.es2018.js +3822 -0
- package/dist/_node_modules/web-streams-polyfill/dist/ponyfill.es2018.js.map +1 -0
- package/dist/_node_modules/yallist/iterator.cjs +19 -0
- package/dist/_node_modules/yallist/iterator.cjs.map +1 -0
- package/dist/_node_modules/yallist/iterator.js +19 -0
- package/dist/_node_modules/yallist/iterator.js.map +1 -0
- package/dist/_node_modules/yallist/yallist.cjs +367 -0
- package/dist/_node_modules/yallist/yallist.cjs.map +1 -0
- package/dist/_node_modules/yallist/yallist.js +367 -0
- package/dist/_node_modules/yallist/yallist.js.map +1 -0
- package/dist/_node_modules/yargs-parser/build/lib/index.cjs +56 -0
- package/dist/_node_modules/yargs-parser/build/lib/index.cjs.map +1 -0
- package/dist/_node_modules/yargs-parser/build/lib/index.js +57 -0
- package/dist/_node_modules/yargs-parser/build/lib/index.js.map +1 -0
- package/dist/_node_modules/yargs-parser/build/lib/string-utils.cjs +63 -0
- package/dist/_node_modules/yargs-parser/build/lib/string-utils.cjs.map +1 -0
- package/dist/_node_modules/yargs-parser/build/lib/string-utils.js +63 -0
- package/dist/_node_modules/yargs-parser/build/lib/string-utils.js.map +1 -0
- package/dist/_node_modules/yargs-parser/build/lib/tokenize-arg-string.cjs +39 -0
- package/dist/_node_modules/yargs-parser/build/lib/tokenize-arg-string.cjs.map +1 -0
- package/dist/_node_modules/yargs-parser/build/lib/tokenize-arg-string.js +39 -0
- package/dist/_node_modules/yargs-parser/build/lib/tokenize-arg-string.js.map +1 -0
- package/dist/_node_modules/yargs-parser/build/lib/yargs-parser-types.cjs +15 -0
- package/dist/_node_modules/yargs-parser/build/lib/yargs-parser-types.cjs.map +1 -0
- package/dist/_node_modules/yargs-parser/build/lib/yargs-parser-types.js +16 -0
- package/dist/_node_modules/yargs-parser/build/lib/yargs-parser-types.js.map +1 -0
- package/dist/_node_modules/yargs-parser/build/lib/yargs-parser.cjs +847 -0
- package/dist/_node_modules/yargs-parser/build/lib/yargs-parser.cjs.map +1 -0
- package/dist/_node_modules/yargs-parser/build/lib/yargs-parser.js +847 -0
- package/dist/_node_modules/yargs-parser/build/lib/yargs-parser.js.map +1 -0
- package/dist/_virtual/_commonjsHelpers.cjs +9 -0
- package/dist/_virtual/_commonjsHelpers.cjs.map +1 -0
- package/dist/_virtual/_commonjsHelpers.js +9 -0
- package/dist/_virtual/_commonjsHelpers.js.map +1 -0
- package/dist/_virtual/conversions.cjs +5 -0
- package/dist/_virtual/conversions.cjs.map +1 -0
- package/dist/_virtual/conversions.js +5 -0
- package/dist/_virtual/conversions.js.map +1 -0
- package/dist/_virtual/identifier.cjs +5 -0
- package/dist/_virtual/identifier.cjs.map +1 -0
- package/dist/_virtual/identifier.js +5 -0
- package/dist/_virtual/identifier.js.map +1 -0
- package/dist/_virtual/index.cjs +5 -0
- package/dist/_virtual/index.cjs.map +1 -0
- package/dist/_virtual/index.js +5 -0
- package/dist/_virtual/index.js.map +1 -0
- package/dist/_virtual/index10.cjs +5 -0
- package/dist/_virtual/index10.cjs.map +1 -0
- package/dist/_virtual/index10.js +5 -0
- package/dist/_virtual/index10.js.map +1 -0
- package/dist/_virtual/index11.cjs +5 -0
- package/dist/_virtual/index11.cjs.map +1 -0
- package/dist/_virtual/index11.js +5 -0
- package/dist/_virtual/index11.js.map +1 -0
- package/dist/_virtual/index2.cjs +5 -0
- package/dist/_virtual/index2.cjs.map +1 -0
- package/dist/_virtual/index2.js +5 -0
- package/dist/_virtual/index2.js.map +1 -0
- package/dist/_virtual/index3.cjs +5 -0
- package/dist/_virtual/index3.cjs.map +1 -0
- package/dist/_virtual/index3.js +5 -0
- package/dist/_virtual/index3.js.map +1 -0
- package/dist/_virtual/index4.cjs +5 -0
- package/dist/_virtual/index4.cjs.map +1 -0
- package/dist/_virtual/index4.js +5 -0
- package/dist/_virtual/index4.js.map +1 -0
- package/dist/_virtual/index5.cjs +5 -0
- package/dist/_virtual/index5.cjs.map +1 -0
- package/dist/_virtual/index5.js +5 -0
- package/dist/_virtual/index5.js.map +1 -0
- package/dist/_virtual/index6.cjs +5 -0
- package/dist/_virtual/index6.cjs.map +1 -0
- package/dist/_virtual/index6.js +5 -0
- package/dist/_virtual/index6.js.map +1 -0
- package/dist/_virtual/index7.cjs +5 -0
- package/dist/_virtual/index7.cjs.map +1 -0
- package/dist/_virtual/index7.js +5 -0
- package/dist/_virtual/index7.js.map +1 -0
- package/dist/_virtual/index8.cjs +5 -0
- package/dist/_virtual/index8.cjs.map +1 -0
- package/dist/_virtual/index8.js +5 -0
- package/dist/_virtual/index8.js.map +1 -0
- package/dist/_virtual/index9.cjs +5 -0
- package/dist/_virtual/index9.cjs.map +1 -0
- package/dist/_virtual/index9.js +5 -0
- package/dist/_virtual/index9.js.map +1 -0
- package/dist/_virtual/keyword.cjs +5 -0
- package/dist/_virtual/keyword.cjs.map +1 -0
- package/dist/_virtual/keyword.js +5 -0
- package/dist/_virtual/keyword.js.map +1 -0
- package/dist/_virtual/ponyfill.es2018.cjs +5 -0
- package/dist/_virtual/ponyfill.es2018.cjs.map +1 -0
- package/dist/_virtual/ponyfill.es2018.js +5 -0
- package/dist/_virtual/ponyfill.es2018.js.map +1 -0
- package/dist/_virtual/re.cjs +5 -0
- package/dist/_virtual/re.cjs.map +1 -0
- package/dist/_virtual/re.js +5 -0
- package/dist/_virtual/re.js.map +1 -0
- package/dist/cli/loadLocaleIDs.cjs +2 -2
- package/dist/cli/loadLocaleIDs.cjs.map +1 -1
- package/dist/cli/loadLocaleIDs.js +1 -1
- package/dist/cli/loadModels.cjs +2 -2
- package/dist/cli/loadModels.cjs.map +1 -1
- package/dist/cli/loadModels.js +1 -1
- package/dist/cli.cjs +2 -2
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/lib/buildFieldProperties.cjs +2 -0
- package/dist/lib/buildFieldProperties.cjs.map +1 -1
- package/dist/lib/buildFieldProperties.js +2 -0
- package/dist/lib/buildFieldProperties.js.map +1 -1
- package/dist/lib/buildSharedSliceType.cjs +2 -0
- package/dist/lib/buildSharedSliceType.cjs.map +1 -1
- package/dist/lib/buildSharedSliceType.js +2 -0
- package/dist/lib/buildSharedSliceType.js.map +1 -1
- package/package.json +2 -2
- package/src/lib/buildFieldProperties.ts +2 -0
- package/src/lib/buildSharedSliceType.ts +2 -0
- package/bin/prismic-ts-codegen.mjs +0 -3
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
const maybeJoin = (...args) => args.every((arg) => arg) ? args.join("") : "";
|
|
2
|
+
const maybeEncode = (arg) => arg ? encodeURIComponent(arg) : "";
|
|
3
|
+
const formatHashFragment = (f) => f.toLowerCase().replace(/^\W+|\/|\W+$/g, "").replace(/\W+/g, "-");
|
|
4
|
+
const defaults = {
|
|
5
|
+
sshtemplate: ({ domain, user, project, committish }) => `git@${domain}:${user}/${project}.git${maybeJoin("#", committish)}`,
|
|
6
|
+
sshurltemplate: ({ domain, user, project, committish }) => `git+ssh://git@${domain}/${user}/${project}.git${maybeJoin("#", committish)}`,
|
|
7
|
+
edittemplate: ({ domain, user, project, committish, editpath, path }) => `https://${domain}/${user}/${project}${maybeJoin("/", editpath, "/", maybeEncode(committish || "HEAD"), "/", path)}`,
|
|
8
|
+
browsetemplate: ({ domain, user, project, committish, treepath }) => `https://${domain}/${user}/${project}${maybeJoin("/", treepath, "/", maybeEncode(committish))}`,
|
|
9
|
+
browsetreetemplate: ({ domain, user, project, committish, treepath, path, fragment, hashformat }) => `https://${domain}/${user}/${project}/${treepath}/${maybeEncode(committish || "HEAD")}/${path}${maybeJoin("#", hashformat(fragment || ""))}`,
|
|
10
|
+
browseblobtemplate: ({ domain, user, project, committish, blobpath, path, fragment, hashformat }) => `https://${domain}/${user}/${project}/${blobpath}/${maybeEncode(committish || "HEAD")}/${path}${maybeJoin("#", hashformat(fragment || ""))}`,
|
|
11
|
+
docstemplate: ({ domain, user, project, treepath, committish }) => `https://${domain}/${user}/${project}${maybeJoin("/", treepath, "/", maybeEncode(committish))}#readme`,
|
|
12
|
+
httpstemplate: ({ auth, domain, user, project, committish }) => `git+https://${maybeJoin(auth, "@")}${domain}/${user}/${project}.git${maybeJoin("#", committish)}`,
|
|
13
|
+
filetemplate: ({ domain, user, project, committish, path }) => `https://${domain}/${user}/${project}/raw/${maybeEncode(committish || "HEAD")}/${path}`,
|
|
14
|
+
shortcuttemplate: ({ type, user, project, committish }) => `${type}:${user}/${project}${maybeJoin("#", committish)}`,
|
|
15
|
+
pathtemplate: ({ user, project, committish }) => `${user}/${project}${maybeJoin("#", committish)}`,
|
|
16
|
+
bugstemplate: ({ domain, user, project }) => `https://${domain}/${user}/${project}/issues`,
|
|
17
|
+
hashformat: formatHashFragment
|
|
18
|
+
};
|
|
19
|
+
const hosts = {};
|
|
20
|
+
hosts.github = {
|
|
21
|
+
// First two are insecure and generally shouldn't be used any more, but
|
|
22
|
+
// they are still supported.
|
|
23
|
+
protocols: ["git:", "http:", "git+ssh:", "git+https:", "ssh:", "https:"],
|
|
24
|
+
domain: "github.com",
|
|
25
|
+
treepath: "tree",
|
|
26
|
+
blobpath: "blob",
|
|
27
|
+
editpath: "edit",
|
|
28
|
+
filetemplate: ({ auth, user, project, committish, path }) => `https://${maybeJoin(auth, "@")}raw.githubusercontent.com/${user}/${project}/${maybeEncode(committish || "HEAD")}/${path}`,
|
|
29
|
+
gittemplate: ({ auth, domain, user, project, committish }) => `git://${maybeJoin(auth, "@")}${domain}/${user}/${project}.git${maybeJoin("#", committish)}`,
|
|
30
|
+
tarballtemplate: ({ domain, user, project, committish }) => `https://codeload.${domain}/${user}/${project}/tar.gz/${maybeEncode(committish || "HEAD")}`,
|
|
31
|
+
extract: (url) => {
|
|
32
|
+
let [, user, project, type, committish] = url.pathname.split("/", 5);
|
|
33
|
+
if (type && type !== "tree") {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
if (!type) {
|
|
37
|
+
committish = url.hash.slice(1);
|
|
38
|
+
}
|
|
39
|
+
if (project && project.endsWith(".git")) {
|
|
40
|
+
project = project.slice(0, -4);
|
|
41
|
+
}
|
|
42
|
+
if (!user || !project) {
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
return { user, project, committish };
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
hosts.bitbucket = {
|
|
49
|
+
protocols: ["git+ssh:", "git+https:", "ssh:", "https:"],
|
|
50
|
+
domain: "bitbucket.org",
|
|
51
|
+
treepath: "src",
|
|
52
|
+
blobpath: "src",
|
|
53
|
+
editpath: "?mode=edit",
|
|
54
|
+
edittemplate: ({ domain, user, project, committish, treepath, path, editpath }) => `https://${domain}/${user}/${project}${maybeJoin("/", treepath, "/", maybeEncode(committish || "HEAD"), "/", path, editpath)}`,
|
|
55
|
+
tarballtemplate: ({ domain, user, project, committish }) => `https://${domain}/${user}/${project}/get/${maybeEncode(committish || "HEAD")}.tar.gz`,
|
|
56
|
+
extract: (url) => {
|
|
57
|
+
let [, user, project, aux] = url.pathname.split("/", 4);
|
|
58
|
+
if (["get"].includes(aux)) {
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
if (project && project.endsWith(".git")) {
|
|
62
|
+
project = project.slice(0, -4);
|
|
63
|
+
}
|
|
64
|
+
if (!user || !project) {
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
return { user, project, committish: url.hash.slice(1) };
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
hosts.gitlab = {
|
|
71
|
+
protocols: ["git+ssh:", "git+https:", "ssh:", "https:"],
|
|
72
|
+
domain: "gitlab.com",
|
|
73
|
+
treepath: "tree",
|
|
74
|
+
blobpath: "tree",
|
|
75
|
+
editpath: "-/edit",
|
|
76
|
+
httpstemplate: ({ auth, domain, user, project, committish }) => `git+https://${maybeJoin(auth, "@")}${domain}/${user}/${project}.git${maybeJoin("#", committish)}`,
|
|
77
|
+
tarballtemplate: ({ domain, user, project, committish }) => `https://${domain}/${user}/${project}/repository/archive.tar.gz?ref=${maybeEncode(committish || "HEAD")}`,
|
|
78
|
+
extract: (url) => {
|
|
79
|
+
const path = url.pathname.slice(1);
|
|
80
|
+
if (path.includes("/-/") || path.includes("/archive.tar.gz")) {
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
const segments = path.split("/");
|
|
84
|
+
let project = segments.pop();
|
|
85
|
+
if (project.endsWith(".git")) {
|
|
86
|
+
project = project.slice(0, -4);
|
|
87
|
+
}
|
|
88
|
+
const user = segments.join("/");
|
|
89
|
+
if (!user || !project) {
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
return { user, project, committish: url.hash.slice(1) };
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
hosts.gist = {
|
|
96
|
+
protocols: ["git:", "git+ssh:", "git+https:", "ssh:", "https:"],
|
|
97
|
+
domain: "gist.github.com",
|
|
98
|
+
editpath: "edit",
|
|
99
|
+
sshtemplate: ({ domain, project, committish }) => `git@${domain}:${project}.git${maybeJoin("#", committish)}`,
|
|
100
|
+
sshurltemplate: ({ domain, project, committish }) => `git+ssh://git@${domain}/${project}.git${maybeJoin("#", committish)}`,
|
|
101
|
+
edittemplate: ({ domain, user, project, committish, editpath }) => `https://${domain}/${user}/${project}${maybeJoin("/", maybeEncode(committish))}/${editpath}`,
|
|
102
|
+
browsetemplate: ({ domain, project, committish }) => `https://${domain}/${project}${maybeJoin("/", maybeEncode(committish))}`,
|
|
103
|
+
browsetreetemplate: ({ domain, project, committish, path, hashformat }) => `https://${domain}/${project}${maybeJoin("/", maybeEncode(committish))}${maybeJoin("#", hashformat(path))}`,
|
|
104
|
+
browseblobtemplate: ({ domain, project, committish, path, hashformat }) => `https://${domain}/${project}${maybeJoin("/", maybeEncode(committish))}${maybeJoin("#", hashformat(path))}`,
|
|
105
|
+
docstemplate: ({ domain, project, committish }) => `https://${domain}/${project}${maybeJoin("/", maybeEncode(committish))}`,
|
|
106
|
+
httpstemplate: ({ domain, project, committish }) => `git+https://${domain}/${project}.git${maybeJoin("#", committish)}`,
|
|
107
|
+
filetemplate: ({ user, project, committish, path }) => `https://gist.githubusercontent.com/${user}/${project}/raw${maybeJoin("/", maybeEncode(committish))}/${path}`,
|
|
108
|
+
shortcuttemplate: ({ type, project, committish }) => `${type}:${project}${maybeJoin("#", committish)}`,
|
|
109
|
+
pathtemplate: ({ project, committish }) => `${project}${maybeJoin("#", committish)}`,
|
|
110
|
+
bugstemplate: ({ domain, project }) => `https://${domain}/${project}`,
|
|
111
|
+
gittemplate: ({ domain, project, committish }) => `git://${domain}/${project}.git${maybeJoin("#", committish)}`,
|
|
112
|
+
tarballtemplate: ({ project, committish }) => `https://codeload.github.com/gist/${project}/tar.gz/${maybeEncode(committish || "HEAD")}`,
|
|
113
|
+
extract: (url) => {
|
|
114
|
+
let [, user, project, aux] = url.pathname.split("/", 4);
|
|
115
|
+
if (aux === "raw") {
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
if (!project) {
|
|
119
|
+
if (!user) {
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
project = user;
|
|
123
|
+
user = null;
|
|
124
|
+
}
|
|
125
|
+
if (project.endsWith(".git")) {
|
|
126
|
+
project = project.slice(0, -4);
|
|
127
|
+
}
|
|
128
|
+
return { user, project, committish: url.hash.slice(1) };
|
|
129
|
+
},
|
|
130
|
+
hashformat: function(fragment) {
|
|
131
|
+
return fragment && "file-" + formatHashFragment(fragment);
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
hosts.sourcehut = {
|
|
135
|
+
protocols: ["git+ssh:", "https:"],
|
|
136
|
+
domain: "git.sr.ht",
|
|
137
|
+
treepath: "tree",
|
|
138
|
+
blobpath: "tree",
|
|
139
|
+
filetemplate: ({ domain, user, project, committish, path }) => `https://${domain}/${user}/${project}/blob/${maybeEncode(committish) || "HEAD"}/${path}`,
|
|
140
|
+
httpstemplate: ({ domain, user, project, committish }) => `https://${domain}/${user}/${project}.git${maybeJoin("#", committish)}`,
|
|
141
|
+
tarballtemplate: ({ domain, user, project, committish }) => `https://${domain}/${user}/${project}/archive/${maybeEncode(committish) || "HEAD"}.tar.gz`,
|
|
142
|
+
bugstemplate: ({ user, project }) => `https://todo.sr.ht/${user}/${project}`,
|
|
143
|
+
extract: (url) => {
|
|
144
|
+
let [, user, project, aux] = url.pathname.split("/", 4);
|
|
145
|
+
if (["archive"].includes(aux)) {
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
if (project && project.endsWith(".git")) {
|
|
149
|
+
project = project.slice(0, -4);
|
|
150
|
+
}
|
|
151
|
+
if (!user || !project) {
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
return { user, project, committish: url.hash.slice(1) };
|
|
155
|
+
}
|
|
156
|
+
};
|
|
157
|
+
for (const [name, host] of Object.entries(hosts)) {
|
|
158
|
+
hosts[name] = Object.assign({}, defaults, host);
|
|
159
|
+
}
|
|
160
|
+
var hosts_1 = hosts;
|
|
161
|
+
export {
|
|
162
|
+
hosts_1 as h
|
|
163
|
+
};
|
|
164
|
+
//# sourceMappingURL=hosts.js.map
|
|
@@ -0,0 +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,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|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __accessCheck = (obj, member, msg) => {
|
|
3
|
+
if (!member.has(obj))
|
|
4
|
+
throw TypeError("Cannot " + msg);
|
|
5
|
+
};
|
|
6
|
+
var __privateGet = (obj, member, getter) => {
|
|
7
|
+
__accessCheck(obj, member, "read from private field");
|
|
8
|
+
return getter ? getter.call(obj) : member.get(obj);
|
|
9
|
+
};
|
|
10
|
+
var __privateAdd = (obj, member, value) => {
|
|
11
|
+
if (member.has(obj))
|
|
12
|
+
throw TypeError("Cannot add the same private member more than once");
|
|
13
|
+
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
14
|
+
};
|
|
15
|
+
var __privateMethod = (obj, member, method) => {
|
|
16
|
+
__accessCheck(obj, member, "access private method");
|
|
17
|
+
return method;
|
|
18
|
+
};
|
|
19
|
+
var _gitHosts, _protocols, _fill, fill_fn;
|
|
20
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
21
|
+
const index = require("../../lru-cache/index.cjs");
|
|
22
|
+
const hosts$1 = require("./hosts.cjs");
|
|
23
|
+
const fromUrl$1 = require("./from-url.cjs");
|
|
24
|
+
const parseUrl$1 = require("./parse-url.cjs");
|
|
25
|
+
const LRU = index.lruCache;
|
|
26
|
+
const hosts = hosts$1.hosts_1;
|
|
27
|
+
const fromUrl = fromUrl$1.fromUrl;
|
|
28
|
+
const parseUrl = parseUrl$1.parseUrl;
|
|
29
|
+
const cache = new LRU({ max: 1e3 });
|
|
30
|
+
const _GitHost = class {
|
|
31
|
+
constructor(type, user, auth, project, committish, defaultRepresentation, opts = {}) {
|
|
32
|
+
__privateAdd(this, _fill);
|
|
33
|
+
Object.assign(this, __privateGet(_GitHost, _gitHosts)[type], {
|
|
34
|
+
type,
|
|
35
|
+
user,
|
|
36
|
+
auth,
|
|
37
|
+
project,
|
|
38
|
+
committish,
|
|
39
|
+
default: defaultRepresentation,
|
|
40
|
+
opts
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
static addHost(name, host) {
|
|
44
|
+
__privateGet(_GitHost, _gitHosts)[name] = host;
|
|
45
|
+
__privateGet(_GitHost, _gitHosts).byDomain[host.domain] = name;
|
|
46
|
+
__privateGet(_GitHost, _gitHosts).byShortcut[`${name}:`] = name;
|
|
47
|
+
__privateGet(_GitHost, _protocols)[`${name}:`] = { name };
|
|
48
|
+
}
|
|
49
|
+
static fromUrl(giturl, opts) {
|
|
50
|
+
if (typeof giturl !== "string") {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
const key = giturl + JSON.stringify(opts || {});
|
|
54
|
+
if (!cache.has(key)) {
|
|
55
|
+
const hostArgs = fromUrl(giturl, opts, {
|
|
56
|
+
gitHosts: __privateGet(_GitHost, _gitHosts),
|
|
57
|
+
protocols: __privateGet(_GitHost, _protocols)
|
|
58
|
+
});
|
|
59
|
+
cache.set(key, hostArgs ? new _GitHost(...hostArgs) : void 0);
|
|
60
|
+
}
|
|
61
|
+
return cache.get(key);
|
|
62
|
+
}
|
|
63
|
+
static parseUrl(url) {
|
|
64
|
+
return parseUrl(url);
|
|
65
|
+
}
|
|
66
|
+
hash() {
|
|
67
|
+
return this.committish ? `#${this.committish}` : "";
|
|
68
|
+
}
|
|
69
|
+
ssh(opts) {
|
|
70
|
+
return __privateMethod(this, _fill, fill_fn).call(this, this.sshtemplate, opts);
|
|
71
|
+
}
|
|
72
|
+
sshurl(opts) {
|
|
73
|
+
return __privateMethod(this, _fill, fill_fn).call(this, this.sshurltemplate, opts);
|
|
74
|
+
}
|
|
75
|
+
browse(path, ...args) {
|
|
76
|
+
if (typeof path !== "string") {
|
|
77
|
+
return __privateMethod(this, _fill, fill_fn).call(this, this.browsetemplate, path);
|
|
78
|
+
}
|
|
79
|
+
if (typeof args[0] !== "string") {
|
|
80
|
+
return __privateMethod(this, _fill, fill_fn).call(this, this.browsetreetemplate, { ...args[0], path });
|
|
81
|
+
}
|
|
82
|
+
return __privateMethod(this, _fill, fill_fn).call(this, this.browsetreetemplate, { ...args[1], fragment: args[0], path });
|
|
83
|
+
}
|
|
84
|
+
// If the path is known to be a file, then browseFile should be used. For some hosts
|
|
85
|
+
// the url is the same as browse, but for others like GitHub a file can use both `/tree/`
|
|
86
|
+
// and `/blob/` in the path. When using a default committish of `HEAD` then the `/tree/`
|
|
87
|
+
// path will redirect to a specific commit. Using the `/blob/` path avoids this and
|
|
88
|
+
// does not redirect to a different commit.
|
|
89
|
+
browseFile(path, ...args) {
|
|
90
|
+
if (typeof args[0] !== "string") {
|
|
91
|
+
return __privateMethod(this, _fill, fill_fn).call(this, this.browseblobtemplate, { ...args[0], path });
|
|
92
|
+
}
|
|
93
|
+
return __privateMethod(this, _fill, fill_fn).call(this, this.browseblobtemplate, { ...args[1], fragment: args[0], path });
|
|
94
|
+
}
|
|
95
|
+
docs(opts) {
|
|
96
|
+
return __privateMethod(this, _fill, fill_fn).call(this, this.docstemplate, opts);
|
|
97
|
+
}
|
|
98
|
+
bugs(opts) {
|
|
99
|
+
return __privateMethod(this, _fill, fill_fn).call(this, this.bugstemplate, opts);
|
|
100
|
+
}
|
|
101
|
+
https(opts) {
|
|
102
|
+
return __privateMethod(this, _fill, fill_fn).call(this, this.httpstemplate, opts);
|
|
103
|
+
}
|
|
104
|
+
git(opts) {
|
|
105
|
+
return __privateMethod(this, _fill, fill_fn).call(this, this.gittemplate, opts);
|
|
106
|
+
}
|
|
107
|
+
shortcut(opts) {
|
|
108
|
+
return __privateMethod(this, _fill, fill_fn).call(this, this.shortcuttemplate, opts);
|
|
109
|
+
}
|
|
110
|
+
path(opts) {
|
|
111
|
+
return __privateMethod(this, _fill, fill_fn).call(this, this.pathtemplate, opts);
|
|
112
|
+
}
|
|
113
|
+
tarball(opts) {
|
|
114
|
+
return __privateMethod(this, _fill, fill_fn).call(this, this.tarballtemplate, { ...opts, noCommittish: false });
|
|
115
|
+
}
|
|
116
|
+
file(path, opts) {
|
|
117
|
+
return __privateMethod(this, _fill, fill_fn).call(this, this.filetemplate, { ...opts, path });
|
|
118
|
+
}
|
|
119
|
+
edit(path, opts) {
|
|
120
|
+
return __privateMethod(this, _fill, fill_fn).call(this, this.edittemplate, { ...opts, path });
|
|
121
|
+
}
|
|
122
|
+
getDefaultRepresentation() {
|
|
123
|
+
return this.default;
|
|
124
|
+
}
|
|
125
|
+
toString(opts) {
|
|
126
|
+
if (this.default && typeof this[this.default] === "function") {
|
|
127
|
+
return this[this.default](opts);
|
|
128
|
+
}
|
|
129
|
+
return this.sshurl(opts);
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
let GitHost = _GitHost;
|
|
133
|
+
_gitHosts = new WeakMap();
|
|
134
|
+
_protocols = new WeakMap();
|
|
135
|
+
_fill = new WeakSet();
|
|
136
|
+
fill_fn = function(template, opts) {
|
|
137
|
+
if (typeof template !== "function") {
|
|
138
|
+
return null;
|
|
139
|
+
}
|
|
140
|
+
const options = { ...this, ...this.opts, ...opts };
|
|
141
|
+
if (!options.path) {
|
|
142
|
+
options.path = "";
|
|
143
|
+
}
|
|
144
|
+
if (options.path.startsWith("/")) {
|
|
145
|
+
options.path = options.path.slice(1);
|
|
146
|
+
}
|
|
147
|
+
if (options.noCommittish) {
|
|
148
|
+
options.committish = null;
|
|
149
|
+
}
|
|
150
|
+
const result = template(options);
|
|
151
|
+
return options.noGitPlus && result.startsWith("git+") ? result.slice(4) : result;
|
|
152
|
+
};
|
|
153
|
+
__privateAdd(GitHost, _gitHosts, { byShortcut: {}, byDomain: {} });
|
|
154
|
+
__privateAdd(GitHost, _protocols, {
|
|
155
|
+
"git+ssh:": { name: "sshurl" },
|
|
156
|
+
"ssh:": { name: "sshurl" },
|
|
157
|
+
"git+https:": { name: "https", auth: true },
|
|
158
|
+
"git:": { auth: true },
|
|
159
|
+
"http:": { auth: true },
|
|
160
|
+
"https:": { auth: true },
|
|
161
|
+
"git+http:": { auth: true }
|
|
162
|
+
});
|
|
163
|
+
for (const [name, host] of Object.entries(hosts)) {
|
|
164
|
+
GitHost.addHost(name, host);
|
|
165
|
+
}
|
|
166
|
+
var lib = GitHost;
|
|
167
|
+
exports.lib = lib;
|
|
168
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +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,MAAc;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,OAAO,IAAI;AAC3C,2BAAQ,YAAW,GAAG,OAAO,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,GAAG;AACnB,YAAM,WAAW,QAAQ,QAAQ,MAAM;AAAA,QACrC,UAAU,uBAAQ;AAAA,QAClB,WAAW,uBAAQ;AAAA,MAC3B,CAAO;AACD,YAAM,IAAI,KAAK,WAAW,IAAI,SAAQ,GAAG,QAAQ,IAAI,MAAS;AAAA,IAC/D;AAED,WAAO,MAAM,IAAI,GAAG;AAAA,EACr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AM,CAAC,IAAI;AAC3E;AA/DD,aAbI,SAaG,WAAY,EAAE,YAAY,CAAA,GAAI,UAAU,CAAA,EAAI;AACnD,aAdI,SAcG,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;AA+IH,WAAW,CAAC,MAAM,IAAI,KAAK,OAAO,QAAQ,KAAK,GAAG;AAChD,UAAQ,QAAQ,MAAM,IAAI;AAC5B;AAEA,IAAA,MAAiB;;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
var __accessCheck = (obj, member, msg) => {
|
|
2
|
+
if (!member.has(obj))
|
|
3
|
+
throw TypeError("Cannot " + msg);
|
|
4
|
+
};
|
|
5
|
+
var __privateGet = (obj, member, getter) => {
|
|
6
|
+
__accessCheck(obj, member, "read from private field");
|
|
7
|
+
return getter ? getter.call(obj) : member.get(obj);
|
|
8
|
+
};
|
|
9
|
+
var __privateAdd = (obj, member, value) => {
|
|
10
|
+
if (member.has(obj))
|
|
11
|
+
throw TypeError("Cannot add the same private member more than once");
|
|
12
|
+
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
13
|
+
};
|
|
14
|
+
var __privateMethod = (obj, member, method) => {
|
|
15
|
+
__accessCheck(obj, member, "access private method");
|
|
16
|
+
return method;
|
|
17
|
+
};
|
|
18
|
+
var _gitHosts, _protocols, _fill, fill_fn;
|
|
19
|
+
import { l as lruCache } from "../../lru-cache/index.js";
|
|
20
|
+
import { h as hosts_1 } from "./hosts.js";
|
|
21
|
+
import { f as fromUrl$1 } from "./from-url.js";
|
|
22
|
+
import { p as parseUrl$1 } from "./parse-url.js";
|
|
23
|
+
const LRU = lruCache;
|
|
24
|
+
const hosts = hosts_1;
|
|
25
|
+
const fromUrl = fromUrl$1;
|
|
26
|
+
const parseUrl = parseUrl$1;
|
|
27
|
+
const cache = new LRU({ max: 1e3 });
|
|
28
|
+
const _GitHost = class {
|
|
29
|
+
constructor(type, user, auth, project, committish, defaultRepresentation, opts = {}) {
|
|
30
|
+
__privateAdd(this, _fill);
|
|
31
|
+
Object.assign(this, __privateGet(_GitHost, _gitHosts)[type], {
|
|
32
|
+
type,
|
|
33
|
+
user,
|
|
34
|
+
auth,
|
|
35
|
+
project,
|
|
36
|
+
committish,
|
|
37
|
+
default: defaultRepresentation,
|
|
38
|
+
opts
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
static addHost(name, host) {
|
|
42
|
+
__privateGet(_GitHost, _gitHosts)[name] = host;
|
|
43
|
+
__privateGet(_GitHost, _gitHosts).byDomain[host.domain] = name;
|
|
44
|
+
__privateGet(_GitHost, _gitHosts).byShortcut[`${name}:`] = name;
|
|
45
|
+
__privateGet(_GitHost, _protocols)[`${name}:`] = { name };
|
|
46
|
+
}
|
|
47
|
+
static fromUrl(giturl, opts) {
|
|
48
|
+
if (typeof giturl !== "string") {
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
const key = giturl + JSON.stringify(opts || {});
|
|
52
|
+
if (!cache.has(key)) {
|
|
53
|
+
const hostArgs = fromUrl(giturl, opts, {
|
|
54
|
+
gitHosts: __privateGet(_GitHost, _gitHosts),
|
|
55
|
+
protocols: __privateGet(_GitHost, _protocols)
|
|
56
|
+
});
|
|
57
|
+
cache.set(key, hostArgs ? new _GitHost(...hostArgs) : void 0);
|
|
58
|
+
}
|
|
59
|
+
return cache.get(key);
|
|
60
|
+
}
|
|
61
|
+
static parseUrl(url) {
|
|
62
|
+
return parseUrl(url);
|
|
63
|
+
}
|
|
64
|
+
hash() {
|
|
65
|
+
return this.committish ? `#${this.committish}` : "";
|
|
66
|
+
}
|
|
67
|
+
ssh(opts) {
|
|
68
|
+
return __privateMethod(this, _fill, fill_fn).call(this, this.sshtemplate, opts);
|
|
69
|
+
}
|
|
70
|
+
sshurl(opts) {
|
|
71
|
+
return __privateMethod(this, _fill, fill_fn).call(this, this.sshurltemplate, opts);
|
|
72
|
+
}
|
|
73
|
+
browse(path, ...args) {
|
|
74
|
+
if (typeof path !== "string") {
|
|
75
|
+
return __privateMethod(this, _fill, fill_fn).call(this, this.browsetemplate, path);
|
|
76
|
+
}
|
|
77
|
+
if (typeof args[0] !== "string") {
|
|
78
|
+
return __privateMethod(this, _fill, fill_fn).call(this, this.browsetreetemplate, { ...args[0], path });
|
|
79
|
+
}
|
|
80
|
+
return __privateMethod(this, _fill, fill_fn).call(this, this.browsetreetemplate, { ...args[1], fragment: args[0], path });
|
|
81
|
+
}
|
|
82
|
+
// If the path is known to be a file, then browseFile should be used. For some hosts
|
|
83
|
+
// the url is the same as browse, but for others like GitHub a file can use both `/tree/`
|
|
84
|
+
// and `/blob/` in the path. When using a default committish of `HEAD` then the `/tree/`
|
|
85
|
+
// path will redirect to a specific commit. Using the `/blob/` path avoids this and
|
|
86
|
+
// does not redirect to a different commit.
|
|
87
|
+
browseFile(path, ...args) {
|
|
88
|
+
if (typeof args[0] !== "string") {
|
|
89
|
+
return __privateMethod(this, _fill, fill_fn).call(this, this.browseblobtemplate, { ...args[0], path });
|
|
90
|
+
}
|
|
91
|
+
return __privateMethod(this, _fill, fill_fn).call(this, this.browseblobtemplate, { ...args[1], fragment: args[0], path });
|
|
92
|
+
}
|
|
93
|
+
docs(opts) {
|
|
94
|
+
return __privateMethod(this, _fill, fill_fn).call(this, this.docstemplate, opts);
|
|
95
|
+
}
|
|
96
|
+
bugs(opts) {
|
|
97
|
+
return __privateMethod(this, _fill, fill_fn).call(this, this.bugstemplate, opts);
|
|
98
|
+
}
|
|
99
|
+
https(opts) {
|
|
100
|
+
return __privateMethod(this, _fill, fill_fn).call(this, this.httpstemplate, opts);
|
|
101
|
+
}
|
|
102
|
+
git(opts) {
|
|
103
|
+
return __privateMethod(this, _fill, fill_fn).call(this, this.gittemplate, opts);
|
|
104
|
+
}
|
|
105
|
+
shortcut(opts) {
|
|
106
|
+
return __privateMethod(this, _fill, fill_fn).call(this, this.shortcuttemplate, opts);
|
|
107
|
+
}
|
|
108
|
+
path(opts) {
|
|
109
|
+
return __privateMethod(this, _fill, fill_fn).call(this, this.pathtemplate, opts);
|
|
110
|
+
}
|
|
111
|
+
tarball(opts) {
|
|
112
|
+
return __privateMethod(this, _fill, fill_fn).call(this, this.tarballtemplate, { ...opts, noCommittish: false });
|
|
113
|
+
}
|
|
114
|
+
file(path, opts) {
|
|
115
|
+
return __privateMethod(this, _fill, fill_fn).call(this, this.filetemplate, { ...opts, path });
|
|
116
|
+
}
|
|
117
|
+
edit(path, opts) {
|
|
118
|
+
return __privateMethod(this, _fill, fill_fn).call(this, this.edittemplate, { ...opts, path });
|
|
119
|
+
}
|
|
120
|
+
getDefaultRepresentation() {
|
|
121
|
+
return this.default;
|
|
122
|
+
}
|
|
123
|
+
toString(opts) {
|
|
124
|
+
if (this.default && typeof this[this.default] === "function") {
|
|
125
|
+
return this[this.default](opts);
|
|
126
|
+
}
|
|
127
|
+
return this.sshurl(opts);
|
|
128
|
+
}
|
|
129
|
+
};
|
|
130
|
+
let GitHost = _GitHost;
|
|
131
|
+
_gitHosts = new WeakMap();
|
|
132
|
+
_protocols = new WeakMap();
|
|
133
|
+
_fill = new WeakSet();
|
|
134
|
+
fill_fn = function(template, opts) {
|
|
135
|
+
if (typeof template !== "function") {
|
|
136
|
+
return null;
|
|
137
|
+
}
|
|
138
|
+
const options = { ...this, ...this.opts, ...opts };
|
|
139
|
+
if (!options.path) {
|
|
140
|
+
options.path = "";
|
|
141
|
+
}
|
|
142
|
+
if (options.path.startsWith("/")) {
|
|
143
|
+
options.path = options.path.slice(1);
|
|
144
|
+
}
|
|
145
|
+
if (options.noCommittish) {
|
|
146
|
+
options.committish = null;
|
|
147
|
+
}
|
|
148
|
+
const result = template(options);
|
|
149
|
+
return options.noGitPlus && result.startsWith("git+") ? result.slice(4) : result;
|
|
150
|
+
};
|
|
151
|
+
__privateAdd(GitHost, _gitHosts, { byShortcut: {}, byDomain: {} });
|
|
152
|
+
__privateAdd(GitHost, _protocols, {
|
|
153
|
+
"git+ssh:": { name: "sshurl" },
|
|
154
|
+
"ssh:": { name: "sshurl" },
|
|
155
|
+
"git+https:": { name: "https", auth: true },
|
|
156
|
+
"git:": { auth: true },
|
|
157
|
+
"http:": { auth: true },
|
|
158
|
+
"https:": { auth: true },
|
|
159
|
+
"git+http:": { auth: true }
|
|
160
|
+
});
|
|
161
|
+
for (const [name, host] of Object.entries(hosts)) {
|
|
162
|
+
GitHost.addHost(name, host);
|
|
163
|
+
}
|
|
164
|
+
var lib = GitHost;
|
|
165
|
+
export {
|
|
166
|
+
lib as l
|
|
167
|
+
};
|
|
168
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +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,MAAc;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,OAAO,IAAI;AAC3C,2BAAQ,YA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uCP;AAAA,UAAM,SAAC,UAAU,MAAM;AACrB,MAAI,OAAO,aAAa,YAAY;AAClC,WAAO;AAAA,EACR;AAED,QAAM,UAAU,EAAE,GAAG,MAAM,GAAG,KAAK,MAAM,GAAG,KAAM;AAGlD,MAAI,CAAC,QAAQ,MAAM;AACjB,YAAQ,OAAO;AAAA,EAChB;AAGD,MAAI,QAAQ,KAAK,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,SAaG,WAAY,EAAE,YAAY,CAAA,GAAI,UAAU,CAAA,EAAI;AACnD,aAdI,SAcG,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;AA+IH,WAAW,CAAC,MAAM,IAAI,KAAK,OAAO,QAAQ,KAAK,GAAG;AAChD,UAAQ,QAAQ,MAAM,IAAI;AAC5B;AAEA,IAAA,MAAiB;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const require$$0 = require("url");
|
|
4
|
+
const url = require$$0;
|
|
5
|
+
const lastIndexOfBefore = (str, char, beforeChar) => {
|
|
6
|
+
const startPosition = str.indexOf(beforeChar);
|
|
7
|
+
return str.lastIndexOf(char, startPosition > -1 ? startPosition : Infinity);
|
|
8
|
+
};
|
|
9
|
+
const safeUrl = (u) => {
|
|
10
|
+
try {
|
|
11
|
+
return new url.URL(u);
|
|
12
|
+
} catch {
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
const correctProtocol = (arg, protocols) => {
|
|
16
|
+
const firstColon = arg.indexOf(":");
|
|
17
|
+
const proto = arg.slice(0, firstColon + 1);
|
|
18
|
+
if (Object.prototype.hasOwnProperty.call(protocols, proto)) {
|
|
19
|
+
return arg;
|
|
20
|
+
}
|
|
21
|
+
const firstAt = arg.indexOf("@");
|
|
22
|
+
if (firstAt > -1) {
|
|
23
|
+
if (firstAt > firstColon) {
|
|
24
|
+
return `git+ssh://${arg}`;
|
|
25
|
+
} else {
|
|
26
|
+
return arg;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
const doubleSlash = arg.indexOf("//");
|
|
30
|
+
if (doubleSlash === firstColon + 1) {
|
|
31
|
+
return arg;
|
|
32
|
+
}
|
|
33
|
+
return `${arg.slice(0, firstColon + 1)}//${arg.slice(firstColon + 1)}`;
|
|
34
|
+
};
|
|
35
|
+
const correctUrl = (giturl) => {
|
|
36
|
+
const firstAt = lastIndexOfBefore(giturl, "@", "#");
|
|
37
|
+
const lastColonBeforeHash = lastIndexOfBefore(giturl, ":", "#");
|
|
38
|
+
if (lastColonBeforeHash > firstAt) {
|
|
39
|
+
giturl = giturl.slice(0, lastColonBeforeHash) + "/" + giturl.slice(lastColonBeforeHash + 1);
|
|
40
|
+
}
|
|
41
|
+
if (lastIndexOfBefore(giturl, ":", "#") === -1 && giturl.indexOf("//") === -1) {
|
|
42
|
+
giturl = `git+ssh://${giturl}`;
|
|
43
|
+
}
|
|
44
|
+
return giturl;
|
|
45
|
+
};
|
|
46
|
+
var parseUrl = (giturl, protocols) => {
|
|
47
|
+
const withProtocol = protocols ? correctProtocol(giturl, protocols) : giturl;
|
|
48
|
+
return safeUrl(withProtocol) || safeUrl(correctUrl(withProtocol));
|
|
49
|
+
};
|
|
50
|
+
exports.parseUrl = parseUrl;
|
|
51
|
+
//# sourceMappingURL=parse-url.cjs.map
|
|
@@ -0,0 +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,IAC1B,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,MAAM,IAAI,MAAM,aAAa,CAAC;AACrE;AAGA,MAAM,aAAa,CAAC,WAAW;AAG7B,QAAM,UAAU,kBAAkB,QAAQ,KAAK,GAAG;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