staticalize 0.2.2

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 (433) hide show
  1. package/README.md +43 -0
  2. package/esm/_dnt.polyfills.d.ts +117 -0
  3. package/esm/_dnt.polyfills.d.ts.map +1 -0
  4. package/esm/_dnt.polyfills.js +144 -0
  5. package/esm/_dnt.polyfills.js.map +1 -0
  6. package/esm/_dnt.shims.d.ts +6 -0
  7. package/esm/_dnt.shims.d.ts.map +1 -0
  8. package/esm/_dnt.shims.js +62 -0
  9. package/esm/_dnt.shims.js.map +1 -0
  10. package/esm/config.d.ts +6 -0
  11. package/esm/config.d.ts.map +1 -0
  12. package/esm/config.js +25 -0
  13. package/esm/config.js.map +1 -0
  14. package/esm/deno.d.ts +45 -0
  15. package/esm/deno.d.ts.map +1 -0
  16. package/esm/deno.js +43 -0
  17. package/esm/deno.js.map +1 -0
  18. package/esm/deps/jsr.io/@libs/xml/6.0.8/_types.d.ts +48 -0
  19. package/esm/deps/jsr.io/@libs/xml/6.0.8/_types.d.ts.map +1 -0
  20. package/esm/deps/jsr.io/@libs/xml/6.0.8/_types.js +2 -0
  21. package/esm/deps/jsr.io/@libs/xml/6.0.8/_types.js.map +1 -0
  22. package/esm/deps/jsr.io/@libs/xml/6.0.8/parse.d.ts +127 -0
  23. package/esm/deps/jsr.io/@libs/xml/6.0.8/parse.d.ts.map +1 -0
  24. package/esm/deps/jsr.io/@libs/xml/6.0.8/parse.js +383 -0
  25. package/esm/deps/jsr.io/@libs/xml/6.0.8/parse.js.map +1 -0
  26. package/esm/deps/jsr.io/@libs/xml/6.0.8/stringify.d.ts +93 -0
  27. package/esm/deps/jsr.io/@libs/xml/6.0.8/stringify.d.ts.map +1 -0
  28. package/esm/deps/jsr.io/@libs/xml/6.0.8/stringify.js +262 -0
  29. package/esm/deps/jsr.io/@libs/xml/6.0.8/stringify.js.map +1 -0
  30. package/esm/deps/jsr.io/@libs/xml/6.0.8/wasm_xml_parser/wasm_xml_parser.d.ts +37 -0
  31. package/esm/deps/jsr.io/@libs/xml/6.0.8/wasm_xml_parser/wasm_xml_parser.d.ts.map +1 -0
  32. package/esm/deps/jsr.io/@libs/xml/6.0.8/wasm_xml_parser/wasm_xml_parser.js +90 -0
  33. package/esm/deps/jsr.io/@libs/xml/6.0.8/wasm_xml_parser/wasm_xml_parser.js.map +1 -0
  34. package/esm/deps/jsr.io/@std/fs/1.0.22/_get_file_info_type.d.ts +13 -0
  35. package/esm/deps/jsr.io/@std/fs/1.0.22/_get_file_info_type.d.ts.map +1 -0
  36. package/esm/deps/jsr.io/@std/fs/1.0.22/_get_file_info_type.js +19 -0
  37. package/esm/deps/jsr.io/@std/fs/1.0.22/_get_file_info_type.js.map +1 -0
  38. package/esm/deps/jsr.io/@std/fs/1.0.22/ensure_dir.d.ts +49 -0
  39. package/esm/deps/jsr.io/@std/fs/1.0.22/ensure_dir.d.ts.map +1 -0
  40. package/esm/deps/jsr.io/@std/fs/1.0.22/ensure_dir.js +103 -0
  41. package/esm/deps/jsr.io/@std/fs/1.0.22/ensure_dir.js.map +1 -0
  42. package/esm/deps/jsr.io/@std/internal/1.0.12/_os.d.ts +2 -0
  43. package/esm/deps/jsr.io/@std/internal/1.0.12/_os.d.ts.map +1 -0
  44. package/esm/deps/jsr.io/@std/internal/1.0.12/_os.js +13 -0
  45. package/esm/deps/jsr.io/@std/internal/1.0.12/_os.js.map +1 -0
  46. package/esm/deps/jsr.io/@std/internal/1.0.12/os.d.ts +3 -0
  47. package/esm/deps/jsr.io/@std/internal/1.0.12/os.d.ts.map +1 -0
  48. package/esm/deps/jsr.io/@std/internal/1.0.12/os.js +6 -0
  49. package/esm/deps/jsr.io/@std/internal/1.0.12/os.js.map +1 -0
  50. package/esm/deps/jsr.io/@std/path/1.1.4/_common/assert_path.d.ts +2 -0
  51. package/esm/deps/jsr.io/@std/path/1.1.4/_common/assert_path.d.ts.map +1 -0
  52. package/esm/deps/jsr.io/@std/path/1.1.4/_common/assert_path.js +8 -0
  53. package/esm/deps/jsr.io/@std/path/1.1.4/_common/assert_path.js.map +1 -0
  54. package/esm/deps/jsr.io/@std/path/1.1.4/_common/basename.d.ts +4 -0
  55. package/esm/deps/jsr.io/@std/path/1.1.4/_common/basename.d.ts.map +1 -0
  56. package/esm/deps/jsr.io/@std/path/1.1.4/_common/basename.js +41 -0
  57. package/esm/deps/jsr.io/@std/path/1.1.4/_common/basename.js.map +1 -0
  58. package/esm/deps/jsr.io/@std/path/1.1.4/_common/common.d.ts +2 -0
  59. package/esm/deps/jsr.io/@std/path/1.1.4/_common/common.d.ts.map +1 -0
  60. package/esm/deps/jsr.io/@std/path/1.1.4/_common/common.js +24 -0
  61. package/esm/deps/jsr.io/@std/path/1.1.4/_common/common.js.map +1 -0
  62. package/esm/deps/jsr.io/@std/path/1.1.4/_common/constants.d.ts +40 -0
  63. package/esm/deps/jsr.io/@std/path/1.1.4/_common/constants.d.ts.map +1 -0
  64. package/esm/deps/jsr.io/@std/path/1.1.4/_common/constants.js +47 -0
  65. package/esm/deps/jsr.io/@std/path/1.1.4/_common/constants.js.map +1 -0
  66. package/esm/deps/jsr.io/@std/path/1.1.4/_common/dirname.d.ts +2 -0
  67. package/esm/deps/jsr.io/@std/path/1.1.4/_common/dirname.d.ts.map +1 -0
  68. package/esm/deps/jsr.io/@std/path/1.1.4/_common/dirname.js +9 -0
  69. package/esm/deps/jsr.io/@std/path/1.1.4/_common/dirname.js.map +1 -0
  70. package/esm/deps/jsr.io/@std/path/1.1.4/_common/format.d.ts +4 -0
  71. package/esm/deps/jsr.io/@std/path/1.1.4/_common/format.d.ts.map +1 -0
  72. package/esm/deps/jsr.io/@std/path/1.1.4/_common/format.js +20 -0
  73. package/esm/deps/jsr.io/@std/path/1.1.4/_common/format.js.map +1 -0
  74. package/esm/deps/jsr.io/@std/path/1.1.4/_common/from_file_url.d.ts +2 -0
  75. package/esm/deps/jsr.io/@std/path/1.1.4/_common/from_file_url.d.ts.map +1 -0
  76. package/esm/deps/jsr.io/@std/path/1.1.4/_common/from_file_url.js +10 -0
  77. package/esm/deps/jsr.io/@std/path/1.1.4/_common/from_file_url.js.map +1 -0
  78. package/esm/deps/jsr.io/@std/path/1.1.4/_common/glob_to_reg_exp.d.ts +35 -0
  79. package/esm/deps/jsr.io/@std/path/1.1.4/_common/glob_to_reg_exp.d.ts.map +1 -0
  80. package/esm/deps/jsr.io/@std/path/1.1.4/_common/glob_to_reg_exp.js +236 -0
  81. package/esm/deps/jsr.io/@std/path/1.1.4/_common/glob_to_reg_exp.js.map +1 -0
  82. package/esm/deps/jsr.io/@std/path/1.1.4/_common/normalize.d.ts +2 -0
  83. package/esm/deps/jsr.io/@std/path/1.1.4/_common/normalize.d.ts.map +1 -0
  84. package/esm/deps/jsr.io/@std/path/1.1.4/_common/normalize.js +9 -0
  85. package/esm/deps/jsr.io/@std/path/1.1.4/_common/normalize.js.map +1 -0
  86. package/esm/deps/jsr.io/@std/path/1.1.4/_common/normalize_string.d.ts +2 -0
  87. package/esm/deps/jsr.io/@std/path/1.1.4/_common/normalize_string.d.ts.map +1 -0
  88. package/esm/deps/jsr.io/@std/path/1.1.4/_common/normalize_string.js +78 -0
  89. package/esm/deps/jsr.io/@std/path/1.1.4/_common/normalize_string.js.map +1 -0
  90. package/esm/deps/jsr.io/@std/path/1.1.4/_common/relative.d.ts +2 -0
  91. package/esm/deps/jsr.io/@std/path/1.1.4/_common/relative.d.ts.map +1 -0
  92. package/esm/deps/jsr.io/@std/path/1.1.4/_common/relative.js +10 -0
  93. package/esm/deps/jsr.io/@std/path/1.1.4/_common/relative.js.map +1 -0
  94. package/esm/deps/jsr.io/@std/path/1.1.4/_common/strip_trailing_separators.d.ts +2 -0
  95. package/esm/deps/jsr.io/@std/path/1.1.4/_common/strip_trailing_separators.d.ts.map +1 -0
  96. package/esm/deps/jsr.io/@std/path/1.1.4/_common/strip_trailing_separators.js +20 -0
  97. package/esm/deps/jsr.io/@std/path/1.1.4/_common/strip_trailing_separators.js.map +1 -0
  98. package/esm/deps/jsr.io/@std/path/1.1.4/_common/to_file_url.d.ts +2 -0
  99. package/esm/deps/jsr.io/@std/path/1.1.4/_common/to_file_url.d.ts.map +1 -0
  100. package/esm/deps/jsr.io/@std/path/1.1.4/_common/to_file_url.js +16 -0
  101. package/esm/deps/jsr.io/@std/path/1.1.4/_common/to_file_url.js.map +1 -0
  102. package/esm/deps/jsr.io/@std/path/1.1.4/basename.d.ts +27 -0
  103. package/esm/deps/jsr.io/@std/path/1.1.4/basename.d.ts.map +1 -0
  104. package/esm/deps/jsr.io/@std/path/1.1.4/basename.js +36 -0
  105. package/esm/deps/jsr.io/@std/path/1.1.4/basename.js.map +1 -0
  106. package/esm/deps/jsr.io/@std/path/1.1.4/common.d.ts +28 -0
  107. package/esm/deps/jsr.io/@std/path/1.1.4/common.d.ts.map +1 -0
  108. package/esm/deps/jsr.io/@std/path/1.1.4/common.js +34 -0
  109. package/esm/deps/jsr.io/@std/path/1.1.4/common.js.map +1 -0
  110. package/esm/deps/jsr.io/@std/path/1.1.4/constants.d.ts +15 -0
  111. package/esm/deps/jsr.io/@std/path/1.1.4/constants.d.ts.map +1 -0
  112. package/esm/deps/jsr.io/@std/path/1.1.4/constants.js +18 -0
  113. package/esm/deps/jsr.io/@std/path/1.1.4/constants.js.map +1 -0
  114. package/esm/deps/jsr.io/@std/path/1.1.4/dirname.d.ts +22 -0
  115. package/esm/deps/jsr.io/@std/path/1.1.4/dirname.d.ts.map +1 -0
  116. package/esm/deps/jsr.io/@std/path/1.1.4/dirname.js +29 -0
  117. package/esm/deps/jsr.io/@std/path/1.1.4/dirname.js.map +1 -0
  118. package/esm/deps/jsr.io/@std/path/1.1.4/extname.d.ts +22 -0
  119. package/esm/deps/jsr.io/@std/path/1.1.4/extname.d.ts.map +1 -0
  120. package/esm/deps/jsr.io/@std/path/1.1.4/extname.js +29 -0
  121. package/esm/deps/jsr.io/@std/path/1.1.4/extname.js.map +1 -0
  122. package/esm/deps/jsr.io/@std/path/1.1.4/format.d.ts +22 -0
  123. package/esm/deps/jsr.io/@std/path/1.1.4/format.d.ts.map +1 -0
  124. package/esm/deps/jsr.io/@std/path/1.1.4/format.js +28 -0
  125. package/esm/deps/jsr.io/@std/path/1.1.4/format.js.map +1 -0
  126. package/esm/deps/jsr.io/@std/path/1.1.4/from_file_url.d.ts +22 -0
  127. package/esm/deps/jsr.io/@std/path/1.1.4/from_file_url.d.ts.map +1 -0
  128. package/esm/deps/jsr.io/@std/path/1.1.4/from_file_url.js +29 -0
  129. package/esm/deps/jsr.io/@std/path/1.1.4/from_file_url.js.map +1 -0
  130. package/esm/deps/jsr.io/@std/path/1.1.4/glob_to_regexp.d.ts +77 -0
  131. package/esm/deps/jsr.io/@std/path/1.1.4/glob_to_regexp.d.ts.map +1 -0
  132. package/esm/deps/jsr.io/@std/path/1.1.4/glob_to_regexp.js +84 -0
  133. package/esm/deps/jsr.io/@std/path/1.1.4/glob_to_regexp.js.map +1 -0
  134. package/esm/deps/jsr.io/@std/path/1.1.4/is_absolute.d.ts +22 -0
  135. package/esm/deps/jsr.io/@std/path/1.1.4/is_absolute.d.ts.map +1 -0
  136. package/esm/deps/jsr.io/@std/path/1.1.4/is_absolute.js +29 -0
  137. package/esm/deps/jsr.io/@std/path/1.1.4/is_absolute.js.map +1 -0
  138. package/esm/deps/jsr.io/@std/path/1.1.4/is_glob.d.ts +17 -0
  139. package/esm/deps/jsr.io/@std/path/1.1.4/is_glob.d.ts.map +1 -0
  140. package/esm/deps/jsr.io/@std/path/1.1.4/is_glob.js +43 -0
  141. package/esm/deps/jsr.io/@std/path/1.1.4/is_glob.js.map +1 -0
  142. package/esm/deps/jsr.io/@std/path/1.1.4/join.d.ts +23 -0
  143. package/esm/deps/jsr.io/@std/path/1.1.4/join.d.ts.map +1 -0
  144. package/esm/deps/jsr.io/@std/path/1.1.4/join.js +30 -0
  145. package/esm/deps/jsr.io/@std/path/1.1.4/join.js.map +1 -0
  146. package/esm/deps/jsr.io/@std/path/1.1.4/join_globs.d.ts +28 -0
  147. package/esm/deps/jsr.io/@std/path/1.1.4/join_globs.d.ts.map +1 -0
  148. package/esm/deps/jsr.io/@std/path/1.1.4/join_globs.js +35 -0
  149. package/esm/deps/jsr.io/@std/path/1.1.4/join_globs.js.map +1 -0
  150. package/esm/deps/jsr.io/@std/path/1.1.4/mod.d.ts +213 -0
  151. package/esm/deps/jsr.io/@std/path/1.1.4/mod.d.ts.map +1 -0
  152. package/esm/deps/jsr.io/@std/path/1.1.4/mod.js +217 -0
  153. package/esm/deps/jsr.io/@std/path/1.1.4/mod.js.map +1 -0
  154. package/esm/deps/jsr.io/@std/path/1.1.4/normalize.d.ts +26 -0
  155. package/esm/deps/jsr.io/@std/path/1.1.4/normalize.d.ts.map +1 -0
  156. package/esm/deps/jsr.io/@std/path/1.1.4/normalize.js +33 -0
  157. package/esm/deps/jsr.io/@std/path/1.1.4/normalize.js.map +1 -0
  158. package/esm/deps/jsr.io/@std/path/1.1.4/normalize_glob.d.ts +29 -0
  159. package/esm/deps/jsr.io/@std/path/1.1.4/normalize_glob.d.ts.map +1 -0
  160. package/esm/deps/jsr.io/@std/path/1.1.4/normalize_glob.js +36 -0
  161. package/esm/deps/jsr.io/@std/path/1.1.4/normalize_glob.js.map +1 -0
  162. package/esm/deps/jsr.io/@std/path/1.1.4/parse.d.ts +35 -0
  163. package/esm/deps/jsr.io/@std/path/1.1.4/parse.d.ts.map +1 -0
  164. package/esm/deps/jsr.io/@std/path/1.1.4/parse.js +40 -0
  165. package/esm/deps/jsr.io/@std/path/1.1.4/parse.js.map +1 -0
  166. package/esm/deps/jsr.io/@std/path/1.1.4/posix/_util.d.ts +2 -0
  167. package/esm/deps/jsr.io/@std/path/1.1.4/posix/_util.d.ts.map +1 -0
  168. package/esm/deps/jsr.io/@std/path/1.1.4/posix/_util.js +9 -0
  169. package/esm/deps/jsr.io/@std/path/1.1.4/posix/_util.js.map +1 -0
  170. package/esm/deps/jsr.io/@std/path/1.1.4/posix/basename.d.ts +39 -0
  171. package/esm/deps/jsr.io/@std/path/1.1.4/posix/basename.d.ts.map +1 -0
  172. package/esm/deps/jsr.io/@std/path/1.1.4/posix/basename.js +53 -0
  173. package/esm/deps/jsr.io/@std/path/1.1.4/posix/basename.js.map +1 -0
  174. package/esm/deps/jsr.io/@std/path/1.1.4/posix/constants.d.ts +13 -0
  175. package/esm/deps/jsr.io/@std/path/1.1.4/posix/constants.d.ts.map +1 -0
  176. package/esm/deps/jsr.io/@std/path/1.1.4/posix/constants.js +15 -0
  177. package/esm/deps/jsr.io/@std/path/1.1.4/posix/constants.js.map +1 -0
  178. package/esm/deps/jsr.io/@std/path/1.1.4/posix/dirname.d.ts +30 -0
  179. package/esm/deps/jsr.io/@std/path/1.1.4/posix/dirname.d.ts.map +1 -0
  180. package/esm/deps/jsr.io/@std/path/1.1.4/posix/dirname.js +65 -0
  181. package/esm/deps/jsr.io/@std/path/1.1.4/posix/dirname.js.map +1 -0
  182. package/esm/deps/jsr.io/@std/path/1.1.4/posix/extname.d.ts +37 -0
  183. package/esm/deps/jsr.io/@std/path/1.1.4/posix/extname.d.ts.map +1 -0
  184. package/esm/deps/jsr.io/@std/path/1.1.4/posix/extname.js +94 -0
  185. package/esm/deps/jsr.io/@std/path/1.1.4/posix/extname.js.map +1 -0
  186. package/esm/deps/jsr.io/@std/path/1.1.4/posix/format.d.ts +24 -0
  187. package/esm/deps/jsr.io/@std/path/1.1.4/posix/format.d.ts.map +1 -0
  188. package/esm/deps/jsr.io/@std/path/1.1.4/posix/format.js +29 -0
  189. package/esm/deps/jsr.io/@std/path/1.1.4/posix/format.js.map +1 -0
  190. package/esm/deps/jsr.io/@std/path/1.1.4/posix/from_file_url.d.ts +16 -0
  191. package/esm/deps/jsr.io/@std/path/1.1.4/posix/from_file_url.d.ts.map +1 -0
  192. package/esm/deps/jsr.io/@std/path/1.1.4/posix/from_file_url.js +22 -0
  193. package/esm/deps/jsr.io/@std/path/1.1.4/posix/from_file_url.js.map +1 -0
  194. package/esm/deps/jsr.io/@std/path/1.1.4/posix/glob_to_regexp.d.ts +72 -0
  195. package/esm/deps/jsr.io/@std/path/1.1.4/posix/glob_to_regexp.d.ts.map +1 -0
  196. package/esm/deps/jsr.io/@std/path/1.1.4/posix/glob_to_regexp.js +83 -0
  197. package/esm/deps/jsr.io/@std/path/1.1.4/posix/glob_to_regexp.js.map +1 -0
  198. package/esm/deps/jsr.io/@std/path/1.1.4/posix/is_absolute.d.ts +17 -0
  199. package/esm/deps/jsr.io/@std/path/1.1.4/posix/is_absolute.d.ts.map +1 -0
  200. package/esm/deps/jsr.io/@std/path/1.1.4/posix/is_absolute.js +24 -0
  201. package/esm/deps/jsr.io/@std/path/1.1.4/posix/is_absolute.js.map +1 -0
  202. package/esm/deps/jsr.io/@std/path/1.1.4/posix/join.d.ts +31 -0
  203. package/esm/deps/jsr.io/@std/path/1.1.4/posix/join.d.ts.map +1 -0
  204. package/esm/deps/jsr.io/@std/path/1.1.4/posix/join.js +46 -0
  205. package/esm/deps/jsr.io/@std/path/1.1.4/posix/join.js.map +1 -0
  206. package/esm/deps/jsr.io/@std/path/1.1.4/posix/join_globs.d.ts +20 -0
  207. package/esm/deps/jsr.io/@std/path/1.1.4/posix/join_globs.d.ts.map +1 -0
  208. package/esm/deps/jsr.io/@std/path/1.1.4/posix/join_globs.js +41 -0
  209. package/esm/deps/jsr.io/@std/path/1.1.4/posix/join_globs.js.map +1 -0
  210. package/esm/deps/jsr.io/@std/path/1.1.4/posix/normalize.d.ts +37 -0
  211. package/esm/deps/jsr.io/@std/path/1.1.4/posix/normalize.d.ts.map +1 -0
  212. package/esm/deps/jsr.io/@std/path/1.1.4/posix/normalize.js +59 -0
  213. package/esm/deps/jsr.io/@std/path/1.1.4/posix/normalize.js.map +1 -0
  214. package/esm/deps/jsr.io/@std/path/1.1.4/posix/normalize_glob.d.ts +20 -0
  215. package/esm/deps/jsr.io/@std/path/1.1.4/posix/normalize_glob.d.ts.map +1 -0
  216. package/esm/deps/jsr.io/@std/path/1.1.4/posix/normalize_glob.js +33 -0
  217. package/esm/deps/jsr.io/@std/path/1.1.4/posix/normalize_glob.js.map +1 -0
  218. package/esm/deps/jsr.io/@std/path/1.1.4/posix/parse.d.ts +25 -0
  219. package/esm/deps/jsr.io/@std/path/1.1.4/posix/parse.d.ts.map +1 -0
  220. package/esm/deps/jsr.io/@std/path/1.1.4/posix/parse.js +116 -0
  221. package/esm/deps/jsr.io/@std/path/1.1.4/posix/parse.js.map +1 -0
  222. package/esm/deps/jsr.io/@std/path/1.1.4/posix/relative.d.ts +20 -0
  223. package/esm/deps/jsr.io/@std/path/1.1.4/posix/relative.d.ts.map +1 -0
  224. package/esm/deps/jsr.io/@std/path/1.1.4/posix/relative.js +107 -0
  225. package/esm/deps/jsr.io/@std/path/1.1.4/posix/relative.js.map +1 -0
  226. package/esm/deps/jsr.io/@std/path/1.1.4/posix/resolve.d.ts +17 -0
  227. package/esm/deps/jsr.io/@std/path/1.1.4/posix/resolve.d.ts.map +1 -0
  228. package/esm/deps/jsr.io/@std/path/1.1.4/posix/resolve.js +60 -0
  229. package/esm/deps/jsr.io/@std/path/1.1.4/posix/resolve.js.map +1 -0
  230. package/esm/deps/jsr.io/@std/path/1.1.4/posix/to_file_url.d.ts +17 -0
  231. package/esm/deps/jsr.io/@std/path/1.1.4/posix/to_file_url.d.ts.map +1 -0
  232. package/esm/deps/jsr.io/@std/path/1.1.4/posix/to_file_url.js +28 -0
  233. package/esm/deps/jsr.io/@std/path/1.1.4/posix/to_file_url.js.map +1 -0
  234. package/esm/deps/jsr.io/@std/path/1.1.4/posix/to_namespaced_path.d.ts +16 -0
  235. package/esm/deps/jsr.io/@std/path/1.1.4/posix/to_namespaced_path.d.ts.map +1 -0
  236. package/esm/deps/jsr.io/@std/path/1.1.4/posix/to_namespaced_path.js +21 -0
  237. package/esm/deps/jsr.io/@std/path/1.1.4/posix/to_namespaced_path.js.map +1 -0
  238. package/esm/deps/jsr.io/@std/path/1.1.4/relative.d.ts +24 -0
  239. package/esm/deps/jsr.io/@std/path/1.1.4/relative.d.ts.map +1 -0
  240. package/esm/deps/jsr.io/@std/path/1.1.4/relative.js +31 -0
  241. package/esm/deps/jsr.io/@std/path/1.1.4/relative.js.map +1 -0
  242. package/esm/deps/jsr.io/@std/path/1.1.4/resolve.d.ts +22 -0
  243. package/esm/deps/jsr.io/@std/path/1.1.4/resolve.d.ts.map +1 -0
  244. package/esm/deps/jsr.io/@std/path/1.1.4/resolve.js +31 -0
  245. package/esm/deps/jsr.io/@std/path/1.1.4/resolve.js.map +1 -0
  246. package/esm/deps/jsr.io/@std/path/1.1.4/to_file_url.d.ts +22 -0
  247. package/esm/deps/jsr.io/@std/path/1.1.4/to_file_url.d.ts.map +1 -0
  248. package/esm/deps/jsr.io/@std/path/1.1.4/to_file_url.js +29 -0
  249. package/esm/deps/jsr.io/@std/path/1.1.4/to_file_url.js.map +1 -0
  250. package/esm/deps/jsr.io/@std/path/1.1.4/to_namespaced_path.d.ts +21 -0
  251. package/esm/deps/jsr.io/@std/path/1.1.4/to_namespaced_path.d.ts.map +1 -0
  252. package/esm/deps/jsr.io/@std/path/1.1.4/to_namespaced_path.js +30 -0
  253. package/esm/deps/jsr.io/@std/path/1.1.4/to_namespaced_path.js.map +1 -0
  254. package/esm/deps/jsr.io/@std/path/1.1.4/types.d.ts +38 -0
  255. package/esm/deps/jsr.io/@std/path/1.1.4/types.d.ts.map +1 -0
  256. package/esm/deps/jsr.io/@std/path/1.1.4/types.js +4 -0
  257. package/esm/deps/jsr.io/@std/path/1.1.4/types.js.map +1 -0
  258. package/esm/deps/jsr.io/@std/path/1.1.4/windows/_util.d.ts +4 -0
  259. package/esm/deps/jsr.io/@std/path/1.1.4/windows/_util.d.ts.map +1 -0
  260. package/esm/deps/jsr.io/@std/path/1.1.4/windows/_util.js +16 -0
  261. package/esm/deps/jsr.io/@std/path/1.1.4/windows/_util.js.map +1 -0
  262. package/esm/deps/jsr.io/@std/path/1.1.4/windows/basename.d.ts +22 -0
  263. package/esm/deps/jsr.io/@std/path/1.1.4/windows/basename.d.ts.map +1 -0
  264. package/esm/deps/jsr.io/@std/path/1.1.4/windows/basename.js +48 -0
  265. package/esm/deps/jsr.io/@std/path/1.1.4/windows/basename.js.map +1 -0
  266. package/esm/deps/jsr.io/@std/path/1.1.4/windows/constants.d.ts +13 -0
  267. package/esm/deps/jsr.io/@std/path/1.1.4/windows/constants.d.ts.map +1 -0
  268. package/esm/deps/jsr.io/@std/path/1.1.4/windows/constants.js +15 -0
  269. package/esm/deps/jsr.io/@std/path/1.1.4/windows/constants.js.map +1 -0
  270. package/esm/deps/jsr.io/@std/path/1.1.4/windows/dirname.d.ts +17 -0
  271. package/esm/deps/jsr.io/@std/path/1.1.4/windows/dirname.d.ts.map +1 -0
  272. package/esm/deps/jsr.io/@std/path/1.1.4/windows/dirname.js +114 -0
  273. package/esm/deps/jsr.io/@std/path/1.1.4/windows/dirname.js.map +1 -0
  274. package/esm/deps/jsr.io/@std/path/1.1.4/windows/extname.d.ts +17 -0
  275. package/esm/deps/jsr.io/@std/path/1.1.4/windows/extname.d.ts.map +1 -0
  276. package/esm/deps/jsr.io/@std/path/1.1.4/windows/extname.js +83 -0
  277. package/esm/deps/jsr.io/@std/path/1.1.4/windows/extname.js.map +1 -0
  278. package/esm/deps/jsr.io/@std/path/1.1.4/windows/format.d.ts +24 -0
  279. package/esm/deps/jsr.io/@std/path/1.1.4/windows/format.d.ts.map +1 -0
  280. package/esm/deps/jsr.io/@std/path/1.1.4/windows/format.js +29 -0
  281. package/esm/deps/jsr.io/@std/path/1.1.4/windows/format.js.map +1 -0
  282. package/esm/deps/jsr.io/@std/path/1.1.4/windows/from_file_url.d.ts +18 -0
  283. package/esm/deps/jsr.io/@std/path/1.1.4/windows/from_file_url.d.ts.map +1 -0
  284. package/esm/deps/jsr.io/@std/path/1.1.4/windows/from_file_url.js +31 -0
  285. package/esm/deps/jsr.io/@std/path/1.1.4/windows/from_file_url.js.map +1 -0
  286. package/esm/deps/jsr.io/@std/path/1.1.4/windows/glob_to_regexp.d.ts +71 -0
  287. package/esm/deps/jsr.io/@std/path/1.1.4/windows/glob_to_regexp.d.ts.map +1 -0
  288. package/esm/deps/jsr.io/@std/path/1.1.4/windows/glob_to_regexp.js +83 -0
  289. package/esm/deps/jsr.io/@std/path/1.1.4/windows/glob_to_regexp.js.map +1 -0
  290. package/esm/deps/jsr.io/@std/path/1.1.4/windows/is_absolute.d.ts +17 -0
  291. package/esm/deps/jsr.io/@std/path/1.1.4/windows/is_absolute.d.ts.map +1 -0
  292. package/esm/deps/jsr.io/@std/path/1.1.4/windows/is_absolute.js +39 -0
  293. package/esm/deps/jsr.io/@std/path/1.1.4/windows/is_absolute.js.map +1 -0
  294. package/esm/deps/jsr.io/@std/path/1.1.4/windows/join.d.ts +18 -0
  295. package/esm/deps/jsr.io/@std/path/1.1.4/windows/join.d.ts.map +1 -0
  296. package/esm/deps/jsr.io/@std/path/1.1.4/windows/join.js +78 -0
  297. package/esm/deps/jsr.io/@std/path/1.1.4/windows/join.js.map +1 -0
  298. package/esm/deps/jsr.io/@std/path/1.1.4/windows/join_globs.d.ts +21 -0
  299. package/esm/deps/jsr.io/@std/path/1.1.4/windows/join_globs.d.ts.map +1 -0
  300. package/esm/deps/jsr.io/@std/path/1.1.4/windows/join_globs.js +42 -0
  301. package/esm/deps/jsr.io/@std/path/1.1.4/windows/join_globs.js.map +1 -0
  302. package/esm/deps/jsr.io/@std/path/1.1.4/windows/normalize.d.ts +19 -0
  303. package/esm/deps/jsr.io/@std/path/1.1.4/windows/normalize.d.ts.map +1 -0
  304. package/esm/deps/jsr.io/@std/path/1.1.4/windows/normalize.js +136 -0
  305. package/esm/deps/jsr.io/@std/path/1.1.4/windows/normalize.js.map +1 -0
  306. package/esm/deps/jsr.io/@std/path/1.1.4/windows/normalize_glob.d.ts +20 -0
  307. package/esm/deps/jsr.io/@std/path/1.1.4/windows/normalize_glob.d.ts.map +1 -0
  308. package/esm/deps/jsr.io/@std/path/1.1.4/windows/normalize_glob.js +33 -0
  309. package/esm/deps/jsr.io/@std/path/1.1.4/windows/normalize_glob.js.map +1 -0
  310. package/esm/deps/jsr.io/@std/path/1.1.4/windows/parse.d.ts +25 -0
  311. package/esm/deps/jsr.io/@std/path/1.1.4/windows/parse.d.ts.map +1 -0
  312. package/esm/deps/jsr.io/@std/path/1.1.4/windows/parse.js +177 -0
  313. package/esm/deps/jsr.io/@std/path/1.1.4/windows/parse.js.map +1 -0
  314. package/esm/deps/jsr.io/@std/path/1.1.4/windows/relative.d.ts +23 -0
  315. package/esm/deps/jsr.io/@std/path/1.1.4/windows/relative.d.ts.map +1 -0
  316. package/esm/deps/jsr.io/@std/path/1.1.4/windows/relative.js +132 -0
  317. package/esm/deps/jsr.io/@std/path/1.1.4/windows/relative.js.map +1 -0
  318. package/esm/deps/jsr.io/@std/path/1.1.4/windows/resolve.d.ts +17 -0
  319. package/esm/deps/jsr.io/@std/path/1.1.4/windows/resolve.d.ts.map +1 -0
  320. package/esm/deps/jsr.io/@std/path/1.1.4/windows/resolve.js +155 -0
  321. package/esm/deps/jsr.io/@std/path/1.1.4/windows/resolve.js.map +1 -0
  322. package/esm/deps/jsr.io/@std/path/1.1.4/windows/to_file_url.d.ts +17 -0
  323. package/esm/deps/jsr.io/@std/path/1.1.4/windows/to_file_url.d.ts.map +1 -0
  324. package/esm/deps/jsr.io/@std/path/1.1.4/windows/to_file_url.js +35 -0
  325. package/esm/deps/jsr.io/@std/path/1.1.4/windows/to_file_url.js.map +1 -0
  326. package/esm/deps/jsr.io/@std/path/1.1.4/windows/to_namespaced_path.d.ts +17 -0
  327. package/esm/deps/jsr.io/@std/path/1.1.4/windows/to_namespaced_path.d.ts.map +1 -0
  328. package/esm/deps/jsr.io/@std/path/1.1.4/windows/to_namespaced_path.js +50 -0
  329. package/esm/deps/jsr.io/@std/path/1.1.4/windows/to_namespaced_path.js.map +1 -0
  330. package/esm/main.d.ts +3 -0
  331. package/esm/main.d.ts.map +1 -0
  332. package/esm/main.js +35 -0
  333. package/esm/main.js.map +1 -0
  334. package/esm/mod.d.ts +3 -0
  335. package/esm/mod.d.ts.map +1 -0
  336. package/esm/mod.js +3 -0
  337. package/esm/mod.js.map +1 -0
  338. package/esm/package.json +3 -0
  339. package/esm/staticalize.d.ts +11 -0
  340. package/esm/staticalize.d.ts.map +1 -0
  341. package/esm/staticalize.js +144 -0
  342. package/esm/staticalize.js.map +1 -0
  343. package/esm/task-buffer.d.ts +6 -0
  344. package/esm/task-buffer.d.ts.map +1 -0
  345. package/esm/task-buffer.js +59 -0
  346. package/esm/task-buffer.js.map +1 -0
  347. package/package.json +41 -0
  348. package/src/_dnt.polyfills.ts +283 -0
  349. package/src/_dnt.shims.ts +64 -0
  350. package/src/config.ts +28 -0
  351. package/src/deno.js +42 -0
  352. package/src/deps/jsr.io/@libs/xml/6.0.8/_types.ts +46 -0
  353. package/src/deps/jsr.io/@libs/xml/6.0.8/parse.ts +443 -0
  354. package/src/deps/jsr.io/@libs/xml/6.0.8/stringify.ts +308 -0
  355. package/src/deps/jsr.io/@libs/xml/6.0.8/wasm_xml_parser/wasm_xml_parser.js +2 -0
  356. package/src/deps/jsr.io/@std/fs/1.0.22/_get_file_info_type.ts +25 -0
  357. package/src/deps/jsr.io/@std/fs/1.0.22/ensure_dir.ts +110 -0
  358. package/src/deps/jsr.io/@std/internal/1.0.12/_os.ts +15 -0
  359. package/src/deps/jsr.io/@std/internal/1.0.12/os.ts +7 -0
  360. package/src/deps/jsr.io/@std/path/1.1.4/_common/assert_path.ts +10 -0
  361. package/src/deps/jsr.io/@std/path/1.1.4/_common/basename.ts +53 -0
  362. package/src/deps/jsr.io/@std/path/1.1.4/_common/common.ts +26 -0
  363. package/src/deps/jsr.io/@std/path/1.1.4/_common/constants.ts +49 -0
  364. package/src/deps/jsr.io/@std/path/1.1.4/_common/dirname.ts +9 -0
  365. package/src/deps/jsr.io/@std/path/1.1.4/_common/format.ts +25 -0
  366. package/src/deps/jsr.io/@std/path/1.1.4/_common/from_file_url.ts +12 -0
  367. package/src/deps/jsr.io/@std/path/1.1.4/_common/glob_to_reg_exp.ts +295 -0
  368. package/src/deps/jsr.io/@std/path/1.1.4/_common/normalize.ts +9 -0
  369. package/src/deps/jsr.io/@std/path/1.1.4/_common/normalize_string.ts +74 -0
  370. package/src/deps/jsr.io/@std/path/1.1.4/_common/relative.ts +10 -0
  371. package/src/deps/jsr.io/@std/path/1.1.4/_common/strip_trailing_separators.ts +25 -0
  372. package/src/deps/jsr.io/@std/path/1.1.4/_common/to_file_url.ts +17 -0
  373. package/src/deps/jsr.io/@std/path/1.1.4/basename.ts +37 -0
  374. package/src/deps/jsr.io/@std/path/1.1.4/common.ts +35 -0
  375. package/src/deps/jsr.io/@std/path/1.1.4/constants.ts +18 -0
  376. package/src/deps/jsr.io/@std/path/1.1.4/dirname.ts +30 -0
  377. package/src/deps/jsr.io/@std/path/1.1.4/extname.ts +29 -0
  378. package/src/deps/jsr.io/@std/path/1.1.4/format.ts +30 -0
  379. package/src/deps/jsr.io/@std/path/1.1.4/from_file_url.ts +30 -0
  380. package/src/deps/jsr.io/@std/path/1.1.4/glob_to_regexp.ts +94 -0
  381. package/src/deps/jsr.io/@std/path/1.1.4/is_absolute.ts +30 -0
  382. package/src/deps/jsr.io/@std/path/1.1.4/is_glob.ts +49 -0
  383. package/src/deps/jsr.io/@std/path/1.1.4/join.ts +31 -0
  384. package/src/deps/jsr.io/@std/path/1.1.4/join_globs.ts +42 -0
  385. package/src/deps/jsr.io/@std/path/1.1.4/mod.ts +217 -0
  386. package/src/deps/jsr.io/@std/path/1.1.4/normalize.ts +33 -0
  387. package/src/deps/jsr.io/@std/path/1.1.4/normalize_glob.ts +45 -0
  388. package/src/deps/jsr.io/@std/path/1.1.4/parse.ts +44 -0
  389. package/src/deps/jsr.io/@std/path/1.1.4/posix/_util.ts +10 -0
  390. package/src/deps/jsr.io/@std/path/1.1.4/posix/basename.ts +62 -0
  391. package/src/deps/jsr.io/@std/path/1.1.4/posix/constants.ts +15 -0
  392. package/src/deps/jsr.io/@std/path/1.1.4/posix/dirname.ts +72 -0
  393. package/src/deps/jsr.io/@std/path/1.1.4/posix/extname.ts +96 -0
  394. package/src/deps/jsr.io/@std/path/1.1.4/posix/format.ts +31 -0
  395. package/src/deps/jsr.io/@std/path/1.1.4/posix/from_file_url.ts +25 -0
  396. package/src/deps/jsr.io/@std/path/1.1.4/posix/glob_to_regexp.ts +94 -0
  397. package/src/deps/jsr.io/@std/path/1.1.4/posix/is_absolute.ts +25 -0
  398. package/src/deps/jsr.io/@std/path/1.1.4/posix/join.ts +46 -0
  399. package/src/deps/jsr.io/@std/path/1.1.4/posix/join_globs.ts +45 -0
  400. package/src/deps/jsr.io/@std/path/1.1.4/posix/normalize.ts +63 -0
  401. package/src/deps/jsr.io/@std/path/1.1.4/posix/normalize_glob.ts +43 -0
  402. package/src/deps/jsr.io/@std/path/1.1.4/posix/parse.ts +121 -0
  403. package/src/deps/jsr.io/@std/path/1.1.4/posix/relative.ts +103 -0
  404. package/src/deps/jsr.io/@std/path/1.1.4/posix/resolve.ts +71 -0
  405. package/src/deps/jsr.io/@std/path/1.1.4/posix/to_file_url.ts +32 -0
  406. package/src/deps/jsr.io/@std/path/1.1.4/posix/to_namespaced_path.ts +21 -0
  407. package/src/deps/jsr.io/@std/path/1.1.4/relative.ts +32 -0
  408. package/src/deps/jsr.io/@std/path/1.1.4/resolve.ts +32 -0
  409. package/src/deps/jsr.io/@std/path/1.1.4/to_file_url.ts +30 -0
  410. package/src/deps/jsr.io/@std/path/1.1.4/to_namespaced_path.ts +31 -0
  411. package/src/deps/jsr.io/@std/path/1.1.4/types.ts +40 -0
  412. package/src/deps/jsr.io/@std/path/1.1.4/windows/_util.ts +28 -0
  413. package/src/deps/jsr.io/@std/path/1.1.4/windows/basename.ts +54 -0
  414. package/src/deps/jsr.io/@std/path/1.1.4/windows/constants.ts +15 -0
  415. package/src/deps/jsr.io/@std/path/1.1.4/windows/dirname.ts +118 -0
  416. package/src/deps/jsr.io/@std/path/1.1.4/windows/extname.ts +90 -0
  417. package/src/deps/jsr.io/@std/path/1.1.4/windows/format.ts +31 -0
  418. package/src/deps/jsr.io/@std/path/1.1.4/windows/from_file_url.ts +34 -0
  419. package/src/deps/jsr.io/@std/path/1.1.4/windows/glob_to_regexp.ts +92 -0
  420. package/src/deps/jsr.io/@std/path/1.1.4/windows/is_absolute.ts +40 -0
  421. package/src/deps/jsr.io/@std/path/1.1.4/windows/join.ts +78 -0
  422. package/src/deps/jsr.io/@std/path/1.1.4/windows/join_globs.ts +46 -0
  423. package/src/deps/jsr.io/@std/path/1.1.4/windows/normalize.ts +136 -0
  424. package/src/deps/jsr.io/@std/path/1.1.4/windows/normalize_glob.ts +43 -0
  425. package/src/deps/jsr.io/@std/path/1.1.4/windows/parse.ts +184 -0
  426. package/src/deps/jsr.io/@std/path/1.1.4/windows/relative.ts +128 -0
  427. package/src/deps/jsr.io/@std/path/1.1.4/windows/resolve.ts +178 -0
  428. package/src/deps/jsr.io/@std/path/1.1.4/windows/to_file_url.ts +38 -0
  429. package/src/deps/jsr.io/@std/path/1.1.4/windows/to_namespaced_path.ts +60 -0
  430. package/src/main.ts +37 -0
  431. package/src/mod.ts +2 -0
  432. package/src/staticalize.ts +216 -0
  433. package/src/task-buffer.ts +87 -0
