@skmtc/core 0.0.223 → 0.0.225

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 (331) hide show
  1. package/{script → esm}/_dnt.polyfills.js +1 -2
  2. package/{script → esm}/_dnt.shims.js +4 -8
  3. package/{script → esm}/context/CoreContext.js +24 -28
  4. package/{script → esm}/context/GenerateContext.js +13 -17
  5. package/{script → esm}/context/LogStore.js +1 -5
  6. package/{script → esm}/context/ParseContext.js +1 -5
  7. package/{script → esm}/context/RenderContext.js +17 -47
  8. package/{script → esm}/context/Trail.js +1 -5
  9. package/esm/context/types.js +1 -0
  10. package/{script → esm}/deps/jsr.io/@std/encoding/1.0.1/_validate_binary_like.js +1 -4
  11. package/{script → esm}/deps/jsr.io/@std/encoding/1.0.1/ascii85.js +4 -8
  12. package/{script → esm}/deps/jsr.io/@std/encoding/1.0.1/base32.js +4 -8
  13. package/{script → esm}/deps/jsr.io/@std/encoding/1.0.1/base58.js +4 -8
  14. package/{script → esm}/deps/jsr.io/@std/encoding/1.0.1/base64.js +4 -8
  15. package/{script → esm}/deps/jsr.io/@std/encoding/1.0.1/base64url.js +3 -30
  16. package/{script → esm}/deps/jsr.io/@std/encoding/1.0.1/hex.js +4 -8
  17. package/esm/deps/jsr.io/@std/encoding/1.0.1/mod.js +22 -0
  18. package/{script → esm}/deps/jsr.io/@std/encoding/1.0.1/varint.js +8 -14
  19. package/{script → esm}/deps/jsr.io/@std/path/1.0.0/_common/assert_path.js +1 -4
  20. package/{script → esm}/deps/jsr.io/@std/path/1.0.0/_common/basename.js +5 -10
  21. package/{script → esm}/deps/jsr.io/@std/path/1.0.0/_common/common.js +1 -4
  22. package/esm/deps/jsr.io/@std/path/1.0.0/_common/constants.js +46 -0
  23. package/esm/deps/jsr.io/@std/path/1.0.0/_common/dirname.js +8 -0
  24. package/{script → esm}/deps/jsr.io/@std/path/1.0.0/_common/format.js +2 -6
  25. package/{script → esm}/deps/jsr.io/@std/path/1.0.0/_common/from_file_url.js +1 -4
  26. package/{script → esm}/deps/jsr.io/@std/path/1.0.0/_common/glob_to_reg_exp.js +1 -4
  27. package/esm/deps/jsr.io/@std/path/1.0.0/_common/normalize.js +8 -0
  28. package/{script → esm}/deps/jsr.io/@std/path/1.0.0/_common/normalize_string.js +6 -9
  29. package/esm/deps/jsr.io/@std/path/1.0.0/_common/relative.js +9 -0
  30. package/{script → esm}/deps/jsr.io/@std/path/1.0.0/_common/strip_trailing_separators.js +1 -4
  31. package/{script → esm}/deps/jsr.io/@std/path/1.0.0/_common/to_file_url.js +1 -4
  32. package/esm/deps/jsr.io/@std/path/1.0.0/_os.js +14 -0
  33. package/{script → esm}/deps/jsr.io/@std/path/1.0.0/basename.js +7 -10
  34. package/{script → esm}/deps/jsr.io/@std/path/1.0.0/common.js +4 -7
  35. package/{script → esm}/deps/jsr.io/@std/path/1.0.0/constants.js +4 -7
  36. package/{script → esm}/deps/jsr.io/@std/path/1.0.0/dirname.js +5 -8
  37. package/{script → esm}/deps/jsr.io/@std/path/1.0.0/extname.js +5 -8
  38. package/{script → esm}/deps/jsr.io/@std/path/1.0.0/format.js +5 -8
  39. package/{script → esm}/deps/jsr.io/@std/path/1.0.0/from_file_url.js +5 -8
  40. package/{script → esm}/deps/jsr.io/@std/path/1.0.0/glob_to_regexp.js +7 -10
  41. package/{script → esm}/deps/jsr.io/@std/path/1.0.0/is_absolute.js +5 -8
  42. package/{script → esm}/deps/jsr.io/@std/path/1.0.0/is_glob.js +1 -4
  43. package/{script → esm}/deps/jsr.io/@std/path/1.0.0/join.js +5 -8
  44. package/{script → esm}/deps/jsr.io/@std/path/1.0.0/join_globs.js +7 -10
  45. package/esm/deps/jsr.io/@std/path/1.0.0/mod.js +54 -0
  46. package/{script → esm}/deps/jsr.io/@std/path/1.0.0/normalize.js +5 -8
  47. package/{script → esm}/deps/jsr.io/@std/path/1.0.0/normalize_glob.js +7 -10
  48. package/{script → esm}/deps/jsr.io/@std/path/1.0.0/parse.js +5 -8
  49. package/esm/deps/jsr.io/@std/path/1.0.0/posix/_util.js +8 -0
  50. package/{script → esm}/deps/jsr.io/@std/path/1.0.0/posix/basename.js +8 -11
  51. package/{script → esm}/deps/jsr.io/@std/path/1.0.0/posix/constants.js +3 -6
  52. package/{script → esm}/deps/jsr.io/@std/path/1.0.0/posix/dirname.js +8 -11
  53. package/{script → esm}/deps/jsr.io/@std/path/1.0.0/posix/extname.js +7 -10
  54. package/{script → esm}/deps/jsr.io/@std/path/1.0.0/posix/format.js +4 -7
  55. package/{script → esm}/deps/jsr.io/@std/path/1.0.0/posix/from_file_url.js +3 -6
  56. package/{script → esm}/deps/jsr.io/@std/path/1.0.0/posix/glob_to_regexp.js +3 -6
  57. package/{script → esm}/deps/jsr.io/@std/path/1.0.0/posix/is_absolute.js +5 -8
  58. package/{script → esm}/deps/jsr.io/@std/path/1.0.0/posix/join.js +5 -8
  59. package/{script → esm}/deps/jsr.io/@std/path/1.0.0/posix/join_globs.js +7 -10
  60. package/{script → esm}/deps/jsr.io/@std/path/1.0.0/posix/normalize.js +8 -11
  61. package/{script → esm}/deps/jsr.io/@std/path/1.0.0/posix/normalize_glob.js +6 -9
  62. package/{script → esm}/deps/jsr.io/@std/path/1.0.0/posix/parse.js +10 -13
  63. package/{script → esm}/deps/jsr.io/@std/path/1.0.0/posix/relative.js +14 -17
  64. package/esm/deps/jsr.io/@std/path/1.0.0/posix/resolve.js +59 -0
  65. package/{script → esm}/deps/jsr.io/@std/path/1.0.0/posix/to_file_url.js +5 -8
  66. package/{script → esm}/deps/jsr.io/@std/path/1.0.0/posix/to_namespaced_path.js +1 -4
  67. package/{script → esm}/deps/jsr.io/@std/path/1.0.0/relative.js +5 -8
  68. package/{script → esm}/deps/jsr.io/@std/path/1.0.0/resolve.js +7 -10
  69. package/{script → esm}/deps/jsr.io/@std/path/1.0.0/to_file_url.js +5 -8
  70. package/{script → esm}/deps/jsr.io/@std/path/1.0.0/to_namespaced_path.js +7 -10
  71. package/{script → esm}/deps/jsr.io/@std/path/1.0.0/types.js +1 -2
  72. package/esm/deps/jsr.io/@std/path/1.0.0/windows/_util.js +15 -0
  73. package/{script → esm}/deps/jsr.io/@std/path/1.0.0/windows/basename.js +11 -14
  74. package/{script → esm}/deps/jsr.io/@std/path/1.0.0/windows/constants.js +3 -6
  75. package/{script → esm}/deps/jsr.io/@std/path/1.0.0/windows/dirname.js +17 -20
  76. package/{script → esm}/deps/jsr.io/@std/path/1.0.0/windows/extname.js +9 -12
  77. package/{script → esm}/deps/jsr.io/@std/path/1.0.0/windows/format.js +4 -7
  78. package/{script → esm}/deps/jsr.io/@std/path/1.0.0/windows/from_file_url.js +3 -6
  79. package/{script → esm}/deps/jsr.io/@std/path/1.0.0/windows/glob_to_regexp.js +3 -6
  80. package/{script → esm}/deps/jsr.io/@std/path/1.0.0/windows/is_absolute.js +9 -12
  81. package/{script → esm}/deps/jsr.io/@std/path/1.0.0/windows/join.js +10 -13
  82. package/{script → esm}/deps/jsr.io/@std/path/1.0.0/windows/join_globs.js +7 -10
  83. package/{script → esm}/deps/jsr.io/@std/path/1.0.0/windows/normalize.js +17 -20
  84. package/{script → esm}/deps/jsr.io/@std/path/1.0.0/windows/normalize_glob.js +6 -9
  85. package/{script → esm}/deps/jsr.io/@std/path/1.0.0/windows/parse.js +16 -19
  86. package/{script → esm}/deps/jsr.io/@std/path/1.0.0/windows/relative.js +16 -19
  87. package/{script → esm}/deps/jsr.io/@std/path/1.0.0/windows/resolve.js +17 -43
  88. package/{script → esm}/deps/jsr.io/@std/path/1.0.0/windows/to_file_url.js +5 -8
  89. package/{script → esm}/deps/jsr.io/@std/path/1.0.0/windows/to_namespaced_path.js +11 -14
  90. package/{script → esm}/deps/jsr.io/@std/yaml/0.215.0/_dumper/dumper.js +10 -36
  91. package/{script → esm}/deps/jsr.io/@std/yaml/0.215.0/_dumper/dumper_state.js +2 -6
  92. package/{script → esm}/deps/jsr.io/@std/yaml/0.215.0/_error.js +1 -5
  93. package/{script → esm}/deps/jsr.io/@std/yaml/0.215.0/_loader/loader.js +9 -36
  94. package/{script → esm}/deps/jsr.io/@std/yaml/0.215.0/_loader/loader_state.js +2 -6
  95. package/{script → esm}/deps/jsr.io/@std/yaml/0.215.0/_mark.js +3 -7
  96. package/{script → esm}/deps/jsr.io/@std/yaml/0.215.0/_state.js +3 -7
  97. package/{script → esm}/deps/jsr.io/@std/yaml/0.215.0/_type/binary.js +2 -5
  98. package/{script → esm}/deps/jsr.io/@std/yaml/0.215.0/_type/bool.js +4 -7
  99. package/{script → esm}/deps/jsr.io/@std/yaml/0.215.0/_type/float.js +5 -8
  100. package/{script → esm}/deps/jsr.io/@std/yaml/0.215.0/_type/function.js +2 -5
  101. package/{script → esm}/deps/jsr.io/@std/yaml/0.215.0/_type/int.js +4 -7
  102. package/{script → esm}/deps/jsr.io/@std/yaml/0.215.0/_type/map.js +2 -5
  103. package/{script → esm}/deps/jsr.io/@std/yaml/0.215.0/_type/merge.js +2 -5
  104. package/esm/deps/jsr.io/@std/yaml/0.215.0/_type/mod.js +20 -0
  105. package/{script → esm}/deps/jsr.io/@std/yaml/0.215.0/_type/nil.js +2 -5
  106. package/{script → esm}/deps/jsr.io/@std/yaml/0.215.0/_type/omap.js +2 -5
  107. package/{script → esm}/deps/jsr.io/@std/yaml/0.215.0/_type/pairs.js +2 -5
  108. package/{script → esm}/deps/jsr.io/@std/yaml/0.215.0/_type/regexp.js +2 -5
  109. package/{script → esm}/deps/jsr.io/@std/yaml/0.215.0/_type/seq.js +2 -5
  110. package/{script → esm}/deps/jsr.io/@std/yaml/0.215.0/_type/set.js +2 -5
  111. package/{script → esm}/deps/jsr.io/@std/yaml/0.215.0/_type/str.js +2 -5
  112. package/{script → esm}/deps/jsr.io/@std/yaml/0.215.0/_type/timestamp.js +2 -5
  113. package/{script → esm}/deps/jsr.io/@std/yaml/0.215.0/_type/undefined.js +2 -5
  114. package/{script → esm}/deps/jsr.io/@std/yaml/0.215.0/_utils.js +15 -32
  115. package/{script → esm}/deps/jsr.io/@std/yaml/0.215.0/mod.js +4 -20
  116. package/{script → esm}/deps/jsr.io/@std/yaml/0.215.0/parse.js +5 -9
  117. package/{script → esm}/deps/jsr.io/@std/yaml/0.215.0/schema/core.js +4 -7
  118. package/esm/deps/jsr.io/@std/yaml/0.215.0/schema/default.js +15 -0
  119. package/{script → esm}/deps/jsr.io/@std/yaml/0.215.0/schema/extended.js +6 -9
  120. package/{script → esm}/deps/jsr.io/@std/yaml/0.215.0/schema/failsafe.js +4 -7
  121. package/{script → esm}/deps/jsr.io/@std/yaml/0.215.0/schema/json.js +6 -9
  122. package/esm/deps/jsr.io/@std/yaml/0.215.0/schema/mod.js +10 -0
  123. package/{script → esm}/deps/jsr.io/@std/yaml/0.215.0/schema.js +3 -7
  124. package/{script → esm}/deps/jsr.io/@std/yaml/0.215.0/stringify.js +3 -6
  125. package/{script → esm}/deps/jsr.io/@std/yaml/0.215.0/type.js +1 -5
  126. package/{script → esm}/dsl/ContentSettings.js +1 -5
  127. package/{script → esm}/dsl/Definition.js +4 -8
  128. package/{script → esm}/dsl/GeneratedValueList.js +3 -7
  129. package/{script → esm}/dsl/Identifier.js +8 -12
  130. package/{script → esm}/dsl/Import.js +2 -7
  131. package/esm/dsl/ModelCreator.js +1 -0
  132. package/{script → esm}/dsl/ModelDriver.js +14 -18
  133. package/esm/dsl/OperationCreator.js +1 -0
  134. package/{script → esm}/dsl/OperationDriver.js +11 -15
  135. package/esm/dsl/Stringable.js +1 -0
  136. package/{script → esm}/dsl/ValueBase.js +1 -5
  137. package/{script → esm}/dsl/base.js +5 -13
  138. package/esm/dsl/constants.js +1 -0
  139. package/{script → esm}/dsl/withConfig.js +9 -15
  140. package/esm/generate/generate.js +47 -0
  141. package/esm/generate/generateModels.js +29 -0
  142. package/esm/generate/generateOperations.js +35 -0
  143. package/{script → esm}/helpers/logStatus.js +2 -7
  144. package/esm/helpers/naming.js +25 -0
  145. package/esm/helpers/refFns.js +24 -0
  146. package/esm/helpers/strings.js +6 -0
  147. package/{script → esm}/helpers/verifyType.js +1 -4
  148. package/esm/mod.js +61 -0
  149. package/{script → esm}/oas/array/Array.js +2 -6
  150. package/esm/oas/array/array-types.js +17 -0
  151. package/esm/oas/array/toArray.js +20 -0
  152. package/{script → esm}/oas/boolean/Boolean.js +2 -6
  153. package/esm/oas/boolean/boolean-types.js +8 -0
  154. package/esm/oas/boolean/toBoolean.js +10 -0
  155. package/{script → esm}/oas/components/Components.js +2 -6
  156. package/esm/oas/components/toComponentsV3.js +44 -0
  157. package/esm/oas/contact/contact-types.js +7 -0
  158. package/{script → esm}/oas/discriminator/Discriminator.js +2 -6
  159. package/esm/oas/discriminator/discriminator-types.js +6 -0
  160. package/esm/oas/discriminator/toDiscriminatorV3.js +11 -0
  161. package/{script → esm}/oas/document/Document.js +2 -6
  162. package/esm/oas/document/toDocumentV3.js +24 -0
  163. package/{script → esm}/oas/example/Example.js +2 -6
  164. package/esm/oas/example/example-types.js +9 -0
  165. package/esm/oas/example/toExamplesV3.js +45 -0
  166. package/{script → esm}/oas/header/Header.js +2 -6
  167. package/esm/oas/header/toHeadersV3.js +42 -0
  168. package/{script → esm}/oas/info/Info.js +2 -6
  169. package/{script → esm}/oas/info/toInfoV3.js +3 -7
  170. package/{script → esm}/oas/integer/Integer.js +2 -6
  171. package/esm/oas/integer/integer-types.js +18 -0
  172. package/esm/oas/integer/toInteger.js +13 -0
  173. package/{script → esm}/oas/intersection/Intersection.js +2 -6
  174. package/esm/oas/intersection/intersection-types.js +12 -0
  175. package/esm/oas/intersection/toIntersection.js +22 -0
  176. package/esm/oas/license/license-types.js +7 -0
  177. package/esm/oas/markdown/markdown-types.js +2 -0
  178. package/{script → esm}/oas/mediaType/MediaType.js +2 -6
  179. package/esm/oas/mediaType/mediaType-types.js +12 -0
  180. package/esm/oas/mediaType/toMediaTypeItemV3.js +37 -0
  181. package/esm/oas/null/null-types.js +8 -0
  182. package/{script → esm}/oas/number/Number.js +2 -6
  183. package/esm/oas/number/number-types.js +14 -0
  184. package/esm/oas/number/toNumber.js +10 -0
  185. package/{script → esm}/oas/object/Object.js +4 -8
  186. package/esm/oas/object/object-types.js +27 -0
  187. package/esm/oas/object/toAdditionalPropertiesV3.js +14 -0
  188. package/esm/oas/object/toObject.js +23 -0
  189. package/{script → esm}/oas/operation/Operation.js +2 -6
  190. package/{script → esm}/oas/operation/toOperationsV3.js +13 -18
  191. package/{script → esm}/oas/parameter/Parameter.js +2 -6
  192. package/esm/oas/parameter/parameter-types.js +38 -0
  193. package/{script → esm}/oas/parameter/toParameterV3.js +22 -28
  194. package/{script → esm}/oas/pathItem/PathItem.js +2 -6
  195. package/esm/oas/pathItem/toPathItemV3.js +15 -0
  196. package/{script → esm}/oas/ref/Ref.js +6 -10
  197. package/esm/oas/ref/ref-types.js +54 -0
  198. package/esm/oas/ref/toRefV31.js +11 -0
  199. package/{script → esm}/oas/requestBody/RequestBody.js +2 -6
  200. package/esm/oas/requestBody/toRequestBodiesV3.js +46 -0
  201. package/{script → esm}/oas/response/Response.js +2 -6
  202. package/esm/oas/response/toResponseV3.js +35 -0
  203. package/esm/oas/schema/Schema.js +1 -0
  204. package/esm/oas/schema/schema-types.js +23 -0
  205. package/esm/oas/schema/toSchemasV3.js +60 -0
  206. package/{script → esm}/oas/string/String.js +2 -6
  207. package/esm/oas/string/string-types.js +29 -0
  208. package/esm/oas/string/toString.js +11 -0
  209. package/{script → esm}/oas/tag/Tag.js +2 -6
  210. package/esm/oas/tag/toTagsV3.js +14 -0
  211. package/{script → esm}/oas/union/Union.js +2 -6
  212. package/esm/oas/union/toUnion.js +22 -0
  213. package/esm/oas/union/union-types.js +12 -0
  214. package/{script → esm}/oas/unknown/Unknown.js +2 -6
  215. package/esm/oas/unknown/toUnknown.js +9 -0
  216. package/esm/oas/unknown/unknown-types.js +8 -0
  217. package/{script → esm}/oas/void/Void.js +4 -8
  218. package/{script → esm}/oas-elements/OasBase.js +1 -5
  219. package/esm/package.json +3 -0
  220. package/esm/parse/parse.js +16 -0
  221. package/{script → esm}/schemas/client.js +2 -4
  222. package/{script → esm}/server/createServer.js +24 -51
  223. package/esm/types/Brand.js +1 -0
  224. package/{script → esm}/types/CustomValue.js +3 -8
  225. package/esm/types/GeneratedValue.js +1 -0
  226. package/{script → esm}/types/GenerationType.js +1 -2
  227. package/esm/types/GeneratorKeys.js +13 -0
  228. package/esm/types/Method.js +32 -0
  229. package/esm/types/Modifiers.js +1 -0
  230. package/esm/types/RefName.js +1 -0
  231. package/esm/types/Settings.js +42 -0
  232. package/esm/types/TypeSystem.js +1 -0
  233. package/esm/types/prettierConfig.js +46 -0
  234. package/{script → esm}/typescript/EntityType.js +3 -7
  235. package/{script → esm}/typescript/FunctionParameter.js +10 -17
  236. package/{script → esm}/typescript/ReactRouterPathParams.js +2 -6
  237. package/esm/typescript/identifiers.js +7 -0
  238. package/esm/typescript/keyValues.js +11 -0
  239. package/{script → esm}/typescript/toDestructuredObject.js +1 -5
  240. package/{script → esm}/typescript/toOperationArg.js +7 -14
  241. package/esm/typescript/toOperationResponse.js +17 -0
  242. package/esm/typescript/toParamsObject.js +12 -0
  243. package/esm/typescript/toPathTemplate.js +3 -0
  244. package/esm/typescript/withDescription.js +3 -0
  245. package/package.json +14 -8
  246. package/types/types/Method.d.ts +1 -0
  247. package/types/types/Method.d.ts.map +1 -1
  248. package/script/context/types.js +0 -2
  249. package/script/deps/jsr.io/@std/encoding/1.0.1/mod.js +0 -38
  250. package/script/deps/jsr.io/@std/path/1.0.0/_common/constants.js +0 -49
  251. package/script/deps/jsr.io/@std/path/1.0.0/_common/dirname.js +0 -11
  252. package/script/deps/jsr.io/@std/path/1.0.0/_common/normalize.js +0 -11
  253. package/script/deps/jsr.io/@std/path/1.0.0/_common/relative.js +0 -12
  254. package/script/deps/jsr.io/@std/path/1.0.0/_os.js +0 -40
  255. package/script/deps/jsr.io/@std/path/1.0.0/mod.js +0 -70
  256. package/script/deps/jsr.io/@std/path/1.0.0/posix/_util.js +0 -11
  257. package/script/deps/jsr.io/@std/path/1.0.0/posix/resolve.js +0 -85
  258. package/script/deps/jsr.io/@std/path/1.0.0/windows/_util.js +0 -20
  259. package/script/deps/jsr.io/@std/yaml/0.215.0/_type/mod.js +0 -39
  260. package/script/deps/jsr.io/@std/yaml/0.215.0/schema/default.js +0 -18
  261. package/script/deps/jsr.io/@std/yaml/0.215.0/schema/mod.js +0 -18
  262. package/script/dsl/ModelCreator.js +0 -2
  263. package/script/dsl/OperationCreator.js +0 -2
  264. package/script/dsl/Stringable.js +0 -2
  265. package/script/dsl/constants.js +0 -4
  266. package/script/generate/generate.js +0 -75
  267. package/script/generate/generateModels.js +0 -56
  268. package/script/generate/generateOperations.js +0 -62
  269. package/script/helpers/naming.js +0 -33
  270. package/script/helpers/refFns.js +0 -30
  271. package/script/helpers/strings.js +0 -11
  272. package/script/mod.js +0 -77
  273. package/script/oas/array/array-types.js +0 -20
  274. package/script/oas/array/toArray.js +0 -24
  275. package/script/oas/boolean/boolean-types.js +0 -11
  276. package/script/oas/boolean/toBoolean.js +0 -14
  277. package/script/oas/components/toComponentsV3.js +0 -48
  278. package/script/oas/contact/contact-types.js +0 -10
  279. package/script/oas/discriminator/discriminator-types.js +0 -9
  280. package/script/oas/discriminator/toDiscriminatorV3.js +0 -15
  281. package/script/oas/document/toDocumentV3.js +0 -28
  282. package/script/oas/example/example-types.js +0 -12
  283. package/script/oas/example/toExamplesV3.js +0 -51
  284. package/script/oas/header/toHeadersV3.js +0 -46
  285. package/script/oas/integer/integer-types.js +0 -21
  286. package/script/oas/integer/toInteger.js +0 -17
  287. package/script/oas/intersection/intersection-types.js +0 -15
  288. package/script/oas/intersection/toIntersection.js +0 -26
  289. package/script/oas/license/license-types.js +0 -10
  290. package/script/oas/markdown/markdown-types.js +0 -5
  291. package/script/oas/mediaType/mediaType-types.js +0 -15
  292. package/script/oas/mediaType/toMediaTypeItemV3.js +0 -43
  293. package/script/oas/null/null-types.js +0 -11
  294. package/script/oas/number/number-types.js +0 -17
  295. package/script/oas/number/toNumber.js +0 -14
  296. package/script/oas/object/object-types.js +0 -30
  297. package/script/oas/object/toAdditionalPropertiesV3.js +0 -18
  298. package/script/oas/object/toObject.js +0 -27
  299. package/script/oas/parameter/parameter-types.js +0 -41
  300. package/script/oas/pathItem/toPathItemV3.js +0 -19
  301. package/script/oas/ref/ref-types.js +0 -57
  302. package/script/oas/ref/toRefV31.js +0 -15
  303. package/script/oas/requestBody/toRequestBodiesV3.js +0 -51
  304. package/script/oas/response/toResponseV3.js +0 -41
  305. package/script/oas/schema/Schema.js +0 -2
  306. package/script/oas/schema/schema-types.js +0 -26
  307. package/script/oas/schema/toSchemasV3.js +0 -67
  308. package/script/oas/string/string-types.js +0 -32
  309. package/script/oas/string/toString.js +0 -15
  310. package/script/oas/tag/toTagsV3.js +0 -18
  311. package/script/oas/union/toUnion.js +0 -26
  312. package/script/oas/union/union-types.js +0 -15
  313. package/script/oas/unknown/toUnknown.js +0 -13
  314. package/script/oas/unknown/unknown-types.js +0 -11
  315. package/script/package.json +0 -3
  316. package/script/parse/parse.js +0 -20
  317. package/script/types/Brand.js +0 -2
  318. package/script/types/GeneratedValue.js +0 -2
  319. package/script/types/GeneratorKeys.js +0 -19
  320. package/script/types/Method.js +0 -34
  321. package/script/types/Modifiers.js +0 -2
  322. package/script/types/RefName.js +0 -2
  323. package/script/types/Settings.js +0 -45
  324. package/script/types/TypeSystem.js +0 -2
  325. package/script/types/prettierConfig.js +0 -49
  326. package/script/typescript/identifiers.js +0 -12
  327. package/script/typescript/keyValues.js +0 -15
  328. package/script/typescript/toOperationResponse.js +0 -21
  329. package/script/typescript/toParamsObject.js +0 -16
  330. package/script/typescript/toPathTemplate.js +0 -7
  331. package/script/typescript/withDescription.js +0 -7
