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.
Files changed (546) hide show
  1. package/bin/prismic-ts-codegen.js +3 -0
  2. package/dist/_node_modules/@babel/code-frame/lib/index.cjs +144 -0
  3. package/dist/_node_modules/@babel/code-frame/lib/index.cjs.map +1 -0
  4. package/dist/_node_modules/@babel/code-frame/lib/index.js +143 -0
  5. package/dist/_node_modules/@babel/code-frame/lib/index.js.map +1 -0
  6. package/dist/_node_modules/@babel/helper-validator-identifier/lib/identifier.cjs +82 -0
  7. package/dist/_node_modules/@babel/helper-validator-identifier/lib/identifier.cjs.map +1 -0
  8. package/dist/_node_modules/@babel/helper-validator-identifier/lib/identifier.js +83 -0
  9. package/dist/_node_modules/@babel/helper-validator-identifier/lib/identifier.js.map +1 -0
  10. package/dist/_node_modules/@babel/helper-validator-identifier/lib/index.cjs +62 -0
  11. package/dist/_node_modules/@babel/helper-validator-identifier/lib/index.cjs.map +1 -0
  12. package/dist/_node_modules/@babel/helper-validator-identifier/lib/index.js +61 -0
  13. package/dist/_node_modules/@babel/helper-validator-identifier/lib/index.js.map +1 -0
  14. package/dist/_node_modules/@babel/helper-validator-identifier/lib/keyword.cjs +35 -0
  15. package/dist/_node_modules/@babel/helper-validator-identifier/lib/keyword.cjs.map +1 -0
  16. package/dist/_node_modules/@babel/helper-validator-identifier/lib/keyword.js +36 -0
  17. package/dist/_node_modules/@babel/helper-validator-identifier/lib/keyword.js.map +1 -0
  18. package/dist/_node_modules/@babel/highlight/lib/index.cjs +100 -0
  19. package/dist/_node_modules/@babel/highlight/lib/index.cjs.map +1 -0
  20. package/dist/_node_modules/@babel/highlight/lib/index.js +99 -0
  21. package/dist/_node_modules/@babel/highlight/lib/index.js.map +1 -0
  22. package/dist/_node_modules/ansi-styles/index.cjs +146 -0
  23. package/dist/_node_modules/ansi-styles/index.cjs.map +1 -0
  24. package/dist/_node_modules/ansi-styles/index.js +146 -0
  25. package/dist/_node_modules/ansi-styles/index.js.map +1 -0
  26. package/dist/_node_modules/arrify/index.cjs +10 -0
  27. package/dist/_node_modules/arrify/index.cjs.map +1 -0
  28. package/dist/_node_modules/arrify/index.js +10 -0
  29. package/dist/_node_modules/arrify/index.js.map +1 -0
  30. package/dist/_node_modules/camelcase/index.cjs +83 -0
  31. package/dist/_node_modules/camelcase/index.cjs.map +1 -0
  32. package/dist/_node_modules/camelcase/index.js +84 -0
  33. package/dist/_node_modules/camelcase/index.js.map +1 -0
  34. package/dist/_node_modules/camelcase-keys/index.cjs +55 -0
  35. package/dist/_node_modules/camelcase-keys/index.cjs.map +1 -0
  36. package/dist/_node_modules/camelcase-keys/index.js +56 -0
  37. package/dist/_node_modules/camelcase-keys/index.js.map +1 -0
  38. package/dist/_node_modules/chalk/index.cjs +172 -0
  39. package/dist/_node_modules/chalk/index.cjs.map +1 -0
  40. package/dist/_node_modules/chalk/index.js +172 -0
  41. package/dist/_node_modules/chalk/index.js.map +1 -0
  42. package/dist/_node_modules/chalk/templates.cjs +108 -0
  43. package/dist/_node_modules/chalk/templates.cjs.map +1 -0
  44. package/dist/_node_modules/chalk/templates.js +108 -0
  45. package/dist/_node_modules/chalk/templates.js.map +1 -0
  46. package/dist/_node_modules/color-convert/conversions.cjs +710 -0
  47. package/dist/_node_modules/color-convert/conversions.cjs.map +1 -0
  48. package/dist/_node_modules/color-convert/conversions.js +710 -0
  49. package/dist/_node_modules/color-convert/conversions.js.map +1 -0
  50. package/dist/_node_modules/color-convert/index.cjs +59 -0
  51. package/dist/_node_modules/color-convert/index.cjs.map +1 -0
  52. package/dist/_node_modules/color-convert/index.js +59 -0
  53. package/dist/_node_modules/color-convert/index.js.map +1 -0
  54. package/dist/_node_modules/color-convert/route.cjs +69 -0
  55. package/dist/_node_modules/color-convert/route.cjs.map +1 -0
  56. package/dist/_node_modules/color-convert/route.js +69 -0
  57. package/dist/_node_modules/color-convert/route.js.map +1 -0
  58. package/dist/_node_modules/color-name/index.cjs +154 -0
  59. package/dist/_node_modules/color-name/index.cjs.map +1 -0
  60. package/dist/_node_modules/color-name/index.js +154 -0
  61. package/dist/_node_modules/color-name/index.js.map +1 -0
  62. package/dist/_node_modules/data-uri-to-buffer/dist/index.cjs +41 -0
  63. package/dist/_node_modules/data-uri-to-buffer/dist/index.cjs.map +1 -0
  64. package/dist/_node_modules/data-uri-to-buffer/dist/index.js +41 -0
  65. package/dist/_node_modules/data-uri-to-buffer/dist/index.js.map +1 -0
  66. package/dist/_node_modules/decamelize/index.cjs +38 -0
  67. package/dist/_node_modules/decamelize/index.cjs.map +1 -0
  68. package/dist/_node_modules/decamelize/index.js +39 -0
  69. package/dist/_node_modules/decamelize/index.js.map +1 -0
  70. package/dist/_node_modules/decamelize-keys/index.cjs +50 -0
  71. package/dist/_node_modules/decamelize-keys/index.cjs.map +1 -0
  72. package/dist/_node_modules/decamelize-keys/index.js +51 -0
  73. package/dist/_node_modules/decamelize-keys/index.js.map +1 -0
  74. package/dist/_node_modules/error-ex/index.cjs +109 -0
  75. package/dist/_node_modules/error-ex/index.cjs.map +1 -0
  76. package/dist/_node_modules/error-ex/index.js +109 -0
  77. package/dist/_node_modules/error-ex/index.js.map +1 -0
  78. package/dist/_node_modules/escape-string-regexp/index.cjs +11 -0
  79. package/dist/_node_modules/escape-string-regexp/index.cjs.map +1 -0
  80. package/dist/_node_modules/escape-string-regexp/index.js +11 -0
  81. package/dist/_node_modules/escape-string-regexp/index.js.map +1 -0
  82. package/dist/_node_modules/fetch-blob/file.cjs +61 -0
  83. package/dist/_node_modules/fetch-blob/file.cjs.map +1 -0
  84. package/dist/_node_modules/fetch-blob/file.js +61 -0
  85. package/dist/_node_modules/fetch-blob/file.js.map +1 -0
  86. package/dist/_node_modules/fetch-blob/index.cjs +223 -0
  87. package/dist/_node_modules/fetch-blob/index.cjs.map +1 -0
  88. package/dist/_node_modules/fetch-blob/index.js +223 -0
  89. package/dist/_node_modules/fetch-blob/index.js.map +1 -0
  90. package/dist/_node_modules/fetch-blob/streams.cjs +43 -0
  91. package/dist/_node_modules/fetch-blob/streams.cjs.map +1 -0
  92. package/dist/_node_modules/fetch-blob/streams.js +42 -0
  93. package/dist/_node_modules/fetch-blob/streams.js.map +1 -0
  94. package/dist/_node_modules/formdata-polyfill/esm.min.cjs +116 -0
  95. package/dist/_node_modules/formdata-polyfill/esm.min.cjs.map +1 -0
  96. package/dist/_node_modules/formdata-polyfill/esm.min.js +116 -0
  97. package/dist/_node_modules/formdata-polyfill/esm.min.js.map +1 -0
  98. package/dist/_node_modules/function-bind/implementation.cjs +47 -0
  99. package/dist/_node_modules/function-bind/implementation.cjs.map +1 -0
  100. package/dist/_node_modules/function-bind/implementation.js +47 -0
  101. package/dist/_node_modules/function-bind/implementation.js.map +1 -0
  102. package/dist/_node_modules/function-bind/index.cjs +7 -0
  103. package/dist/_node_modules/function-bind/index.cjs.map +1 -0
  104. package/dist/_node_modules/function-bind/index.js +7 -0
  105. package/dist/_node_modules/function-bind/index.js.map +1 -0
  106. package/dist/_node_modules/hard-rejection/index.cjs +25 -0
  107. package/dist/_node_modules/hard-rejection/index.cjs.map +1 -0
  108. package/dist/_node_modules/hard-rejection/index.js +26 -0
  109. package/dist/_node_modules/hard-rejection/index.js.map +1 -0
  110. package/dist/_node_modules/has/src/index.cjs +7 -0
  111. package/dist/_node_modules/has/src/index.cjs.map +1 -0
  112. package/dist/_node_modules/has/src/index.js +7 -0
  113. package/dist/_node_modules/has/src/index.js.map +1 -0
  114. package/dist/_node_modules/hosted-git-info/lib/from-url.cjs +93 -0
  115. package/dist/_node_modules/hosted-git-info/lib/from-url.cjs.map +1 -0
  116. package/dist/_node_modules/hosted-git-info/lib/from-url.js +93 -0
  117. package/dist/_node_modules/hosted-git-info/lib/from-url.js.map +1 -0
  118. package/dist/_node_modules/hosted-git-info/lib/hosts.cjs +164 -0
  119. package/dist/_node_modules/hosted-git-info/lib/hosts.cjs.map +1 -0
  120. package/dist/_node_modules/hosted-git-info/lib/hosts.js +164 -0
  121. package/dist/_node_modules/hosted-git-info/lib/hosts.js.map +1 -0
  122. package/dist/_node_modules/hosted-git-info/lib/index.cjs +168 -0
  123. package/dist/_node_modules/hosted-git-info/lib/index.cjs.map +1 -0
  124. package/dist/_node_modules/hosted-git-info/lib/index.js +168 -0
  125. package/dist/_node_modules/hosted-git-info/lib/index.js.map +1 -0
  126. package/dist/_node_modules/hosted-git-info/lib/parse-url.cjs +51 -0
  127. package/dist/_node_modules/hosted-git-info/lib/parse-url.cjs.map +1 -0
  128. package/dist/_node_modules/hosted-git-info/lib/parse-url.js +51 -0
  129. package/dist/_node_modules/hosted-git-info/lib/parse-url.js.map +1 -0
  130. package/dist/_node_modules/indent-string/index.cjs +34 -0
  131. package/dist/_node_modules/indent-string/index.cjs.map +1 -0
  132. package/dist/_node_modules/indent-string/index.js +35 -0
  133. package/dist/_node_modules/indent-string/index.js.map +1 -0
  134. package/dist/_node_modules/is-arrayish/index.cjs +10 -0
  135. package/dist/_node_modules/is-arrayish/index.cjs.map +1 -0
  136. package/dist/_node_modules/is-arrayish/index.js +10 -0
  137. package/dist/_node_modules/is-arrayish/index.js.map +1 -0
  138. package/dist/_node_modules/is-core-module/core.json.cjs +496 -0
  139. package/dist/_node_modules/is-core-module/core.json.cjs.map +1 -0
  140. package/dist/_node_modules/is-core-module/core.json.js +496 -0
  141. package/dist/_node_modules/is-core-module/core.json.js.map +1 -0
  142. package/dist/_node_modules/is-core-module/index.cjs +62 -0
  143. package/dist/_node_modules/is-core-module/index.cjs.map +1 -0
  144. package/dist/_node_modules/is-core-module/index.js +62 -0
  145. package/dist/_node_modules/is-core-module/index.js.map +1 -0
  146. package/dist/_node_modules/is-plain-obj/index.cjs +9 -0
  147. package/dist/_node_modules/is-plain-obj/index.cjs.map +1 -0
  148. package/dist/_node_modules/is-plain-obj/index.js +9 -0
  149. package/dist/_node_modules/is-plain-obj/index.js.map +1 -0
  150. package/dist/_node_modules/js-tokens/index.cjs +27 -0
  151. package/dist/_node_modules/js-tokens/index.cjs.map +1 -0
  152. package/dist/_node_modules/js-tokens/index.js +26 -0
  153. package/dist/_node_modules/js-tokens/index.js.map +1 -0
  154. package/dist/_node_modules/json-parse-even-better-errors/index.cjs +90 -0
  155. package/dist/_node_modules/json-parse-even-better-errors/index.cjs.map +1 -0
  156. package/dist/_node_modules/json-parse-even-better-errors/index.js +90 -0
  157. package/dist/_node_modules/json-parse-even-better-errors/index.js.map +1 -0
  158. package/dist/_node_modules/kind-of/index.cjs +129 -0
  159. package/dist/_node_modules/kind-of/index.cjs.map +1 -0
  160. package/dist/_node_modules/kind-of/index.js +129 -0
  161. package/dist/_node_modules/kind-of/index.js.map +1 -0
  162. package/dist/_node_modules/lines-and-columns/build/index.cjs +67 -0
  163. package/dist/_node_modules/lines-and-columns/build/index.cjs.map +1 -0
  164. package/dist/_node_modules/lines-and-columns/build/index.js +66 -0
  165. package/dist/_node_modules/lines-and-columns/build/index.js.map +1 -0
  166. package/dist/_node_modules/lru-cache/index.cjs +1015 -0
  167. package/dist/_node_modules/lru-cache/index.cjs.map +1 -0
  168. package/dist/_node_modules/lru-cache/index.js +1015 -0
  169. package/dist/_node_modules/lru-cache/index.js.map +1 -0
  170. package/dist/_node_modules/map-obj/index.cjs +49 -0
  171. package/dist/_node_modules/map-obj/index.cjs.map +1 -0
  172. package/dist/_node_modules/map-obj/index.js +50 -0
  173. package/dist/_node_modules/map-obj/index.js.map +1 -0
  174. package/dist/_node_modules/meow/source/index.cjs +88 -0
  175. package/dist/_node_modules/meow/source/index.cjs.map +1 -0
  176. package/dist/_node_modules/meow/source/index.js +89 -0
  177. package/dist/_node_modules/meow/source/index.js.map +1 -0
  178. package/dist/_node_modules/meow/source/options.cjs +83 -0
  179. package/dist/_node_modules/meow/source/options.cjs.map +1 -0
  180. package/dist/_node_modules/meow/source/options.js +83 -0
  181. package/dist/_node_modules/meow/source/options.js.map +1 -0
  182. package/dist/_node_modules/meow/source/parser.cjs +61 -0
  183. package/dist/_node_modules/meow/source/parser.cjs.map +1 -0
  184. package/dist/_node_modules/meow/source/parser.js +61 -0
  185. package/dist/_node_modules/meow/source/parser.js.map +1 -0
  186. package/dist/_node_modules/meow/source/utils.cjs +8 -0
  187. package/dist/_node_modules/meow/source/utils.cjs.map +1 -0
  188. package/dist/_node_modules/meow/source/utils.js +8 -0
  189. package/dist/_node_modules/meow/source/utils.js.map +1 -0
  190. package/dist/_node_modules/meow/source/validate.cjs +102 -0
  191. package/dist/_node_modules/meow/source/validate.cjs.map +1 -0
  192. package/dist/_node_modules/meow/source/validate.js +102 -0
  193. package/dist/_node_modules/meow/source/validate.js.map +1 -0
  194. package/dist/_node_modules/min-indent/index.cjs +12 -0
  195. package/dist/_node_modules/min-indent/index.cjs.map +1 -0
  196. package/dist/_node_modules/min-indent/index.js +13 -0
  197. package/dist/_node_modules/min-indent/index.js.map +1 -0
  198. package/dist/_node_modules/minimist-options/index.cjs +94 -0
  199. package/dist/_node_modules/minimist-options/index.cjs.map +1 -0
  200. package/dist/_node_modules/minimist-options/index.js +95 -0
  201. package/dist/_node_modules/minimist-options/index.js.map +1 -0
  202. package/dist/_node_modules/node-domexception/index.cjs +11 -0
  203. package/dist/_node_modules/node-domexception/index.cjs.map +1 -0
  204. package/dist/_node_modules/node-domexception/index.js +10 -0
  205. package/dist/_node_modules/node-domexception/index.js.map +1 -0
  206. package/dist/_node_modules/node-fetch/src/body.cjs +262 -0
  207. package/dist/_node_modules/node-fetch/src/body.cjs.map +1 -0
  208. package/dist/_node_modules/node-fetch/src/body.js +262 -0
  209. package/dist/_node_modules/node-fetch/src/body.js.map +1 -0
  210. package/dist/_node_modules/node-fetch/src/errors/abort-error.cjs +10 -0
  211. package/dist/_node_modules/node-fetch/src/errors/abort-error.cjs.map +1 -0
  212. package/dist/_node_modules/node-fetch/src/errors/abort-error.js +10 -0
  213. package/dist/_node_modules/node-fetch/src/errors/abort-error.js.map +1 -0
  214. package/dist/_node_modules/node-fetch/src/errors/base.cjs +17 -0
  215. package/dist/_node_modules/node-fetch/src/errors/base.cjs.map +1 -0
  216. package/dist/_node_modules/node-fetch/src/errors/base.js +17 -0
  217. package/dist/_node_modules/node-fetch/src/errors/base.js.map +1 -0
  218. package/dist/_node_modules/node-fetch/src/errors/fetch-error.cjs +19 -0
  219. package/dist/_node_modules/node-fetch/src/errors/fetch-error.cjs.map +1 -0
  220. package/dist/_node_modules/node-fetch/src/errors/fetch-error.js +19 -0
  221. package/dist/_node_modules/node-fetch/src/errors/fetch-error.js.map +1 -0
  222. package/dist/_node_modules/node-fetch/src/headers.cjs +190 -0
  223. package/dist/_node_modules/node-fetch/src/headers.cjs.map +1 -0
  224. package/dist/_node_modules/node-fetch/src/headers.js +190 -0
  225. package/dist/_node_modules/node-fetch/src/headers.js.map +1 -0
  226. package/dist/_node_modules/node-fetch/src/index.cjs +292 -0
  227. package/dist/_node_modules/node-fetch/src/index.cjs.map +1 -0
  228. package/dist/_node_modules/node-fetch/src/index.js +292 -0
  229. package/dist/_node_modules/node-fetch/src/index.js.map +1 -0
  230. package/dist/_node_modules/node-fetch/src/request.cjs +206 -0
  231. package/dist/_node_modules/node-fetch/src/request.cjs.map +1 -0
  232. package/dist/_node_modules/node-fetch/src/request.js +206 -0
  233. package/dist/_node_modules/node-fetch/src/request.js.map +1 -0
  234. package/dist/_node_modules/node-fetch/src/response.cjs +122 -0
  235. package/dist/_node_modules/node-fetch/src/response.cjs.map +1 -0
  236. package/dist/_node_modules/node-fetch/src/response.js +123 -0
  237. package/dist/_node_modules/node-fetch/src/response.js.map +1 -0
  238. package/dist/_node_modules/node-fetch/src/utils/get-search.cjs +12 -0
  239. package/dist/_node_modules/node-fetch/src/utils/get-search.cjs.map +1 -0
  240. package/dist/_node_modules/node-fetch/src/utils/get-search.js +12 -0
  241. package/dist/_node_modules/node-fetch/src/utils/get-search.js.map +1 -0
  242. package/dist/_node_modules/node-fetch/src/utils/is-redirect.cjs +8 -0
  243. package/dist/_node_modules/node-fetch/src/utils/is-redirect.cjs.map +1 -0
  244. package/dist/_node_modules/node-fetch/src/utils/is-redirect.js +8 -0
  245. package/dist/_node_modules/node-fetch/src/utils/is-redirect.js.map +1 -0
  246. package/dist/_node_modules/node-fetch/src/utils/is.cjs +28 -0
  247. package/dist/_node_modules/node-fetch/src/utils/is.cjs.map +1 -0
  248. package/dist/_node_modules/node-fetch/src/utils/is.js +28 -0
  249. package/dist/_node_modules/node-fetch/src/utils/is.js.map +1 -0
  250. package/dist/_node_modules/node-fetch/src/utils/multipart-parser.cjs +356 -0
  251. package/dist/_node_modules/node-fetch/src/utils/multipart-parser.cjs.map +1 -0
  252. package/dist/_node_modules/node-fetch/src/utils/multipart-parser.js +356 -0
  253. package/dist/_node_modules/node-fetch/src/utils/multipart-parser.js.map +1 -0
  254. package/dist/_node_modules/node-fetch/src/utils/referrer.cjs +149 -0
  255. package/dist/_node_modules/node-fetch/src/utils/referrer.cjs.map +1 -0
  256. package/dist/_node_modules/node-fetch/src/utils/referrer.js +149 -0
  257. package/dist/_node_modules/node-fetch/src/utils/referrer.js.map +1 -0
  258. package/dist/_node_modules/normalize-package-data/lib/extract_description.cjs +24 -0
  259. package/dist/_node_modules/normalize-package-data/lib/extract_description.cjs.map +1 -0
  260. package/dist/_node_modules/normalize-package-data/lib/extract_description.js +24 -0
  261. package/dist/_node_modules/normalize-package-data/lib/extract_description.js.map +1 -0
  262. package/dist/_node_modules/normalize-package-data/lib/fixer.cjs +438 -0
  263. package/dist/_node_modules/normalize-package-data/lib/fixer.cjs.map +1 -0
  264. package/dist/_node_modules/normalize-package-data/lib/fixer.js +438 -0
  265. package/dist/_node_modules/normalize-package-data/lib/fixer.js.map +1 -0
  266. package/dist/_node_modules/normalize-package-data/lib/make_warning.cjs +26 -0
  267. package/dist/_node_modules/normalize-package-data/lib/make_warning.cjs.map +1 -0
  268. package/dist/_node_modules/normalize-package-data/lib/make_warning.js +26 -0
  269. package/dist/_node_modules/normalize-package-data/lib/make_warning.js.map +1 -0
  270. package/dist/_node_modules/normalize-package-data/lib/normalize.cjs +58 -0
  271. package/dist/_node_modules/normalize-package-data/lib/normalize.cjs.map +1 -0
  272. package/dist/_node_modules/normalize-package-data/lib/normalize.js +59 -0
  273. package/dist/_node_modules/normalize-package-data/lib/normalize.js.map +1 -0
  274. package/dist/_node_modules/normalize-package-data/lib/typos.json.cjs +41 -0
  275. package/dist/_node_modules/normalize-package-data/lib/typos.json.cjs.map +1 -0
  276. package/dist/_node_modules/normalize-package-data/lib/typos.json.js +41 -0
  277. package/dist/_node_modules/normalize-package-data/lib/typos.json.js.map +1 -0
  278. package/dist/_node_modules/normalize-package-data/lib/warning_messages.json.cjs +90 -0
  279. package/dist/_node_modules/normalize-package-data/lib/warning_messages.json.cjs.map +1 -0
  280. package/dist/_node_modules/normalize-package-data/lib/warning_messages.json.js +90 -0
  281. package/dist/_node_modules/normalize-package-data/lib/warning_messages.json.js.map +1 -0
  282. package/dist/_node_modules/parse-json/index.cjs +54 -0
  283. package/dist/_node_modules/parse-json/index.cjs.map +1 -0
  284. package/dist/_node_modules/parse-json/index.js +55 -0
  285. package/dist/_node_modules/parse-json/index.js.map +1 -0
  286. package/dist/_node_modules/read-pkg/_node_modules/hosted-git-info/git-host-info.cjs +159 -0
  287. package/dist/_node_modules/read-pkg/_node_modules/hosted-git-info/git-host-info.cjs.map +1 -0
  288. package/dist/_node_modules/read-pkg/_node_modules/hosted-git-info/git-host-info.js +159 -0
  289. package/dist/_node_modules/read-pkg/_node_modules/hosted-git-info/git-host-info.js.map +1 -0
  290. package/dist/_node_modules/read-pkg/_node_modules/hosted-git-info/git-host.cjs +88 -0
  291. package/dist/_node_modules/read-pkg/_node_modules/hosted-git-info/git-host.cjs.map +1 -0
  292. package/dist/_node_modules/read-pkg/_node_modules/hosted-git-info/git-host.js +88 -0
  293. package/dist/_node_modules/read-pkg/_node_modules/hosted-git-info/git-host.js.map +1 -0
  294. package/dist/_node_modules/read-pkg/_node_modules/hosted-git-info/index.cjs +180 -0
  295. package/dist/_node_modules/read-pkg/_node_modules/hosted-git-info/index.cjs.map +1 -0
  296. package/dist/_node_modules/read-pkg/_node_modules/hosted-git-info/index.js +180 -0
  297. package/dist/_node_modules/read-pkg/_node_modules/hosted-git-info/index.js.map +1 -0
  298. package/dist/_node_modules/read-pkg/_node_modules/lru-cache/index.cjs +268 -0
  299. package/dist/_node_modules/read-pkg/_node_modules/lru-cache/index.cjs.map +1 -0
  300. package/dist/_node_modules/read-pkg/_node_modules/lru-cache/index.js +268 -0
  301. package/dist/_node_modules/read-pkg/_node_modules/lru-cache/index.js.map +1 -0
  302. package/dist/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/extract_description.cjs +20 -0
  303. package/dist/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/extract_description.cjs.map +1 -0
  304. package/dist/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/extract_description.js +20 -0
  305. package/dist/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/extract_description.js.map +1 -0
  306. package/dist/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/fixer.cjs +438 -0
  307. package/dist/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/fixer.cjs.map +1 -0
  308. package/dist/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/fixer.js +438 -0
  309. package/dist/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/fixer.js.map +1 -0
  310. package/dist/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/make_warning.cjs +26 -0
  311. package/dist/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/make_warning.cjs.map +1 -0
  312. package/dist/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/make_warning.js +26 -0
  313. package/dist/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/make_warning.js.map +1 -0
  314. package/dist/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/normalize.cjs +58 -0
  315. package/dist/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/normalize.cjs.map +1 -0
  316. package/dist/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/normalize.js +59 -0
  317. package/dist/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/normalize.js.map +1 -0
  318. package/dist/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/typos.json.cjs +41 -0
  319. package/dist/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/typos.json.cjs.map +1 -0
  320. package/dist/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/typos.json.js +41 -0
  321. package/dist/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/typos.json.js.map +1 -0
  322. package/dist/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/warning_messages.json.cjs +90 -0
  323. package/dist/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/warning_messages.json.cjs.map +1 -0
  324. package/dist/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/warning_messages.json.js +90 -0
  325. package/dist/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/warning_messages.json.js.map +1 -0
  326. package/dist/_node_modules/read-pkg/index.cjs +20 -0
  327. package/dist/_node_modules/read-pkg/index.cjs.map +1 -0
  328. package/dist/_node_modules/read-pkg/index.js +20 -0
  329. package/dist/_node_modules/read-pkg/index.js.map +1 -0
  330. package/dist/_node_modules/read-pkg-up/_node_modules/find-up/index.cjs +48 -0
  331. package/dist/_node_modules/read-pkg-up/_node_modules/find-up/index.cjs.map +1 -0
  332. package/dist/_node_modules/read-pkg-up/_node_modules/find-up/index.js +48 -0
  333. package/dist/_node_modules/read-pkg-up/_node_modules/find-up/index.js.map +1 -0
  334. package/dist/_node_modules/read-pkg-up/_node_modules/locate-path/index.cjs +43 -0
  335. package/dist/_node_modules/read-pkg-up/_node_modules/locate-path/index.cjs.map +1 -0
  336. package/dist/_node_modules/read-pkg-up/_node_modules/locate-path/index.js +43 -0
  337. package/dist/_node_modules/read-pkg-up/_node_modules/locate-path/index.js.map +1 -0
  338. package/dist/_node_modules/read-pkg-up/index.cjs +17 -0
  339. package/dist/_node_modules/read-pkg-up/index.cjs.map +1 -0
  340. package/dist/_node_modules/read-pkg-up/index.js +17 -0
  341. package/dist/_node_modules/read-pkg-up/index.js.map +1 -0
  342. package/dist/_node_modules/redent/index.cjs +8 -0
  343. package/dist/_node_modules/redent/index.cjs.map +1 -0
  344. package/dist/_node_modules/redent/index.js +9 -0
  345. package/dist/_node_modules/redent/index.js.map +1 -0
  346. package/dist/_node_modules/semver/classes/semver.cjs +245 -0
  347. package/dist/_node_modules/semver/classes/semver.cjs.map +1 -0
  348. package/dist/_node_modules/semver/classes/semver.js +245 -0
  349. package/dist/_node_modules/semver/classes/semver.js.map +1 -0
  350. package/dist/_node_modules/semver/functions/clean.cjs +11 -0
  351. package/dist/_node_modules/semver/functions/clean.cjs.map +1 -0
  352. package/dist/_node_modules/semver/functions/clean.js +11 -0
  353. package/dist/_node_modules/semver/functions/clean.js.map +1 -0
  354. package/dist/_node_modules/semver/functions/parse.cjs +20 -0
  355. package/dist/_node_modules/semver/functions/parse.cjs.map +1 -0
  356. package/dist/_node_modules/semver/functions/parse.js +20 -0
  357. package/dist/_node_modules/semver/functions/parse.js.map +1 -0
  358. package/dist/_node_modules/semver/functions/valid.cjs +11 -0
  359. package/dist/_node_modules/semver/functions/valid.cjs.map +1 -0
  360. package/dist/_node_modules/semver/functions/valid.js +11 -0
  361. package/dist/_node_modules/semver/functions/valid.js.map +1 -0
  362. package/dist/_node_modules/semver/internal/constants.cjs +29 -0
  363. package/dist/_node_modules/semver/internal/constants.cjs.map +1 -0
  364. package/dist/_node_modules/semver/internal/constants.js +29 -0
  365. package/dist/_node_modules/semver/internal/constants.js.map +1 -0
  366. package/dist/_node_modules/semver/internal/debug.cjs +7 -0
  367. package/dist/_node_modules/semver/internal/debug.cjs.map +1 -0
  368. package/dist/_node_modules/semver/internal/debug.js +7 -0
  369. package/dist/_node_modules/semver/internal/debug.js.map +1 -0
  370. package/dist/_node_modules/semver/internal/identifiers.cjs +19 -0
  371. package/dist/_node_modules/semver/internal/identifiers.cjs.map +1 -0
  372. package/dist/_node_modules/semver/internal/identifiers.js +19 -0
  373. package/dist/_node_modules/semver/internal/identifiers.js.map +1 -0
  374. package/dist/_node_modules/semver/internal/parse-options.cjs +16 -0
  375. package/dist/_node_modules/semver/internal/parse-options.cjs.map +1 -0
  376. package/dist/_node_modules/semver/internal/parse-options.js +16 -0
  377. package/dist/_node_modules/semver/internal/parse-options.js.map +1 -0
  378. package/dist/_node_modules/semver/internal/re.cjs +82 -0
  379. package/dist/_node_modules/semver/internal/re.cjs.map +1 -0
  380. package/dist/_node_modules/semver/internal/re.js +82 -0
  381. package/dist/_node_modules/semver/internal/re.js.map +1 -0
  382. package/dist/_node_modules/spdx-correct/index.cjs +334 -0
  383. package/dist/_node_modules/spdx-correct/index.cjs.map +1 -0
  384. package/dist/_node_modules/spdx-correct/index.js +334 -0
  385. package/dist/_node_modules/spdx-correct/index.js.map +1 -0
  386. package/dist/_node_modules/spdx-exceptions/index.json.cjs +43 -0
  387. package/dist/_node_modules/spdx-exceptions/index.json.cjs.map +1 -0
  388. package/dist/_node_modules/spdx-exceptions/index.json.js +44 -0
  389. package/dist/_node_modules/spdx-exceptions/index.json.js.map +1 -0
  390. package/dist/_node_modules/spdx-expression-parse/index.cjs +11 -0
  391. package/dist/_node_modules/spdx-expression-parse/index.cjs.map +1 -0
  392. package/dist/_node_modules/spdx-expression-parse/index.js +11 -0
  393. package/dist/_node_modules/spdx-expression-parse/index.js.map +1 -0
  394. package/dist/_node_modules/spdx-expression-parse/parse.cjs +111 -0
  395. package/dist/_node_modules/spdx-expression-parse/parse.cjs.map +1 -0
  396. package/dist/_node_modules/spdx-expression-parse/parse.js +111 -0
  397. package/dist/_node_modules/spdx-expression-parse/parse.js.map +1 -0
  398. package/dist/_node_modules/spdx-expression-parse/scan.cjs +104 -0
  399. package/dist/_node_modules/spdx-expression-parse/scan.cjs.map +1 -0
  400. package/dist/_node_modules/spdx-expression-parse/scan.js +104 -0
  401. package/dist/_node_modules/spdx-expression-parse/scan.js.map +1 -0
  402. package/dist/_node_modules/spdx-license-ids/deprecated.json.cjs +30 -0
  403. package/dist/_node_modules/spdx-license-ids/deprecated.json.cjs.map +1 -0
  404. package/dist/_node_modules/spdx-license-ids/deprecated.json.js +31 -0
  405. package/dist/_node_modules/spdx-license-ids/deprecated.json.js.map +1 -0
  406. package/dist/_node_modules/spdx-license-ids/index.json.cjs +510 -0
  407. package/dist/_node_modules/spdx-license-ids/index.json.cjs.map +1 -0
  408. package/dist/_node_modules/spdx-license-ids/index.json.js +511 -0
  409. package/dist/_node_modules/spdx-license-ids/index.json.js.map +1 -0
  410. package/dist/_node_modules/strip-indent/index.cjs +12 -0
  411. package/dist/_node_modules/strip-indent/index.cjs.map +1 -0
  412. package/dist/_node_modules/strip-indent/index.js +13 -0
  413. package/dist/_node_modules/strip-indent/index.js.map +1 -0
  414. package/dist/_node_modules/supports-color/browser.cjs +8 -0
  415. package/dist/_node_modules/supports-color/browser.cjs.map +1 -0
  416. package/dist/_node_modules/supports-color/browser.js +8 -0
  417. package/dist/_node_modules/supports-color/browser.js.map +1 -0
  418. package/dist/_node_modules/trim-newlines/index.cjs +15 -0
  419. package/dist/_node_modules/trim-newlines/index.cjs.map +1 -0
  420. package/dist/_node_modules/trim-newlines/index.js +15 -0
  421. package/dist/_node_modules/trim-newlines/index.js.map +1 -0
  422. package/dist/_node_modules/validate-npm-package-license/index.cjs +71 -0
  423. package/dist/_node_modules/validate-npm-package-license/index.cjs.map +1 -0
  424. package/dist/_node_modules/validate-npm-package-license/index.js +71 -0
  425. package/dist/_node_modules/validate-npm-package-license/index.js.map +1 -0
  426. package/dist/_node_modules/web-streams-polyfill/dist/ponyfill.es2018.cjs +3822 -0
  427. package/dist/_node_modules/web-streams-polyfill/dist/ponyfill.es2018.cjs.map +1 -0
  428. package/dist/_node_modules/web-streams-polyfill/dist/ponyfill.es2018.js +3822 -0
  429. package/dist/_node_modules/web-streams-polyfill/dist/ponyfill.es2018.js.map +1 -0
  430. package/dist/_node_modules/yallist/iterator.cjs +19 -0
  431. package/dist/_node_modules/yallist/iterator.cjs.map +1 -0
  432. package/dist/_node_modules/yallist/iterator.js +19 -0
  433. package/dist/_node_modules/yallist/iterator.js.map +1 -0
  434. package/dist/_node_modules/yallist/yallist.cjs +367 -0
  435. package/dist/_node_modules/yallist/yallist.cjs.map +1 -0
  436. package/dist/_node_modules/yallist/yallist.js +367 -0
  437. package/dist/_node_modules/yallist/yallist.js.map +1 -0
  438. package/dist/_node_modules/yargs-parser/build/lib/index.cjs +56 -0
  439. package/dist/_node_modules/yargs-parser/build/lib/index.cjs.map +1 -0
  440. package/dist/_node_modules/yargs-parser/build/lib/index.js +57 -0
  441. package/dist/_node_modules/yargs-parser/build/lib/index.js.map +1 -0
  442. package/dist/_node_modules/yargs-parser/build/lib/string-utils.cjs +63 -0
  443. package/dist/_node_modules/yargs-parser/build/lib/string-utils.cjs.map +1 -0
  444. package/dist/_node_modules/yargs-parser/build/lib/string-utils.js +63 -0
  445. package/dist/_node_modules/yargs-parser/build/lib/string-utils.js.map +1 -0
  446. package/dist/_node_modules/yargs-parser/build/lib/tokenize-arg-string.cjs +39 -0
  447. package/dist/_node_modules/yargs-parser/build/lib/tokenize-arg-string.cjs.map +1 -0
  448. package/dist/_node_modules/yargs-parser/build/lib/tokenize-arg-string.js +39 -0
  449. package/dist/_node_modules/yargs-parser/build/lib/tokenize-arg-string.js.map +1 -0
  450. package/dist/_node_modules/yargs-parser/build/lib/yargs-parser-types.cjs +15 -0
  451. package/dist/_node_modules/yargs-parser/build/lib/yargs-parser-types.cjs.map +1 -0
  452. package/dist/_node_modules/yargs-parser/build/lib/yargs-parser-types.js +16 -0
  453. package/dist/_node_modules/yargs-parser/build/lib/yargs-parser-types.js.map +1 -0
  454. package/dist/_node_modules/yargs-parser/build/lib/yargs-parser.cjs +847 -0
  455. package/dist/_node_modules/yargs-parser/build/lib/yargs-parser.cjs.map +1 -0
  456. package/dist/_node_modules/yargs-parser/build/lib/yargs-parser.js +847 -0
  457. package/dist/_node_modules/yargs-parser/build/lib/yargs-parser.js.map +1 -0
  458. package/dist/_virtual/_commonjsHelpers.cjs +9 -0
  459. package/dist/_virtual/_commonjsHelpers.cjs.map +1 -0
  460. package/dist/_virtual/_commonjsHelpers.js +9 -0
  461. package/dist/_virtual/_commonjsHelpers.js.map +1 -0
  462. package/dist/_virtual/conversions.cjs +5 -0
  463. package/dist/_virtual/conversions.cjs.map +1 -0
  464. package/dist/_virtual/conversions.js +5 -0
  465. package/dist/_virtual/conversions.js.map +1 -0
  466. package/dist/_virtual/identifier.cjs +5 -0
  467. package/dist/_virtual/identifier.cjs.map +1 -0
  468. package/dist/_virtual/identifier.js +5 -0
  469. package/dist/_virtual/identifier.js.map +1 -0
  470. package/dist/_virtual/index.cjs +5 -0
  471. package/dist/_virtual/index.cjs.map +1 -0
  472. package/dist/_virtual/index.js +5 -0
  473. package/dist/_virtual/index.js.map +1 -0
  474. package/dist/_virtual/index10.cjs +5 -0
  475. package/dist/_virtual/index10.cjs.map +1 -0
  476. package/dist/_virtual/index10.js +5 -0
  477. package/dist/_virtual/index10.js.map +1 -0
  478. package/dist/_virtual/index11.cjs +5 -0
  479. package/dist/_virtual/index11.cjs.map +1 -0
  480. package/dist/_virtual/index11.js +5 -0
  481. package/dist/_virtual/index11.js.map +1 -0
  482. package/dist/_virtual/index2.cjs +5 -0
  483. package/dist/_virtual/index2.cjs.map +1 -0
  484. package/dist/_virtual/index2.js +5 -0
  485. package/dist/_virtual/index2.js.map +1 -0
  486. package/dist/_virtual/index3.cjs +5 -0
  487. package/dist/_virtual/index3.cjs.map +1 -0
  488. package/dist/_virtual/index3.js +5 -0
  489. package/dist/_virtual/index3.js.map +1 -0
  490. package/dist/_virtual/index4.cjs +5 -0
  491. package/dist/_virtual/index4.cjs.map +1 -0
  492. package/dist/_virtual/index4.js +5 -0
  493. package/dist/_virtual/index4.js.map +1 -0
  494. package/dist/_virtual/index5.cjs +5 -0
  495. package/dist/_virtual/index5.cjs.map +1 -0
  496. package/dist/_virtual/index5.js +5 -0
  497. package/dist/_virtual/index5.js.map +1 -0
  498. package/dist/_virtual/index6.cjs +5 -0
  499. package/dist/_virtual/index6.cjs.map +1 -0
  500. package/dist/_virtual/index6.js +5 -0
  501. package/dist/_virtual/index6.js.map +1 -0
  502. package/dist/_virtual/index7.cjs +5 -0
  503. package/dist/_virtual/index7.cjs.map +1 -0
  504. package/dist/_virtual/index7.js +5 -0
  505. package/dist/_virtual/index7.js.map +1 -0
  506. package/dist/_virtual/index8.cjs +5 -0
  507. package/dist/_virtual/index8.cjs.map +1 -0
  508. package/dist/_virtual/index8.js +5 -0
  509. package/dist/_virtual/index8.js.map +1 -0
  510. package/dist/_virtual/index9.cjs +5 -0
  511. package/dist/_virtual/index9.cjs.map +1 -0
  512. package/dist/_virtual/index9.js +5 -0
  513. package/dist/_virtual/index9.js.map +1 -0
  514. package/dist/_virtual/keyword.cjs +5 -0
  515. package/dist/_virtual/keyword.cjs.map +1 -0
  516. package/dist/_virtual/keyword.js +5 -0
  517. package/dist/_virtual/keyword.js.map +1 -0
  518. package/dist/_virtual/ponyfill.es2018.cjs +5 -0
  519. package/dist/_virtual/ponyfill.es2018.cjs.map +1 -0
  520. package/dist/_virtual/ponyfill.es2018.js +5 -0
  521. package/dist/_virtual/ponyfill.es2018.js.map +1 -0
  522. package/dist/_virtual/re.cjs +5 -0
  523. package/dist/_virtual/re.cjs.map +1 -0
  524. package/dist/_virtual/re.js +5 -0
  525. package/dist/_virtual/re.js.map +1 -0
  526. package/dist/cli/loadLocaleIDs.cjs +2 -2
  527. package/dist/cli/loadLocaleIDs.cjs.map +1 -1
  528. package/dist/cli/loadLocaleIDs.js +1 -1
  529. package/dist/cli/loadModels.cjs +2 -2
  530. package/dist/cli/loadModels.cjs.map +1 -1
  531. package/dist/cli/loadModels.js +1 -1
  532. package/dist/cli.cjs +2 -2
  533. package/dist/cli.cjs.map +1 -1
  534. package/dist/cli.js +1 -1
  535. package/dist/lib/buildFieldProperties.cjs +2 -0
  536. package/dist/lib/buildFieldProperties.cjs.map +1 -1
  537. package/dist/lib/buildFieldProperties.js +2 -0
  538. package/dist/lib/buildFieldProperties.js.map +1 -1
  539. package/dist/lib/buildSharedSliceType.cjs +2 -0
  540. package/dist/lib/buildSharedSliceType.cjs.map +1 -1
  541. package/dist/lib/buildSharedSliceType.js +2 -0
  542. package/dist/lib/buildSharedSliceType.js.map +1 -1
  543. package/package.json +2 -2
  544. package/src/lib/buildFieldProperties.ts +2 -0
  545. package/src/lib/buildSharedSliceType.ts +2 -0
  546. 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,EA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,QAAM,IAAI,IAAI,OAAO,OAAO,CAAE,GAAE,UAAU,IAAI;AAChD;AAEA,IAAA,UAAiB;","x_google_ignoreList":[0]}
@@ -0,0 +1,168 @@
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,CAA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c;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,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,IA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AK,KAAK,OAAO,EAAE,IAAI;AAAA,IAC/B;AAED,WAAO,KAAK,OAAO,IAAI;AAAA,EACxB;AACH;AAnKA,IAAM,UAAN;AAaS;AACA;AAuCP;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) : gi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