@@ -0,0 +1,136 @@
1
+ // Copyright 2018-2025 the Deno authors. MIT license.
2
+ // This module is browser compatible.
3
+
4
+ import { assertArg } from "../_common/normalize.js";
5
+ import { CHAR_COLON } from "../_common/constants.js";
6
+ import { normalizeString } from "../_common/normalize_string.js";
7
+ import { isPathSeparator, isWindowsDeviceRoot } from "./_util.js";
8
+ import { fromFileUrl } from "./from_file_url.js";
9
+
10
+ /**
11
+ * Normalize the `path`, resolving `'..'` and `'.'` segments.
12
+ * Note that resolving these segments does not necessarily mean that all will be eliminated.
13
+ * A `'..'` at the top-level will be preserved, and an empty path is canonically `'.'`.
14
+ *
15
+ * @example Usage
16
+ * ```ts
17
+ * import { normalize } from "@std/path/windows/normalize";
18
+ * import { assertEquals } from "@std/assert";
19
+ *
20
+ * assertEquals(normalize("C:\\foo\\..\\bar"), "C:\\bar");
21
+ * assertEquals(normalize(new URL("file:///C:/foo/../bar")), "C:\\bar");
22
+ * ```
23
+ *
24
+ * @param path The path to normalize
25
+ * @returns The normalized path
26
+ */
27
+ export function normalize(path: string | URL): string {
28
+ if (path instanceof URL) {
29
+ path = fromFileUrl(path);
30
+ }
31
+ assertArg(path);
32
+
33
+ const len = path.length;
34
+ let rootEnd = 0;
35
+ let device: string | undefined;
36
+ let isAbsolute = false;
37
+ const code = path.charCodeAt(0);
38
+
39
+ // Try to match a root
40
+ if (len > 1) {
41
+ if (isPathSeparator(code)) {
42
+ // Possible UNC root
43
+
44
+ // If we started with a separator, we know we at least have an absolute
45
+ // path of some kind (UNC or otherwise)
46
+ isAbsolute = true;
47
+
48
+ if (isPathSeparator(path.charCodeAt(1))) {
49
+ // Matched double path separator at beginning
50
+ let j = 2;
51
+ let last = j;
52
+ // Match 1 or more non-path separators
53
+ for (; j < len; ++j) {
54
+ if (isPathSeparator(path.charCodeAt(j))) break;
55
+ }
56
+ if (j < len && j !== last) {
57
+ const firstPart = path.slice(last, j);
58
+ // Matched!
59
+ last = j;
60
+ // Match 1 or more path separators
61
+ for (; j < len; ++j) {
62
+ if (!isPathSeparator(path.charCodeAt(j))) break;
63
+ }
64
+ if (j < len && j !== last) {
65
+ // Matched!
66
+ last = j;
67
+ // Match 1 or more non-path separators
68
+ for (; j < len; ++j) {
69
+ if (isPathSeparator(path.charCodeAt(j))) break;
70
+ }
71
+ if (j === len) {
72
+ // We matched a UNC root only
73
+ // Return the normalized version of the UNC root since there
74
+ // is nothing left to process
75
+
76
+ return `\\\\${firstPart}\\${path.slice(last)}\\`;
77
+ } else if (j !== last) {
78
+ // We matched a UNC root with leftovers
79
+
80
+ device = `\\\\${firstPart}\\${path.slice(last, j)}`;
81
+ rootEnd = j;
82
+ }
83
+ }
84
+ }
85
+ } else {
86
+ rootEnd = 1;
87
+ }
88
+ } else if (isWindowsDeviceRoot(code)) {
89
+ // Possible device root
90
+
91
+ if (path.charCodeAt(1) === CHAR_COLON) {
92
+ device = path.slice(0, 2);
93
+ rootEnd = 2;
94
+ if (len > 2) {
95
+ if (isPathSeparator(path.charCodeAt(2))) {
96
+ // Treat separator following drive name as an absolute path
97
+ // indicator
98
+ isAbsolute = true;
99
+ rootEnd = 3;
100
+ }
101
+ }
102
+ }
103
+ }
104
+ } else if (isPathSeparator(code)) {
105
+ // `path` contains just a path separator, exit early to avoid unnecessary
106
+ // work
107
+ return "\\";
108
+ }
109
+
110
+ let tail: string;
111
+ if (rootEnd < len) {
112
+ tail = normalizeString(
113
+ path.slice(rootEnd),
114
+ !isAbsolute,
115
+ "\\",
116
+ isPathSeparator,
117
+ );
118
+ } else {
119
+ tail = "";
120
+ }
121
+ if (tail.length === 0 && !isAbsolute) tail = ".";
122
+ if (tail.length > 0 && isPathSeparator(path.charCodeAt(len - 1))) {
123
+ tail += "\\";
124
+ }
125
+ if (device === undefined) {
126
+ if (isAbsolute) {
127
+ if (tail.length > 0) return `\\${tail}`;
128
+ else return "\\";
129
+ }
130
+ return tail;
131
+ } else if (isAbsolute) {
132
+ if (tail.length > 0) return `${device}\\${tail}`;
133
+ else return `${device}\\`;
134
+ }
135
+ return device + tail;
136
+ }
@@ -0,0 +1,43 @@
1
+ // Copyright 2018-2025 the Deno authors. MIT license.
2
+ // This module is browser compatible.
3
+
4
+ import type { GlobOptions } from "../_common/glob_to_reg_exp.js";
5
+ import { normalize } from "./normalize.js";
6
+ import { SEPARATOR_PATTERN } from "./constants.js";
7
+
8
+ export type { GlobOptions };
9
+
10
+ /**
11
+ * Like normalize(), but doesn't collapse "**\/.." when `globstar` is true.
12
+ *
13
+ * @example Usage
14
+ * ```ts
15
+ * import { normalizeGlob } from "@std/path/windows/normalize-glob";
16
+ * import { assertEquals } from "@std/assert";
17
+ *
18
+ * const normalized = normalizeGlob("**\\foo\\..\\bar", { globstar: true });
19
+ * assertEquals(normalized, "**\\bar");
20
+ * ```
21
+ *
22
+ * @param glob The glob pattern to normalize.
23
+ * @param options The options for glob pattern.
24
+ * @returns The normalized glob pattern.
25
+ */
26
+ export function normalizeGlob(
27
+ glob: string,
28
+ options: Pick<GlobOptions, "globstar"> = {},
29
+ ): string {
30
+ const { globstar = false }: GlobOptions = options;
31
+ if (glob.match(/\0/g)) {
32
+ throw new Error(`Glob contains invalid characters: "${glob}"`);
33
+ }
34
+ if (!globstar) {
35
+ return normalize(glob);
36
+ }
37
+ const s = SEPARATOR_PATTERN.source;
38
+ const badParentPattern = new RegExp(
39
+ `(?<=(${s}|^)\\*\\*${s})\\.\\.(?=${s}|$)`,
40
+ "g",
41
+ );
42
+ return normalize(glob.replace(badParentPattern, "\0")).replace(/\0/g, "..");
43
+ }
@@ -0,0 +1,184 @@
1
+ // Copyright 2018-2025 the Deno authors. MIT license.
2
+ // This module is browser compatible.
3
+
4
+ import { CHAR_COLON, CHAR_DOT } from "../_common/constants.js";
5
+ import type { ParsedPath } from "../types.js";
6
+ import { assertPath } from "../_common/assert_path.js";
7
+ import { isPathSeparator, isWindowsDeviceRoot } from "./_util.js";
8
+
9
+ export type { ParsedPath } from "../types.js";
10
+
11
+ /**
12
+ * Return a `ParsedPath` object of the `path`.
13
+ *
14
+ * @example Usage
15
+ * ```ts
16
+ * import { parse } from "@std/path/windows/parse";
17
+ * import { assertEquals } from "@std/assert";
18
+ *
19
+ * const parsed = parse("C:\\foo\\bar\\baz.ext");
20
+ * assertEquals(parsed, {
21
+ * root: "C:\\",
22
+ * dir: "C:\\foo\\bar",
23
+ * base: "baz.ext",
24
+ * ext: ".ext",
25
+ * name: "baz",
26
+ * });
27
+ * ```
28
+ *
29
+ * @param path The path to parse.
30
+ * @returns The `ParsedPath` object.
31
+ */
32
+ export function parse(path: string): ParsedPath {
33
+ assertPath(path);
34
+
35
+ const ret: ParsedPath = { root: "", dir: "", base: "", ext: "", name: "" };
36
+
37
+ const len = path.length;
38
+ if (len === 0) return ret;
39
+
40
+ let rootEnd = 0;
41
+ let code = path.charCodeAt(0);
42
+
43
+ // Try to match a root
44
+ if (len > 1) {
45
+ if (isPathSeparator(code)) {
46
+ // Possible UNC root
47
+
48
+ rootEnd = 1;
49
+ if (isPathSeparator(path.charCodeAt(1))) {
50
+ // Matched double path separator at beginning
51
+ let j = 2;
52
+ let last = j;
53
+ // Match 1 or more non-path separators
54
+ for (; j < len; ++j) {
55
+ if (isPathSeparator(path.charCodeAt(j))) break;
56
+ }
57
+ if (j < len && j !== last) {
58
+ // Matched!
59
+ last = j;
60
+ // Match 1 or more path separators
61
+ for (; j < len; ++j) {
62
+ if (!isPathSeparator(path.charCodeAt(j))) break;
63
+ }
64
+ if (j < len && j !== last) {
65
+ // Matched!
66
+ last = j;
67
+ // Match 1 or more non-path separators
68
+ for (; j < len; ++j) {
69
+ if (isPathSeparator(path.charCodeAt(j))) break;
70
+ }
71
+ if (j === len) {
72
+ // We matched a UNC root only
73
+
74
+ rootEnd = j;
75
+ } else if (j !== last) {
76
+ // We matched a UNC root with leftovers
77
+
78
+ rootEnd = j + 1;
79
+ }
80
+ }
81
+ }
82
+ }
83
+ } else if (isWindowsDeviceRoot(code)) {
84
+ // Possible device root
85
+
86
+ if (path.charCodeAt(1) === CHAR_COLON) {
87
+ rootEnd = 2;
88
+ if (len > 2) {
89
+ if (isPathSeparator(path.charCodeAt(2))) {
90
+ if (len === 3) {
91
+ // `path` contains just a drive root, exit early to avoid
92
+ // unnecessary work
93
+ ret.root = ret.dir = path;
94
+ ret.base = "\\";
95
+ return ret;
96
+ }
97
+ rootEnd = 3;
98
+ }
99
+ } else {
100
+ // `path` contains just a relative drive root, exit early to avoid
101
+ // unnecessary work
102
+ ret.root = ret.dir = path;
103
+ return ret;
104
+ }
105
+ }
106
+ }
107
+ } else if (isPathSeparator(code)) {
108
+ // `path` contains just a path separator, exit early to avoid
109
+ // unnecessary work
110
+ ret.root = ret.dir = path;
111
+ ret.base = "\\";
112
+ return ret;
113
+ }
114
+
115
+ if (rootEnd > 0) ret.root = path.slice(0, rootEnd);
116
+
117
+ let startDot = -1;
118
+ let startPart = rootEnd;
119
+ let end = -1;
120
+ let matchedSlash = true;
121
+ let i = path.length - 1;
122
+
123
+ // Track the state of characters (if any) we see before our first dot and
124
+ // after any path separator we find
125
+ let preDotState = 0;
126
+
127
+ // Get non-dir info
128
+ for (; i >= rootEnd; --i) {
129
+ code = path.charCodeAt(i);
130
+ if (isPathSeparator(code)) {
131
+ // If we reached a path separator that was not part of a set of path
132
+ // separators at the end of the string, stop now
133
+ if (!matchedSlash) {
134
+ startPart = i + 1;
135
+ break;
136
+ }
137
+ continue;
138
+ }
139
+ if (end === -1) {
140
+ // We saw the first non-path separator, mark this as the end of our
141
+ // extension
142
+ matchedSlash = false;
143
+ end = i + 1;
144
+ }
145
+ if (code === CHAR_DOT) {
146
+ // If this is our first dot, mark it as the start of our extension
147
+ if (startDot === -1) startDot = i;
148
+ else if (preDotState !== 1) preDotState = 1;
149
+ } else if (startDot !== -1) {
150
+ // We saw a non-dot and non-path separator before our dot, so we should
151
+ // have a good chance at having a non-empty extension
152
+ preDotState = -1;
153
+ }
154
+ }
155
+
156
+ if (
157
+ startDot === -1 ||
158
+ end === -1 ||
159
+ // We saw a non-dot character immediately before the dot
160
+ preDotState === 0 ||
161
+ // The (right-most) trimmed path component is exactly '..'
162
+ (preDotState === 1 && startDot === end - 1 && startDot === startPart + 1)
163
+ ) {
164
+ if (end !== -1) {
165
+ ret.base = ret.name = path.slice(startPart, end);
166
+ }
167
+ } else {
168
+ ret.name = path.slice(startPart, startDot);
169
+ ret.base = path.slice(startPart, end);
170
+ ret.ext = path.slice(startDot, end);
171
+ }
172
+
173
+ // Fallback to '\' in case there is no basename
174
+ ret.base = ret.base || "\\";
175
+
176
+ // If the directory is the root, use the entire root as the `dir` including
177
+ // the trailing slash if any (`C:\abc` -> `C:\`). Otherwise, strip out the
178
+ // trailing slash (`C:\abc\def` -> `C:\abc`).
179
+ if (startPart > 0 && startPart !== rootEnd) {
180
+ ret.dir = path.slice(0, startPart - 1);
181
+ } else ret.dir = ret.root;
182
+
183
+ return ret;
184
+ }
@@ -0,0 +1,128 @@
1
+ // Copyright 2018-2025 the Deno authors. MIT license.
2
+ // This module is browser compatible.
3
+
4
+ import { CHAR_BACKWARD_SLASH } from "../_common/constants.js";
5
+ import { resolve } from "./resolve.js";
6
+ import { assertArgs } from "../_common/relative.js";
7
+
8
+ /**
9
+ * Return the relative path from `from` to `to` based on current working directory.
10
+ *
11
+ * An example in windows, for instance:
12
+ * from = 'C:\\orandea\\test\\aaa'
13
+ * to = 'C:\\orandea\\impl\\bbb'
14
+ * The output of the function should be: '..\\..\\impl\\bbb'
15
+ *
16
+ * @example Usage
17
+ * ```ts
18
+ * import { relative } from "@std/path/windows/relative";
19
+ * import { assertEquals } from "@std/assert";
20
+ *
21
+ * const relativePath = relative("C:\\foobar\\test\\aaa", "C:\\foobar\\impl\\bbb");
22
+ * assertEquals(relativePath, "..\\..\\impl\\bbb");
23
+ * ```
24
+ *
25
+ * @param from The path from which to calculate the relative path
26
+ * @param to The path to which to calculate the relative path
27
+ * @returns The relative path from `from` to `to`
28
+ */
29
+ export function relative(from: string, to: string): string {
30
+ assertArgs(from, to);
31
+
32
+ const fromOrig = resolve(from);
33
+ const toOrig = resolve(to);
34
+
35
+ if (fromOrig === toOrig) return "";
36
+
37
+ from = fromOrig.toLowerCase();
38
+ to = toOrig.toLowerCase();
39
+
40
+ if (from === to) return "";
41
+
42
+ // Trim any leading backslashes
43
+ let fromStart = 0;
44
+ let fromEnd = from.length;
45
+ for (; fromStart < fromEnd; ++fromStart) {
46
+ if (from.charCodeAt(fromStart) !== CHAR_BACKWARD_SLASH) break;
47
+ }
48
+ // Trim trailing backslashes (applicable to UNC paths only)
49
+ for (; fromEnd - 1 > fromStart; --fromEnd) {
50
+ if (from.charCodeAt(fromEnd - 1) !== CHAR_BACKWARD_SLASH) break;
51
+ }
52
+ const fromLen = fromEnd - fromStart;
53
+
54
+ // Trim any leading backslashes
55
+ let toStart = 0;
56
+ let toEnd = to.length;
57
+ for (; toStart < toEnd; ++toStart) {
58
+ if (to.charCodeAt(toStart) !== CHAR_BACKWARD_SLASH) break;
59
+ }
60
+ // Trim trailing backslashes (applicable to UNC paths only)
61
+ for (; toEnd - 1 > toStart; --toEnd) {
62
+ if (to.charCodeAt(toEnd - 1) !== CHAR_BACKWARD_SLASH) break;
63
+ }
64
+ const toLen = toEnd - toStart;
65
+
66
+ // Compare paths to find the longest common path from root
67
+ const length = fromLen < toLen ? fromLen : toLen;
68
+ let lastCommonSep = -1;
69
+ let i = 0;
70
+ for (; i <= length; ++i) {
71
+ if (i === length) {
72
+ if (toLen > length) {
73
+ if (to.charCodeAt(toStart + i) === CHAR_BACKWARD_SLASH) {
74
+ // We get here if `from` is the exact base path for `to`.
75
+ // For example: from='C:\\foo\\bar'; to='C:\\foo\\bar\\baz'
76
+ return toOrig.slice(toStart + i + 1);
77
+ } else if (i === 2) {
78
+ // We get here if `from` is the device root.
79
+ // For example: from='C:\\'; to='C:\\foo'
80
+ return toOrig.slice(toStart + i);
81
+ }
82
+ }
83
+ if (fromLen > length) {
84
+ if (from.charCodeAt(fromStart + i) === CHAR_BACKWARD_SLASH) {
85
+ // We get here if `to` is the exact base path for `from`.
86
+ // For example: from='C:\\foo\\bar'; to='C:\\foo'
87
+ lastCommonSep = i;
88
+ } else if (i === 2) {
89
+ // We get here if `to` is the device root.
90
+ // For example: from='C:\\foo\\bar'; to='C:\\'
91
+ lastCommonSep = 3;
92
+ }
93
+ }
94
+ break;
95
+ }
96
+ const fromCode = from.charCodeAt(fromStart + i);
97
+ const toCode = to.charCodeAt(toStart + i);
98
+ if (fromCode !== toCode) break;
99
+ else if (fromCode === CHAR_BACKWARD_SLASH) lastCommonSep = i;
100
+ }
101
+
102
+ // We found a mismatch before the first common path separator was seen, so
103
+ // return the original `to`.
104
+ if (i !== length && lastCommonSep === -1) {
105
+ return toOrig;
106
+ }
107
+
108
+ let out = "";
109
+ if (lastCommonSep === -1) lastCommonSep = 0;
110
+ // Generate the relative path based on the path difference between `to` and
111
+ // `from`
112
+ for (i = fromStart + lastCommonSep + 1; i <= fromEnd; ++i) {
113
+ if (i === fromEnd || from.charCodeAt(i) === CHAR_BACKWARD_SLASH) {
114
+ if (out.length === 0) out += "..";
115
+ else out += "\\..";
116
+ }
117
+ }
118
+
119
+ // Lastly, append the rest of the destination (`to`) path that comes after
120
+ // the common path parts
121
+ if (out.length > 0) {
122
+ return out + toOrig.slice(toStart + lastCommonSep, toEnd);
123
+ } else {
124
+ toStart += lastCommonSep;
125
+ if (toOrig.charCodeAt(toStart) === CHAR_BACKWARD_SLASH) ++toStart;
126
+ return toOrig.slice(toStart, toEnd);
127
+ }
128
+ }
@@ -0,0 +1,178 @@
1
+ // Copyright 2018-2025 the Deno authors. MIT license.
2
+ // This module is browser compatible.
3
+ import * as dntShim from "../../../../../../_dnt.shims.js";
4
+
5
+
6
+ import { CHAR_COLON } from "../_common/constants.js";
7
+ import { normalizeString } from "../_common/normalize_string.js";
8
+ import { assertPath } from "../_common/assert_path.js";
9
+ import { isPathSeparator, isWindowsDeviceRoot } from "./_util.js";
10
+
11
+ /**
12
+ * Resolves path segments into a `path`.
13
+ *
14
+ * @example Usage
15
+ * ```ts
16
+ * import { resolve } from "@std/path/windows/resolve";
17
+ * import { assertEquals } from "@std/assert";
18
+ *
19
+ * const resolved = resolve("C:\\foo\\bar", "..\\baz");
20
+ * assertEquals(resolved, "C:\\foo\\baz");
21
+ * ```
22
+ *
23
+ * @param pathSegments The path segments to process to path
24
+ * @returns The resolved path
25
+ */
26
+ export function resolve(...pathSegments: string[]): string {
27
+ let resolvedDevice = "";
28
+ let resolvedTail = "";
29
+ let resolvedAbsolute = false;
30
+
31
+ for (let i = pathSegments.length - 1; i >= -1; i--) {
32
+ let path: string;
33
+ // deno-lint-ignore no-explicit-any
34
+ const { Deno } = dntShim.dntGlobalThis as any;
35
+ if (i >= 0) {
36
+ path = pathSegments[i]!;
37
+ } else if (!resolvedDevice) {
38
+ if (typeof Deno?.cwd !== "function") {
39
+ throw new TypeError(
40
+ "Resolved a drive-letter-less path without a current working directory (CWD)",
41
+ );
42
+ }
43
+ path = Deno.cwd();
44
+ } else {
45
+ if (
46
+ typeof Deno?.env?.get !== "function" || typeof Deno?.cwd !== "function"
47
+ ) {
48
+ throw new TypeError(
49
+ "Resolved a relative path without a current working directory (CWD)",
50
+ );
51
+ }
52
+ path = Deno.cwd();
53
+
54
+ // Verify that a cwd was found and that it actually points
55
+ // to our drive. If not, default to the drive's root.
56
+ if (
57
+ path === undefined ||
58
+ path.slice(0, 3).toLowerCase() !== `${resolvedDevice.toLowerCase()}\\`
59
+ ) {
60
+ path = `${resolvedDevice}\\`;
61
+ }
62
+ }
63
+
64
+ assertPath(path);
65
+
66
+ const len = path.length;
67
+
68
+ // Skip empty entries
69
+ if (len === 0) continue;
70
+
71
+ let rootEnd = 0;
72
+ let device = "";
73
+ let isAbsolute = false;
74
+ const code = path.charCodeAt(0);
75
+
76
+ // Try to match a root
77
+ if (len > 1) {
78
+ if (isPathSeparator(code)) {
79
+ // Possible UNC root
80
+
81
+ // If we started with a separator, we know we at least have an
82
+ // absolute path of some kind (UNC or otherwise)
83
+ isAbsolute = true;
84
+
85
+ if (isPathSeparator(path.charCodeAt(1))) {
86
+ // Matched double path separator at beginning
87
+ let j = 2;
88
+ let last = j;
89
+ // Match 1 or more non-path separators
90
+ for (; j < len; ++j) {
91
+ if (isPathSeparator(path.charCodeAt(j))) break;
92
+ }
93
+ if (j < len && j !== last) {
94
+ const firstPart = path.slice(last, j);
95
+ // Matched!
96
+ last = j;
97
+ // Match 1 or more path separators
98
+ for (; j < len; ++j) {
99
+ if (!isPathSeparator(path.charCodeAt(j))) break;
100
+ }
101
+ if (j < len && j !== last) {
102
+ // Matched!
103
+ last = j;
104
+ // Match 1 or more non-path separators
105
+ for (; j < len; ++j) {
106
+ if (isPathSeparator(path.charCodeAt(j))) break;
107
+ }
108
+ if (j === len) {
109
+ // We matched a UNC root only
110
+ device = `\\\\${firstPart}\\${path.slice(last)}`;
111
+ rootEnd = j;
112
+ } else if (j !== last) {
113
+ // We matched a UNC root with leftovers
114
+
115
+ device = `\\\\${firstPart}\\${path.slice(last, j)}`;
116
+ rootEnd = j;
117
+ }
118
+ }
119
+ }
120
+ } else {
121
+ rootEnd = 1;
122
+ }
123
+ } else if (isWindowsDeviceRoot(code)) {
124
+ // Possible device root
125
+
126
+ if (path.charCodeAt(1) === CHAR_COLON) {
127
+ device = path.slice(0, 2);
128
+ rootEnd = 2;
129
+ if (len > 2) {
130
+ if (isPathSeparator(path.charCodeAt(2))) {
131
+ // Treat separator following drive name as an absolute path
132
+ // indicator
133
+ isAbsolute = true;
134
+ rootEnd = 3;
135
+ }
136
+ }
137
+ }
138
+ }
139
+ } else if (isPathSeparator(code)) {
140
+ // `path` contains just a path separator
141
+ rootEnd = 1;
142
+ isAbsolute = true;
143
+ }
144
+
145
+ if (
146
+ device.length > 0 &&
147
+ resolvedDevice.length > 0 &&
148
+ device.toLowerCase() !== resolvedDevice.toLowerCase()
149
+ ) {
150
+ // This path points to another device so it is not applicable
151
+ continue;
152
+ }
153
+
154
+ if (resolvedDevice.length === 0 && device.length > 0) {
155
+ resolvedDevice = device;
156
+ }
157
+ if (!resolvedAbsolute) {
158
+ resolvedTail = `${path.slice(rootEnd)}\\${resolvedTail}`;
159
+ resolvedAbsolute = isAbsolute;
160
+ }
161
+
162
+ if (resolvedAbsolute && resolvedDevice.length > 0) break;
163
+ }
164
+
165
+ // At this point the path should be resolved to a full absolute path,
166
+ // but handle relative paths to be safe (might happen when Deno.cwd()
167
+ // fails)
168
+
169
+ // Normalize the tail path
170
+ resolvedTail = normalizeString(
171
+ resolvedTail,
172
+ !resolvedAbsolute,
173
+ "\\",
174
+ isPathSeparator,
175
+ );
176
+
177
+ return resolvedDevice + (resolvedAbsolute ? "\\" : "") + resolvedTail || ".";
178
+ }