@@ -1,12 +1,6 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.FunctionParameter = void 0;
7
- const ts_pattern_1 = require("ts-pattern");
8
- const tiny_invariant_1 = __importDefault(require("tiny-invariant"));
9
- class FunctionParameter {
1
+ import { P, match } from 'ts-pattern';
2
+ import invariant from 'tiny-invariant';
3
+ export class FunctionParameter {
10
4
  constructor(args) {
11
5
  Object.defineProperty(this, "properties", {
12
6
  enumerable: true,
@@ -14,7 +8,7 @@ class FunctionParameter {
14
8
  writable: true,
15
9
  value: void 0
16
10
  });
17
- this.properties = (0, ts_pattern_1.match)(args)
11
+ this.properties = match(args)
18
12
  .with({ value: { type: 'void' } }, ({ value }) => ({
19
13
  type: 'void',
20
14
  value
@@ -24,7 +18,7 @@ class FunctionParameter {
24
18
  identifier,
25
19
  value
26
20
  }))
27
- .with({ name: ts_pattern_1.P.string }, ({ identifier, value, name, required }) => ({
21
+ .with({ name: P.string }, ({ identifier, value, name, required }) => ({
28
22
  type: 'regular',
29
23
  identifier,
30
24
  name,
@@ -39,7 +33,7 @@ class FunctionParameter {
39
33
  if (this.properties.type === 'void') {
40
34
  return this;
41
35
  }
42
- (0, tiny_invariant_1.default)(this.properties.value.type === 'object', 'Only object types can be destructured');
36
+ invariant(this.properties.value.type === 'object', 'Only object types can be destructured');
43
37
  return new FunctionParameter({
44
38
  identifier: this.properties.identifier,
45
39
  value: this.properties.value,
@@ -47,7 +41,7 @@ class FunctionParameter {
47
41
  });
48
42
  }
49
43
  toPropertyList() {
50
- return (0, ts_pattern_1.match)(this.properties)
44
+ return match(this.properties)
51
45
  .with({ type: 'void' }, () => [])
52
46
  .with({ type: 'regular' }, ({ name }) => [`${name}`])
53
47
  .with({ type: 'destructured' }, ({ value }) => {
@@ -58,7 +52,7 @@ class FunctionParameter {
58
52
  });
59
53
  }
60
54
  toInbound() {
61
- return (0, ts_pattern_1.match)(this.properties)
55
+ return match(this.properties)
62
56
  .with({ type: 'void' }, () => '')
63
57
  .with({ type: 'regular' }, ({ name }) => {
64
58
  return `${name}`;
@@ -72,7 +66,7 @@ class FunctionParameter {
72
66
  });
73
67
  }
74
68
  toString() {
75
- return (0, ts_pattern_1.match)(this.properties)
69
+ return match(this.properties)
76
70
  .with({ type: 'void' }, () => '')
77
71
  .with({ type: 'regular' }, ({ name, identifier, required }) => {
78
72
  return `${name}${required ? '' : '?'}: ${identifier}`;
@@ -86,8 +80,7 @@ class FunctionParameter {
86
80
  });
87
81
  }
88
82
  }
89
- exports.FunctionParameter = FunctionParameter;
90
83
  const toPropertyNames = (value) => {
91
- (0, tiny_invariant_1.default)(value.objectProperties, 'Only object types can be destructured');
84
+ invariant(value.objectProperties, 'Only object types can be destructured');
92
85
  return Object.keys(value.objectProperties.properties);
93
86
  };
@@ -1,8 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ReactRouterPathParams = void 0;
4
- const ValueBase_js_1 = require("../dsl/ValueBase.js");
5
- class ReactRouterPathParams extends ValueBase_js_1.ValueBase {
1
+ import { ValueBase } from '../dsl/ValueBase.js';
2
+ export class ReactRouterPathParams extends ValueBase {
6
3
  constructor({ context, operation, generatorKey, destinationPath }) {
7
4
  super({ context, generatorKey });
8
5
  Object.defineProperty(this, "getParams", {
@@ -50,4 +47,3 @@ class ReactRouterPathParams extends ValueBase_js_1.ValueBase {
50
47
  return ``;
51
48
  }
52
49
  }
53
- exports.ReactRouterPathParams = ReactRouterPathParams;
@@ -0,0 +1,7 @@
1
+ import { isIdentifierName } from '@babel/helper-validator-identifier';
2
+ export const handleKey = (key) => {
3
+ return isIdentifierName(key) ? key : `'${key}'`;
4
+ };
5
+ export const handlePropertyName = (name, parent) => {
6
+ return isIdentifierName(name) ? `${parent}.${name}` : `${parent}['${name}']`;
7
+ };
@@ -0,0 +1,11 @@
1
+ import { EMPTY } from '../dsl/constants.js';
2
+ // Filter out properties with falsy or EMPTY values and return as joined string
3
+ export const keyValues = (properties) => {
4
+ const filteredEntries = Object.entries(properties)
5
+ .map(([key, value]) => {
6
+ const renderedValue = value?.toString() || EMPTY;
7
+ return renderedValue === EMPTY ? EMPTY : `${key}: ${renderedValue}`;
8
+ })
9
+ .filter(row => row !== EMPTY);
10
+ return filteredEntries.length ? `{${filteredEntries.join(',\n')}}` : EMPTY;
11
+ };
@@ -1,7 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.toDestructuredObject = void 0;
4
- const toDestructuredObject = (value) => {
1
+ export const toDestructuredObject = (value) => {
5
2
  if (value.type === 'void') {
6
3
  return '';
7
4
  }
@@ -17,4 +14,3 @@ const toDestructuredObject = (value) => {
17
14
  const propertyNames = Object.keys(value.objectProperties.properties);
18
15
  return `{${propertyNames.join(', ')}}`;
19
16
  };
20
- exports.toDestructuredObject = toDestructuredObject;
@@ -1,27 +1,20 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.toOperationArg = void 0;
7
- const Object_js_1 = require("../oas/object/Object.js");
8
- const Void_js_1 = require("../oas/void/Void.js");
9
- const isEmpty_js_1 = __importDefault(require("lodash-es/isEmpty.js"));
10
- const toOperationArg = ({ context, operation, insertProperties = [], removeProperties = [] }) => {
1
+ import { OasObject } from '../oas/object/Object.js';
2
+ import { OasVoid } from '../oas/void/Void.js';
3
+ import isEmpty from 'lodash-es/isEmpty.js';
4
+ export const toOperationArg = ({ context, operation, insertProperties = [], removeProperties = [] }) => {
11
5
  const { properties, required } = toOperationArgProperties({
12
6
  operation,
13
7
  insertProperties,
14
8
  removeProperties
15
9
  });
16
- const schema = (0, isEmpty_js_1.default)(properties)
17
- ? Void_js_1.OasVoid.empty(context)
18
- : Object_js_1.OasObject.fromFields({
10
+ const schema = isEmpty(properties)
11
+ ? OasVoid.empty(context)
12
+ : OasObject.fromFields({
19
13
  fields: { required, properties },
20
14
  context
21
15
  });
22
16
  return schema;
23
17
  };
24
- exports.toOperationArg = toOperationArg;
25
18
  const toOperationArgProperties = ({ operation, insertProperties: ip = [], removeProperties = [] }) => {
26
19
  const body = operation.requestBody?.resolve().toSchema('application/json');
27
20
  const insertProperties = body
@@ -0,0 +1,17 @@
1
+ import { Definition } from '../dsl/Definition.js';
2
+ import { OasVoid } from '../oas/void/Void.js';
3
+ import { toResponseName } from '../helpers/naming.js';
4
+ export const toOperationResponse = ({ context, operation, destinationPath, typeSystemCreator, toIdentifier }) => {
5
+ const successResponse = operation.toSuccessResponse()?.resolve();
6
+ const value = typeSystemCreator.create({
7
+ context,
8
+ schema: successResponse?.toSchema() ?? OasVoid.empty(context),
9
+ destinationPath
10
+ });
11
+ return new Definition({
12
+ context,
13
+ identifier: toIdentifier(toResponseName(operation)),
14
+ value,
15
+ description: successResponse?.description
16
+ });
17
+ };
@@ -0,0 +1,12 @@
1
+ import { handleKey, handlePropertyName } from './identifiers.js';
2
+ import { EMPTY } from '../dsl/constants.js';
3
+ export const toParamsObject = (parameters, queryArg) => {
4
+ if (!parameters?.length) {
5
+ return EMPTY;
6
+ }
7
+ const keyValues = parameters.map(({ name }) => {
8
+ const keyValue = `${handleKey(name)}: ${handlePropertyName(name, queryArg)}`;
9
+ return keyValue;
10
+ });
11
+ return `{${keyValues.join(',\n')}}`;
12
+ };
@@ -0,0 +1,3 @@
1
+ export const toPathTemplate = (path, queryArg) => {
2
+ return `${path.replaceAll(/{([^}]*)}/g, queryArg ? '${' + queryArg + '.$1}' : '${$1}')}`;
3
+ };
@@ -0,0 +1,3 @@
1
+ export const withDescription = (value, { description }) => {
2
+ return description ? `/** ${description} */\n${value}` : `${value}`;
3
+ };
package/package.json CHANGED
@@ -1,25 +1,31 @@
1
1
  {
2
2
  "name": "@skmtc/core",
3
- "version": "0.0.223",
4
- "main": "./script/mod.js",
3
+ "version": "0.0.225",
4
+ "module": "./esm/mod.js",
5
5
  "types": "./types/mod.d.ts",
6
6
  "exports": {
7
7
  ".": {
8
- "require": {
8
+ "import": {
9
9
  "types": "./types/mod.d.ts",
10
- "default": "./script/mod.js"
10
+ "default": "./esm/mod.js"
11
11
  }
12
12
  },
13
13
  "./settings": {
14
- "require": {
14
+ "import": {
15
15
  "types": "./types/types/Settings.d.ts",
16
- "default": "./script/types/Settings.js"
16
+ "default": "./esm/types/Settings.js"
17
+ }
18
+ },
19
+ "./method": {
20
+ "import": {
21
+ "types": "./types/types/Method.d.ts",
22
+ "default": "./esm/types/Method.js"
17
23
  }
18
24
  },
19
25
  "./clientSchema": {
20
- "require": {
26
+ "import": {
21
27
  "types": "./types/schemas/client.js",
22
- "default": "./script/schemas/client.js"
28
+ "default": "./esm/schemas/client.js"
23
29
  }
24
30
  }
25
31
  },
@@ -1,3 +1,4 @@
1
+ import "../_dnt.polyfills.js";
1
2
  import { z } from 'zod';
2
3
  export declare const methodValues: readonly ["get", "put", "post", "delete", "options", "head", "patch", "trace"];
3
4
  export declare const methodValuesNoTrace: string[];
@@ -1 +1 @@
1
- {"version":3,"file":"Method.d.ts","sourceRoot":"","sources":["../../src/types/Method.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,eAAO,MAAM,YAAY,gFASf,CAAA;AAEV,eAAO,MAAM,mBAAmB,UAQ/B,CAAA;AAED,eAAO,MAAM,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,CASnC,CAAA;AAEF,MAAM,MAAM,MAAM,GACd,KAAK,GACL,KAAK,GACL,MAAM,GACN,QAAQ,GACR,SAAS,GACT,MAAM,GACN,OAAO,GACP,OAAO,CAAA;AAEX,KAAK,OAAO,GAAG,MAAM,EAAE,CAAA;AAEvB,eAAO,MAAM,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,CAAmB,CAAA"}
1
+ {"version":3,"file":"Method.d.ts","sourceRoot":"","sources":["../../src/types/Method.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAC9B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,eAAO,MAAM,YAAY,gFASf,CAAA;AAEV,eAAO,MAAM,mBAAmB,UAQ/B,CAAA;AAED,eAAO,MAAM,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,CASnC,CAAA;AAEF,MAAM,MAAM,MAAM,GACd,KAAK,GACL,KAAK,GACL,MAAM,GACN,QAAQ,GACR,SAAS,GACT,MAAM,GACN,OAAO,GACP,OAAO,CAAA;AAEX,KAAK,OAAO,GAAG,MAAM,EAAE,CAAA;AAEvB,eAAO,MAAM,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,CAAmB,CAAA"}
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,38 +0,0 @@
1
- "use strict";
2
- // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
3
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
- if (k2 === undefined) k2 = k;
5
- var desc = Object.getOwnPropertyDescriptor(m, k);
6
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
- desc = { enumerable: true, get: function() { return m[k]; } };
8
- }
9
- Object.defineProperty(o, k2, desc);
10
- }) : (function(o, m, k, k2) {
11
- if (k2 === undefined) k2 = k;
12
- o[k2] = m[k];
13
- }));
14
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
16
- };
17
- Object.defineProperty(exports, "__esModule", { value: true });
18
- /**
19
- * Utilities for encoding and decoding common formats like hex, base64, and varint.
20
- *
21
- * ```ts
22
- * import { encodeBase64, decodeBase64 } from "@std/encoding";
23
- * import { assertEquals } from "@std/assert";
24
- *
25
- * const foobar = new TextEncoder().encode("foobar");
26
- * assertEquals(encodeBase64(foobar), "Zm9vYmFy");
27
- * assertEquals(decodeBase64("Zm9vYmFy"), foobar);
28
- * ```
29
- *
30
- * @module
31
- */
32
- __exportStar(require("./ascii85.js"), exports);
33
- __exportStar(require("./base32.js"), exports);
34
- __exportStar(require("./base58.js"), exports);
35
- __exportStar(require("./base64.js"), exports);
36
- __exportStar(require("./base64url.js"), exports);
37
- __exportStar(require("./hex.js"), exports);
38
- __exportStar(require("./varint.js"), exports);
@@ -1,49 +0,0 @@
1
- "use strict";
2
- // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
3
- // Copyright the Browserify authors. MIT License.
4
- // Ported from https://github.com/browserify/path-browserify/
5
- // This module is browser compatible.
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.CHAR_9 = exports.CHAR_0 = exports.CHAR_EQUAL = exports.CHAR_AMPERSAND = exports.CHAR_AT = exports.CHAR_GRAVE_ACCENT = exports.CHAR_CIRCUMFLEX_ACCENT = exports.CHAR_SEMICOLON = exports.CHAR_PERCENT = exports.CHAR_SINGLE_QUOTE = exports.CHAR_DOUBLE_QUOTE = exports.CHAR_PLUS = exports.CHAR_HYPHEN_MINUS = exports.CHAR_RIGHT_CURLY_BRACKET = exports.CHAR_LEFT_CURLY_BRACKET = exports.CHAR_RIGHT_ANGLE_BRACKET = exports.CHAR_LEFT_ANGLE_BRACKET = exports.CHAR_RIGHT_SQUARE_BRACKET = exports.CHAR_LEFT_SQUARE_BRACKET = exports.CHAR_ZERO_WIDTH_NOBREAK_SPACE = exports.CHAR_NO_BREAK_SPACE = exports.CHAR_SPACE = exports.CHAR_HASH = exports.CHAR_EXCLAMATION_MARK = exports.CHAR_FORM_FEED = exports.CHAR_TAB = exports.CHAR_CARRIAGE_RETURN = exports.CHAR_LINE_FEED = exports.CHAR_UNDERSCORE = exports.CHAR_QUESTION_MARK = exports.CHAR_COLON = exports.CHAR_VERTICAL_LINE = exports.CHAR_BACKWARD_SLASH = exports.CHAR_FORWARD_SLASH = exports.CHAR_DOT = exports.CHAR_LOWERCASE_Z = exports.CHAR_UPPERCASE_Z = exports.CHAR_LOWERCASE_A = exports.CHAR_UPPERCASE_A = void 0;
8
- // Alphabet chars.
9
- exports.CHAR_UPPERCASE_A = 65; /* A */
10
- exports.CHAR_LOWERCASE_A = 97; /* a */
11
- exports.CHAR_UPPERCASE_Z = 90; /* Z */
12
- exports.CHAR_LOWERCASE_Z = 122; /* z */
13
- // Non-alphabetic chars.
14
- exports.CHAR_DOT = 46; /* . */
15
- exports.CHAR_FORWARD_SLASH = 47; /* / */
16
- exports.CHAR_BACKWARD_SLASH = 92; /* \ */
17
- exports.CHAR_VERTICAL_LINE = 124; /* | */
18
- exports.CHAR_COLON = 58; /* : */
19
- exports.CHAR_QUESTION_MARK = 63; /* ? */
20
- exports.CHAR_UNDERSCORE = 95; /* _ */
21
- exports.CHAR_LINE_FEED = 10; /* \n */
22
- exports.CHAR_CARRIAGE_RETURN = 13; /* \r */
23
- exports.CHAR_TAB = 9; /* \t */
24
- exports.CHAR_FORM_FEED = 12; /* \f */
25
- exports.CHAR_EXCLAMATION_MARK = 33; /* ! */
26
- exports.CHAR_HASH = 35; /* # */
27
- exports.CHAR_SPACE = 32; /* */
28
- exports.CHAR_NO_BREAK_SPACE = 160; /* \u00A0 */
29
- exports.CHAR_ZERO_WIDTH_NOBREAK_SPACE = 65279; /* \uFEFF */
30
- exports.CHAR_LEFT_SQUARE_BRACKET = 91; /* [ */
31
- exports.CHAR_RIGHT_SQUARE_BRACKET = 93; /* ] */
32
- exports.CHAR_LEFT_ANGLE_BRACKET = 60; /* < */
33
- exports.CHAR_RIGHT_ANGLE_BRACKET = 62; /* > */
34
- exports.CHAR_LEFT_CURLY_BRACKET = 123; /* { */
35
- exports.CHAR_RIGHT_CURLY_BRACKET = 125; /* } */
36
- exports.CHAR_HYPHEN_MINUS = 45; /* - */
37
- exports.CHAR_PLUS = 43; /* + */
38
- exports.CHAR_DOUBLE_QUOTE = 34; /* " */
39
- exports.CHAR_SINGLE_QUOTE = 39; /* ' */
40
- exports.CHAR_PERCENT = 37; /* % */
41
- exports.CHAR_SEMICOLON = 59; /* ; */
42
- exports.CHAR_CIRCUMFLEX_ACCENT = 94; /* ^ */
43
- exports.CHAR_GRAVE_ACCENT = 96; /* ` */
44
- exports.CHAR_AT = 64; /* @ */
45
- exports.CHAR_AMPERSAND = 38; /* & */
46
- exports.CHAR_EQUAL = 61; /* = */
47
- // Digits
48
- exports.CHAR_0 = 48; /* 0 */
49
- exports.CHAR_9 = 57; /* 9 */
@@ -1,11 +0,0 @@
1
- "use strict";
2
- // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
3
- // This module is browser compatible.
4
- Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.assertArg = assertArg;
6
- const assert_path_js_1 = require("./assert_path.js");
7
- function assertArg(path) {
8
- (0, assert_path_js_1.assertPath)(path);
9
- if (path.length === 0)
10
- return ".";
11
- }
@@ -1,11 +0,0 @@
1
- "use strict";
2
- // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
3
- // This module is browser compatible.
4
- Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.assertArg = assertArg;
6
- const assert_path_js_1 = require("./assert_path.js");
7
- function assertArg(path) {
8
- (0, assert_path_js_1.assertPath)(path);
9
- if (path.length === 0)
10
- return ".";
11
- }
@@ -1,12 +0,0 @@
1
- "use strict";
2
- // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
3
- // This module is browser compatible.
4
- Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.assertArgs = assertArgs;
6
- const assert_path_js_1 = require("./assert_path.js");
7
- function assertArgs(from, to) {
8
- (0, assert_path_js_1.assertPath)(from);
9
- (0, assert_path_js_1.assertPath)(to);
10
- if (from === to)
11
- return "";
12
- }
@@ -1,40 +0,0 @@
1
- "use strict";
2
- // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
3
- // This module is browser compatible.
4
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
5
- if (k2 === undefined) k2 = k;
6
- var desc = Object.getOwnPropertyDescriptor(m, k);
7
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
8
- desc = { enumerable: true, get: function() { return m[k]; } };
9
- }
10
- Object.defineProperty(o, k2, desc);
11
- }) : (function(o, m, k, k2) {
12
- if (k2 === undefined) k2 = k;
13
- o[k2] = m[k];
14
- }));
15
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
16
- Object.defineProperty(o, "default", { enumerable: true, value: v });
17
- }) : function(o, v) {
18
- o["default"] = v;
19
- });
20
- var __importStar = (this && this.__importStar) || function (mod) {
21
- if (mod && mod.__esModule) return mod;
22
- var result = {};
23
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
24
- __setModuleDefault(result, mod);
25
- return result;
26
- };
27
- Object.defineProperty(exports, "__esModule", { value: true });
28
- exports.isWindows = void 0;
29
- // Keep this up-to-date with Deno.build.os
30
- /**
31
- * Operating system type, equivalent to the type of
32
- * {@linkcode https://deno.land/api?s=Deno.build | Deno.build.os}.
33
- */
34
- const dntShim = __importStar(require("../../../../../_dnt.shims.js"));
35
- function getOsType() {
36
- // deno-lint-ignore no-explicit-any
37
- return dntShim.dntGlobalThis.Deno?.build.os ||
38
- (navigator.userAgent.includes("Win") ? "windows" : "linux");
39
- }
40
- exports.isWindows = getOsType() === "windows";
@@ -1,70 +0,0 @@
1
- "use strict";
2
- // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
3
- // Copyright the Browserify authors. MIT License.
4
- // Ported mostly from https://github.com/browserify/path-browserify/
5
- // This module is browser compatible.
6
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
7
- if (k2 === undefined) k2 = k;
8
- var desc = Object.getOwnPropertyDescriptor(m, k);
9
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
10
- desc = { enumerable: true, get: function() { return m[k]; } };
11
- }
12
- Object.defineProperty(o, k2, desc);
13
- }) : (function(o, m, k, k2) {
14
- if (k2 === undefined) k2 = k;
15
- o[k2] = m[k];
16
- }));
17
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
18
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
19
- };
20
- Object.defineProperty(exports, "__esModule", { value: true });
21
- /**
22
- * Utilities for working with OS-specific file paths.
23
- *
24
- * Functions from this module will automatically switch to support the path style
25
- * of the current OS, either `windows` for Microsoft Windows, or `posix` for
26
- * every other operating system, eg. Linux, MacOS, BSD etc.
27
- *
28
- * To use functions for a specific path style regardless of the current OS
29
- * import the modules from the platform sub directory instead.
30
- *
31
- * Example, for POSIX:
32
- *
33
- * ```ts
34
- * import { fromFileUrl } from "@std/path/posix/from-file-url";
35
- * import { assertEquals } from "@std/assert";
36
- *
37
- * assertEquals(fromFileUrl("file:///home/foo"), "/home/foo");
38
- * ```
39
- *
40
- * Or, for Windows:
41
- *
42
- * ```ts
43
- * import { fromFileUrl } from "@std/path/windows/from-file-url";
44
- * import { assertEquals } from "@std/assert";
45
- *
46
- * assertEquals(fromFileUrl("file:///home/foo"), "\\home\\foo");
47
- * ```
48
- *
49
- * @module
50
- */
51
- __exportStar(require("./basename.js"), exports);
52
- __exportStar(require("./constants.js"), exports);
53
- __exportStar(require("./dirname.js"), exports);
54
- __exportStar(require("./extname.js"), exports);
55
- __exportStar(require("./format.js"), exports);
56
- __exportStar(require("./from_file_url.js"), exports);
57
- __exportStar(require("./is_absolute.js"), exports);
58
- __exportStar(require("./join.js"), exports);
59
- __exportStar(require("./normalize.js"), exports);
60
- __exportStar(require("./parse.js"), exports);
61
- __exportStar(require("./relative.js"), exports);
62
- __exportStar(require("./resolve.js"), exports);
63
- __exportStar(require("./to_file_url.js"), exports);
64
- __exportStar(require("./to_namespaced_path.js"), exports);
65
- __exportStar(require("./common.js"), exports);
66
- __exportStar(require("./types.js"), exports);
67
- __exportStar(require("./glob_to_regexp.js"), exports);
68
- __exportStar(require("./is_glob.js"), exports);
69
- __exportStar(require("./join_globs.js"), exports);
70
- __exportStar(require("./normalize_glob.js"), exports);
@@ -1,11 +0,0 @@
1
- "use strict";
2
- // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
3
- // Copyright the Browserify authors. MIT License.
4
- // Ported from https://github.com/browserify/path-browserify/
5
- // This module is browser compatible.
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.isPosixPathSeparator = isPosixPathSeparator;
8
- const constants_js_1 = require("../_common/constants.js");
9
- function isPosixPathSeparator(code) {
10
- return code === constants_js_1.CHAR_FORWARD_SLASH;
11
- }
@@ -1,85 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.resolve = resolve;
27
- // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
28
- // This module is browser compatible.
29
- const dntShim = __importStar(require("../../../../../../_dnt.shims.js"));
30
- const normalize_string_js_1 = require("../_common/normalize_string.js");
31
- const assert_path_js_1 = require("../_common/assert_path.js");
32
- const _util_js_1 = require("./_util.js");
33
- /**
34
- * Resolves path segments into a `path`.
35
- *
36
- * @example Usage
37
- * ```ts
38
- * import { resolve } from "@std/path/posix/resolve";
39
- * import { assertEquals } from "@std/assert";
40
- *
41
- * const path = resolve("/foo", "bar", "baz/asdf", "quux", "..");
42
- * assertEquals(path, "/foo/bar/baz/asdf");
43
- * ```
44
- *
45
- * @param pathSegments The path segments to resolve.
46
- * @returns The resolved path.
47
- */
48
- function resolve(...pathSegments) {
49
- let resolvedPath = "";
50
- let resolvedAbsolute = false;
51
- for (let i = pathSegments.length - 1; i >= -1 && !resolvedAbsolute; i--) {
52
- let path;
53
- if (i >= 0)
54
- path = pathSegments[i];
55
- else {
56
- // deno-lint-ignore no-explicit-any
57
- const { Deno } = dntShim.dntGlobalThis;
58
- if (typeof Deno?.cwd !== "function") {
59
- throw new TypeError("Resolved a relative path without a CWD.");
60
- }
61
- path = Deno.cwd();
62
- }
63
- (0, assert_path_js_1.assertPath)(path);
64
- // Skip empty entries
65
- if (path.length === 0) {
66
- continue;
67
- }
68
- resolvedPath = `${path}/${resolvedPath}`;
69
- resolvedAbsolute = (0, _util_js_1.isPosixPathSeparator)(path.charCodeAt(0));
70
- }
71
- // At this point the path should be resolved to a full absolute path, but
72
- // handle relative paths to be safe (might happen when Deno.cwd() fails)
73
- // Normalize the path
74
- resolvedPath = (0, normalize_string_js_1.normalizeString)(resolvedPath, !resolvedAbsolute, "/", _util_js_1.isPosixPathSeparator);
75
- if (resolvedAbsolute) {
76
- if (resolvedPath.length > 0)
77
- return `/${resolvedPath}`;
78
- else
79
- return "/";
80
- }
81
- else if (resolvedPath.length > 0)
82
- return resolvedPath;
83
- else
84
- return ".";
85
- }
@@ -1,20 +0,0 @@
1
- "use strict";
2
- // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
3
- // Copyright the Browserify authors. MIT License.
4
- // Ported from https://github.com/browserify/path-browserify/
5
- // This module is browser compatible.
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.isPosixPathSeparator = isPosixPathSeparator;
8
- exports.isPathSeparator = isPathSeparator;
9
- exports.isWindowsDeviceRoot = isWindowsDeviceRoot;
10
- const constants_js_1 = require("../_common/constants.js");
11
- function isPosixPathSeparator(code) {
12
- return code === constants_js_1.CHAR_FORWARD_SLASH;
13
- }
14
- function isPathSeparator(code) {
15
- return code === constants_js_1.CHAR_FORWARD_SLASH || code === constants_js_1.CHAR_BACKWARD_SLASH;
16
- }
17
- function isWindowsDeviceRoot(code) {
18
- return ((code >= constants_js_1.CHAR_LOWERCASE_A && code <= constants_js_1.CHAR_LOWERCASE_Z) ||
19
- (code >= constants_js_1.CHAR_UPPERCASE_A && code <= constants_js_1.CHAR_UPPERCASE_Z));
20
- }