ventojs 0.9.0 → 0.9.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 (377) hide show
  1. package/esm/deps/deno.land/std@0.208.0/path/_common/assert_path.d.ts +1 -0
  2. package/esm/deps/deno.land/std@0.208.0/path/_common/assert_path.js +7 -0
  3. package/esm/deps/deno.land/std@0.208.0/path/_common/basename.d.ts +3 -0
  4. package/esm/deps/deno.land/std@0.208.0/path/_common/basename.js +40 -0
  5. package/esm/deps/deno.land/std@0.208.0/path/_common/common.d.ts +1 -0
  6. package/esm/deps/deno.land/{std@0.201.0/path → std@0.208.0/path/_common}/common.js +1 -14
  7. package/esm/deps/deno.land/std@0.208.0/path/_common/dirname.d.ts +1 -0
  8. package/esm/deps/deno.land/std@0.208.0/path/_common/dirname.js +8 -0
  9. package/esm/deps/deno.land/std@0.208.0/path/_common/format.d.ts +3 -0
  10. package/esm/deps/deno.land/std@0.208.0/path/_common/format.js +19 -0
  11. package/esm/deps/deno.land/std@0.208.0/path/_common/from_file_url.d.ts +2 -0
  12. package/esm/deps/deno.land/std@0.208.0/path/_common/from_file_url.js +9 -0
  13. package/esm/deps/deno.land/std@0.208.0/path/_common/glob_to_reg_exp.d.ts +27 -0
  14. package/esm/deps/deno.land/{std@0.201.0/path/glob.js → std@0.208.0/path/_common/glob_to_reg_exp.js} +13 -139
  15. package/esm/deps/deno.land/std@0.208.0/path/_common/normalize.d.ts +1 -0
  16. package/esm/deps/deno.land/std@0.208.0/path/_common/normalize.js +8 -0
  17. package/esm/deps/deno.land/std@0.208.0/path/_common/normalize_string.d.ts +1 -0
  18. package/esm/deps/deno.land/{std@0.201.0/path/_util.js → std@0.208.0/path/_common/normalize_string.js} +1 -31
  19. package/esm/deps/deno.land/std@0.208.0/path/_common/relative.d.ts +1 -0
  20. package/esm/deps/deno.land/std@0.208.0/path/_common/relative.js +9 -0
  21. package/esm/deps/deno.land/std@0.208.0/path/_common/strip_trailing_separators.d.ts +1 -0
  22. package/esm/deps/deno.land/std@0.208.0/path/_common/strip_trailing_separators.js +19 -0
  23. package/esm/deps/deno.land/std@0.208.0/path/_common/to_file_url.d.ts +1 -0
  24. package/esm/deps/deno.land/std@0.208.0/path/_common/to_file_url.js +15 -0
  25. package/esm/deps/deno.land/std@0.208.0/path/_os.d.ts +3 -0
  26. package/esm/deps/deno.land/{std@0.201.0 → std@0.208.0}/path/_os.js +1 -1
  27. package/esm/deps/deno.land/{std@0.201.0 → std@0.208.0}/path/basename.js +2 -1
  28. package/esm/deps/deno.land/std@0.208.0/path/common.js +19 -0
  29. package/esm/deps/deno.land/{std@0.201.0 → std@0.208.0}/path/dirname.js +2 -1
  30. package/esm/deps/deno.land/{std@0.201.0 → std@0.208.0}/path/extname.js +2 -1
  31. package/esm/deps/deno.land/{std@0.201.0 → std@0.208.0}/path/format.js +2 -1
  32. package/esm/deps/deno.land/{std@0.201.0 → std@0.208.0}/path/from_file_url.js +2 -1
  33. package/esm/deps/deno.land/{std@0.201.0/path/glob.d.ts → std@0.208.0/path/glob_to_regexp.d.ts} +5 -27
  34. package/esm/deps/deno.land/std@0.208.0/path/glob_to_regexp.js +65 -0
  35. package/esm/deps/deno.land/{std@0.201.0 → std@0.208.0}/path/is_absolute.js +2 -1
  36. package/esm/deps/deno.land/std@0.208.0/path/is_glob.d.ts +2 -0
  37. package/esm/deps/deno.land/std@0.208.0/path/is_glob.js +28 -0
  38. package/esm/deps/deno.land/{std@0.201.0 → std@0.208.0}/path/join.js +2 -1
  39. package/esm/deps/deno.land/std@0.208.0/path/join_globs.d.ts +3 -0
  40. package/esm/deps/deno.land/std@0.208.0/path/join_globs.js +11 -0
  41. package/{script/deps/deno.land/std@0.201.0 → esm/deps/deno.land/std@0.208.0}/path/mod.d.ts +10 -4
  42. package/esm/deps/deno.land/std@0.208.0/path/mod.js +63 -0
  43. package/esm/deps/deno.land/{std@0.201.0 → std@0.208.0}/path/normalize.js +2 -1
  44. package/esm/deps/deno.land/std@0.208.0/path/normalize_glob.d.ts +3 -0
  45. package/esm/deps/deno.land/std@0.208.0/path/normalize_glob.js +11 -0
  46. package/esm/deps/deno.land/{std@0.201.0 → std@0.208.0}/path/parse.js +2 -1
  47. package/esm/deps/deno.land/std@0.208.0/path/posix/_util.d.ts +1 -0
  48. package/esm/deps/deno.land/std@0.208.0/path/posix/_util.js +8 -0
  49. package/esm/deps/deno.land/std@0.208.0/path/posix/basename.js +18 -0
  50. package/esm/deps/deno.land/std@0.208.0/path/posix/common.js +19 -0
  51. package/esm/deps/deno.land/std@0.208.0/path/posix/dirname.js +36 -0
  52. package/esm/deps/deno.land/std@0.208.0/path/posix/extname.js +59 -0
  53. package/esm/deps/deno.land/std@0.208.0/path/posix/format.d.ts +6 -0
  54. package/esm/deps/deno.land/std@0.208.0/path/posix/format.js +11 -0
  55. package/esm/deps/deno.land/std@0.208.0/path/posix/from_file_url.d.ts +12 -0
  56. package/esm/deps/deno.land/std@0.208.0/path/posix/from_file_url.js +17 -0
  57. package/esm/deps/deno.land/std@0.208.0/path/posix/glob_to_regexp.d.ts +57 -0
  58. package/esm/deps/deno.land/std@0.208.0/path/posix/glob_to_regexp.js +69 -0
  59. package/esm/deps/deno.land/std@0.208.0/path/posix/is_absolute.js +12 -0
  60. package/esm/deps/deno.land/std@0.208.0/path/posix/is_glob.d.ts +1 -0
  61. package/esm/deps/deno.land/std@0.208.0/path/posix/is_glob.js +3 -0
  62. package/esm/deps/deno.land/std@0.208.0/path/posix/join.js +26 -0
  63. package/esm/deps/deno.land/std@0.208.0/path/posix/join_globs.d.ts +3 -0
  64. package/esm/deps/deno.land/std@0.208.0/path/posix/join_globs.js +26 -0
  65. package/esm/deps/deno.land/std@0.208.0/path/posix/mod.d.ts +40 -0
  66. package/esm/deps/deno.land/{std@0.201.0/path → std@0.208.0/path/posix}/mod.js +7 -8
  67. package/esm/deps/deno.land/std@0.208.0/path/posix/normalize.js +25 -0
  68. package/esm/deps/deno.land/std@0.208.0/path/posix/normalize_glob.d.ts +3 -0
  69. package/esm/deps/deno.land/std@0.208.0/path/posix/normalize_glob.js +16 -0
  70. package/esm/deps/deno.land/std@0.208.0/path/posix/parse.d.ts +6 -0
  71. package/esm/deps/deno.land/std@0.208.0/path/posix/parse.js +98 -0
  72. package/esm/deps/deno.land/std@0.208.0/path/posix/relative.d.ts +7 -0
  73. package/esm/deps/deno.land/std@0.208.0/path/posix/relative.js +94 -0
  74. package/esm/deps/deno.land/std@0.208.0/path/posix/resolve.js +48 -0
  75. package/esm/deps/deno.land/std@0.208.0/path/posix/separator.d.ts +2 -0
  76. package/esm/deps/deno.land/std@0.208.0/path/posix/separator.js +4 -0
  77. package/esm/deps/deno.land/std@0.208.0/path/posix/to_file_url.d.ts +12 -0
  78. package/esm/deps/deno.land/std@0.208.0/path/posix/to_file_url.js +22 -0
  79. package/esm/deps/deno.land/std@0.208.0/path/posix/to_namespaced_path.js +10 -0
  80. package/esm/deps/deno.land/{std@0.201.0 → std@0.208.0}/path/relative.js +2 -1
  81. package/esm/deps/deno.land/{std@0.201.0 → std@0.208.0}/path/resolve.js +2 -1
  82. package/esm/deps/deno.land/{std@0.201.0 → std@0.208.0}/path/to_file_url.js +2 -1
  83. package/esm/deps/deno.land/{std@0.201.0 → std@0.208.0}/path/to_namespaced_path.js +2 -1
  84. package/esm/deps/deno.land/std@0.208.0/path/windows/_util.d.ts +3 -0
  85. package/esm/deps/deno.land/std@0.208.0/path/windows/_util.js +15 -0
  86. package/esm/deps/deno.land/std@0.208.0/path/windows/basename.d.ts +8 -0
  87. package/esm/deps/deno.land/std@0.208.0/path/windows/basename.js +30 -0
  88. package/esm/deps/deno.land/std@0.208.0/path/windows/common.d.ts +13 -0
  89. package/esm/deps/deno.land/std@0.208.0/path/windows/common.js +19 -0
  90. package/esm/deps/deno.land/std@0.208.0/path/windows/dirname.d.ts +5 -0
  91. package/esm/deps/deno.land/{std@0.201.0/path/_dirname.js → std@0.208.0/path/windows/dirname.js} +5 -39
  92. package/esm/deps/deno.land/std@0.208.0/path/windows/extname.d.ts +6 -0
  93. package/esm/deps/deno.land/{std@0.201.0/path/_extname.js → std@0.208.0/path/windows/extname.js} +4 -57
  94. package/esm/deps/deno.land/std@0.208.0/path/windows/format.d.ts +6 -0
  95. package/esm/deps/deno.land/std@0.208.0/path/windows/format.js +11 -0
  96. package/esm/deps/deno.land/{std@0.201.0/path/_from_file_url.d.ts → std@0.208.0/path/windows/from_file_url.d.ts} +1 -12
  97. package/esm/deps/deno.land/{std@0.201.0/path/_from_file_url.js → std@0.208.0/path/windows/from_file_url.js} +2 -22
  98. package/esm/deps/deno.land/std@0.208.0/path/windows/glob_to_regexp.d.ts +57 -0
  99. package/esm/deps/deno.land/std@0.208.0/path/windows/glob_to_regexp.js +69 -0
  100. package/esm/deps/deno.land/std@0.208.0/path/windows/is_absolute.d.ts +5 -0
  101. package/esm/deps/deno.land/{std@0.201.0/path/_is_absolute.js → std@0.208.0/path/windows/is_absolute.js} +4 -11
  102. package/esm/deps/deno.land/std@0.208.0/path/windows/is_glob.d.ts +1 -0
  103. package/esm/deps/deno.land/std@0.208.0/path/windows/is_glob.js +3 -0
  104. package/esm/deps/deno.land/std@0.208.0/path/windows/join.d.ts +5 -0
  105. package/esm/deps/deno.land/{std@0.201.0/path/_join.js → std@0.208.0/path/windows/join.js} +6 -27
  106. package/esm/deps/deno.land/std@0.208.0/path/windows/join_globs.d.ts +3 -0
  107. package/esm/deps/deno.land/std@0.208.0/path/windows/join_globs.js +26 -0
  108. package/esm/deps/deno.land/std@0.208.0/path/windows/mod.d.ts +40 -0
  109. package/esm/deps/deno.land/std@0.208.0/path/windows/mod.js +44 -0
  110. package/esm/deps/deno.land/std@0.208.0/path/windows/normalize.d.ts +7 -0
  111. package/esm/deps/deno.land/{std@0.201.0/path/_normalize.js → std@0.208.0/path/windows/normalize.js} +5 -28
  112. package/esm/deps/deno.land/std@0.208.0/path/windows/normalize_glob.d.ts +3 -0
  113. package/esm/deps/deno.land/std@0.208.0/path/windows/normalize_glob.js +16 -0
  114. package/esm/deps/deno.land/std@0.208.0/path/windows/parse.d.ts +6 -0
  115. package/esm/deps/deno.land/{std@0.201.0/path/_parse.js → std@0.208.0/path/windows/parse.js} +4 -95
  116. package/esm/deps/deno.land/{std@0.201.0/path/_relative.js → std@0.208.0/path/windows/relative.js} +6 -101
  117. package/esm/deps/deno.land/std@0.208.0/path/windows/resolve.d.ts +5 -0
  118. package/esm/deps/deno.land/{std@0.201.0/path/_resolve.js → std@0.208.0/path/windows/resolve.js} +6 -46
  119. package/esm/deps/deno.land/std@0.208.0/path/windows/separator.d.ts +2 -0
  120. package/esm/deps/deno.land/std@0.208.0/path/windows/separator.js +4 -0
  121. package/{script/deps/deno.land/std@0.201.0/path/_to_file_url.d.ts → esm/deps/deno.land/std@0.208.0/path/windows/to_file_url.d.ts} +1 -12
  122. package/esm/deps/deno.land/{std@0.201.0/path/_to_file_url.js → std@0.208.0/path/windows/to_file_url.js} +4 -34
  123. package/esm/deps/deno.land/std@0.208.0/path/windows/to_namespaced_path.d.ts +5 -0
  124. package/esm/deps/deno.land/{std@0.201.0/path/_to_namespaced_path.js → std@0.208.0/path/windows/to_namespaced_path.js} +4 -12
  125. package/esm/deps.d.ts +2 -2
  126. package/esm/deps.js +2 -2
  127. package/esm/mod.js +2 -2
  128. package/esm/src/environment.d.ts +5 -0
  129. package/esm/src/environment.js +50 -23
  130. package/esm/src/tokenizer.d.ts +7 -2
  131. package/esm/src/tokenizer.js +77 -66
  132. package/package.json +1 -1
  133. package/script/deps/deno.land/std@0.208.0/path/_common/assert_path.d.ts +1 -0
  134. package/script/deps/deno.land/std@0.208.0/path/_common/assert_path.js +11 -0
  135. package/script/deps/deno.land/std@0.208.0/path/_common/basename.d.ts +3 -0
  136. package/script/deps/deno.land/std@0.208.0/path/_common/basename.js +46 -0
  137. package/script/deps/deno.land/std@0.208.0/path/_common/common.d.ts +1 -0
  138. package/script/deps/deno.land/{std@0.201.0/path → std@0.208.0/path/_common}/common.js +3 -16
  139. package/script/deps/deno.land/std@0.208.0/path/_common/dirname.d.ts +1 -0
  140. package/script/deps/deno.land/std@0.208.0/path/_common/dirname.js +12 -0
  141. package/script/deps/deno.land/std@0.208.0/path/_common/format.d.ts +3 -0
  142. package/{esm/deps/deno.land/std@0.201.0/path/_format.js → script/deps/deno.land/std@0.208.0/path/_common/format.js} +5 -16
  143. package/script/deps/deno.land/std@0.208.0/path/_common/from_file_url.d.ts +2 -0
  144. package/script/deps/deno.land/std@0.208.0/path/_common/from_file_url.js +13 -0
  145. package/script/deps/deno.land/std@0.208.0/path/_common/glob_to_reg_exp.d.ts +27 -0
  146. package/script/deps/deno.land/{std@0.201.0/path/glob.js → std@0.208.0/path/_common/glob_to_reg_exp.js} +15 -167
  147. package/script/deps/deno.land/std@0.208.0/path/_common/normalize.d.ts +1 -0
  148. package/script/deps/deno.land/std@0.208.0/path/_common/normalize.js +12 -0
  149. package/script/deps/deno.land/std@0.208.0/path/_common/normalize_string.d.ts +1 -0
  150. package/script/deps/deno.land/{std@0.201.0/path/_util.js → std@0.208.0/path/_common/normalize_string.js} +6 -41
  151. package/script/deps/deno.land/std@0.208.0/path/_common/relative.d.ts +1 -0
  152. package/script/deps/deno.land/std@0.208.0/path/_common/relative.js +13 -0
  153. package/script/deps/deno.land/std@0.208.0/path/_common/strip_trailing_separators.d.ts +1 -0
  154. package/script/deps/deno.land/std@0.208.0/path/_common/strip_trailing_separators.js +23 -0
  155. package/script/deps/deno.land/std@0.208.0/path/_common/to_file_url.d.ts +1 -0
  156. package/script/deps/deno.land/std@0.208.0/path/_common/to_file_url.js +19 -0
  157. package/script/deps/deno.land/std@0.208.0/path/_os.d.ts +3 -0
  158. package/script/deps/deno.land/{std@0.201.0 → std@0.208.0}/path/_os.js +4 -4
  159. package/script/deps/deno.land/std@0.208.0/path/basename.d.ts +8 -0
  160. package/script/deps/deno.land/{std@0.201.0 → std@0.208.0}/path/basename.js +4 -3
  161. package/script/deps/deno.land/std@0.208.0/path/common.d.ts +13 -0
  162. package/script/deps/deno.land/std@0.208.0/path/common.js +23 -0
  163. package/script/deps/deno.land/std@0.208.0/path/dirname.d.ts +5 -0
  164. package/script/deps/deno.land/{std@0.201.0 → std@0.208.0}/path/dirname.js +3 -2
  165. package/script/deps/deno.land/std@0.208.0/path/extname.d.ts +6 -0
  166. package/script/deps/deno.land/{std@0.201.0 → std@0.208.0}/path/extname.js +3 -2
  167. package/script/deps/deno.land/{std@0.201.0 → std@0.208.0}/path/format.js +3 -2
  168. package/script/deps/deno.land/{std@0.201.0 → std@0.208.0}/path/from_file_url.js +3 -2
  169. package/script/deps/deno.land/{std@0.201.0/path/glob.d.ts → std@0.208.0/path/glob_to_regexp.d.ts} +5 -27
  170. package/script/deps/deno.land/std@0.208.0/path/glob_to_regexp.js +69 -0
  171. package/script/deps/deno.land/std@0.208.0/path/is_absolute.d.ts +5 -0
  172. package/script/deps/deno.land/{std@0.201.0 → std@0.208.0}/path/is_absolute.js +3 -2
  173. package/script/deps/deno.land/std@0.208.0/path/is_glob.d.ts +2 -0
  174. package/script/deps/deno.land/std@0.208.0/path/is_glob.js +32 -0
  175. package/script/deps/deno.land/std@0.208.0/path/join.d.ts +5 -0
  176. package/script/deps/deno.land/{std@0.201.0 → std@0.208.0}/path/join.js +3 -2
  177. package/script/deps/deno.land/std@0.208.0/path/join_globs.d.ts +3 -0
  178. package/script/deps/deno.land/std@0.208.0/path/join_globs.js +15 -0
  179. package/{esm/deps/deno.land/std@0.201.0 → script/deps/deno.land/std@0.208.0}/path/mod.d.ts +10 -4
  180. package/script/deps/deno.land/std@0.208.0/path/mod.js +92 -0
  181. package/script/deps/deno.land/std@0.208.0/path/normalize.d.ts +7 -0
  182. package/script/deps/deno.land/{std@0.201.0 → std@0.208.0}/path/normalize.js +3 -2
  183. package/script/deps/deno.land/std@0.208.0/path/normalize_glob.d.ts +3 -0
  184. package/script/deps/deno.land/std@0.208.0/path/normalize_glob.js +15 -0
  185. package/script/deps/deno.land/{std@0.201.0 → std@0.208.0}/path/parse.js +3 -2
  186. package/script/deps/deno.land/std@0.208.0/path/posix/_util.d.ts +1 -0
  187. package/script/deps/deno.land/std@0.208.0/path/posix/_util.js +12 -0
  188. package/script/deps/deno.land/std@0.208.0/path/posix/basename.d.ts +8 -0
  189. package/script/deps/deno.land/std@0.208.0/path/posix/basename.js +22 -0
  190. package/script/deps/deno.land/std@0.208.0/path/posix/common.d.ts +13 -0
  191. package/script/deps/deno.land/std@0.208.0/path/posix/common.js +23 -0
  192. package/script/deps/deno.land/std@0.208.0/path/posix/dirname.d.ts +5 -0
  193. package/script/deps/deno.land/std@0.208.0/path/posix/dirname.js +40 -0
  194. package/script/deps/deno.land/std@0.208.0/path/posix/extname.d.ts +6 -0
  195. package/script/deps/deno.land/std@0.208.0/path/posix/extname.js +63 -0
  196. package/script/deps/deno.land/std@0.208.0/path/posix/format.d.ts +6 -0
  197. package/script/deps/deno.land/std@0.208.0/path/posix/format.js +15 -0
  198. package/script/deps/deno.land/std@0.208.0/path/posix/from_file_url.d.ts +12 -0
  199. package/script/deps/deno.land/std@0.208.0/path/posix/from_file_url.js +21 -0
  200. package/script/deps/deno.land/std@0.208.0/path/posix/glob_to_regexp.d.ts +57 -0
  201. package/script/deps/deno.land/std@0.208.0/path/posix/glob_to_regexp.js +73 -0
  202. package/script/deps/deno.land/std@0.208.0/path/posix/is_absolute.d.ts +5 -0
  203. package/script/deps/deno.land/std@0.208.0/path/posix/is_absolute.js +16 -0
  204. package/script/deps/deno.land/std@0.208.0/path/posix/is_glob.d.ts +1 -0
  205. package/script/deps/deno.land/std@0.208.0/path/posix/is_glob.js +7 -0
  206. package/script/deps/deno.land/std@0.208.0/path/posix/join.d.ts +5 -0
  207. package/script/deps/deno.land/std@0.208.0/path/posix/join.js +30 -0
  208. package/script/deps/deno.land/std@0.208.0/path/posix/join_globs.d.ts +3 -0
  209. package/script/deps/deno.land/std@0.208.0/path/posix/join_globs.js +30 -0
  210. package/script/deps/deno.land/std@0.208.0/path/posix/mod.d.ts +40 -0
  211. package/script/deps/deno.land/{std@0.201.0/path → std@0.208.0/path/posix}/mod.js +8 -21
  212. package/script/deps/deno.land/std@0.208.0/path/posix/normalize.d.ts +7 -0
  213. package/script/deps/deno.land/std@0.208.0/path/posix/normalize.js +29 -0
  214. package/script/deps/deno.land/std@0.208.0/path/posix/normalize_glob.d.ts +3 -0
  215. package/script/deps/deno.land/std@0.208.0/path/posix/normalize_glob.js +20 -0
  216. package/script/deps/deno.land/std@0.208.0/path/posix/parse.d.ts +6 -0
  217. package/script/deps/deno.land/std@0.208.0/path/posix/parse.js +102 -0
  218. package/script/deps/deno.land/std@0.208.0/path/posix/relative.d.ts +7 -0
  219. package/script/deps/deno.land/std@0.208.0/path/posix/relative.js +98 -0
  220. package/script/deps/deno.land/std@0.208.0/path/posix/resolve.d.ts +5 -0
  221. package/script/deps/deno.land/std@0.208.0/path/posix/resolve.js +75 -0
  222. package/script/deps/deno.land/std@0.208.0/path/posix/separator.d.ts +2 -0
  223. package/script/deps/deno.land/std@0.208.0/path/posix/separator.js +7 -0
  224. package/script/deps/deno.land/std@0.208.0/path/posix/to_file_url.d.ts +12 -0
  225. package/script/deps/deno.land/std@0.208.0/path/posix/to_file_url.js +26 -0
  226. package/script/deps/deno.land/std@0.208.0/path/posix/to_namespaced_path.d.ts +5 -0
  227. package/script/deps/deno.land/std@0.208.0/path/posix/to_namespaced_path.js +14 -0
  228. package/script/deps/deno.land/{std@0.201.0/path/_relative.d.ts → std@0.208.0/path/relative.d.ts} +1 -8
  229. package/script/deps/deno.land/{std@0.201.0 → std@0.208.0}/path/relative.js +3 -2
  230. package/script/deps/deno.land/std@0.208.0/path/resolve.d.ts +5 -0
  231. package/script/deps/deno.land/{std@0.201.0 → std@0.208.0}/path/resolve.js +4 -3
  232. package/script/deps/deno.land/{std@0.201.0 → std@0.208.0}/path/to_file_url.js +3 -2
  233. package/script/deps/deno.land/std@0.208.0/path/to_namespaced_path.d.ts +5 -0
  234. package/script/deps/deno.land/{std@0.201.0 → std@0.208.0}/path/to_namespaced_path.js +4 -3
  235. package/script/deps/deno.land/std@0.208.0/path/windows/_util.d.ts +3 -0
  236. package/script/deps/deno.land/std@0.208.0/path/windows/_util.js +21 -0
  237. package/script/deps/deno.land/std@0.208.0/path/windows/basename.d.ts +8 -0
  238. package/script/deps/deno.land/std@0.208.0/path/windows/basename.js +34 -0
  239. package/script/deps/deno.land/std@0.208.0/path/windows/common.d.ts +13 -0
  240. package/script/deps/deno.land/std@0.208.0/path/windows/common.js +23 -0
  241. package/script/deps/deno.land/std@0.208.0/path/windows/dirname.d.ts +5 -0
  242. package/script/deps/deno.land/{std@0.201.0/path/_dirname.js → std@0.208.0/path/windows/dirname.js} +9 -44
  243. package/script/deps/deno.land/std@0.208.0/path/windows/extname.d.ts +6 -0
  244. package/script/deps/deno.land/{std@0.201.0/path/_extname.js → std@0.208.0/path/windows/extname.js} +8 -62
  245. package/script/deps/deno.land/std@0.208.0/path/windows/format.d.ts +6 -0
  246. package/script/deps/deno.land/std@0.208.0/path/windows/format.js +15 -0
  247. package/script/deps/deno.land/{std@0.201.0/path/_from_file_url.d.ts → std@0.208.0/path/windows/from_file_url.d.ts} +1 -12
  248. package/script/deps/deno.land/{std@0.201.0/path/_from_file_url.js → std@0.208.0/path/windows/from_file_url.js} +5 -26
  249. package/script/deps/deno.land/std@0.208.0/path/windows/glob_to_regexp.d.ts +57 -0
  250. package/script/deps/deno.land/std@0.208.0/path/windows/glob_to_regexp.js +73 -0
  251. package/script/deps/deno.land/std@0.208.0/path/windows/is_absolute.d.ts +5 -0
  252. package/script/deps/deno.land/{std@0.201.0/path/_is_absolute.js → std@0.208.0/path/windows/is_absolute.js} +7 -15
  253. package/script/deps/deno.land/std@0.208.0/path/windows/is_glob.d.ts +1 -0
  254. package/script/deps/deno.land/std@0.208.0/path/windows/is_glob.js +7 -0
  255. package/script/deps/deno.land/std@0.208.0/path/windows/join.d.ts +5 -0
  256. package/script/deps/deno.land/{std@0.201.0/path/_join.js → std@0.208.0/path/windows/join.js} +8 -30
  257. package/script/deps/deno.land/std@0.208.0/path/windows/join_globs.d.ts +3 -0
  258. package/script/deps/deno.land/std@0.208.0/path/windows/join_globs.js +30 -0
  259. package/script/deps/deno.land/std@0.208.0/path/windows/mod.d.ts +40 -0
  260. package/script/deps/deno.land/std@0.208.0/path/windows/mod.js +61 -0
  261. package/script/deps/deno.land/std@0.208.0/path/windows/normalize.d.ts +7 -0
  262. package/script/deps/deno.land/{std@0.201.0/path/_normalize.js → std@0.208.0/path/windows/normalize.js} +9 -33
  263. package/script/deps/deno.land/std@0.208.0/path/windows/normalize_glob.d.ts +3 -0
  264. package/script/deps/deno.land/std@0.208.0/path/windows/normalize_glob.js +20 -0
  265. package/script/deps/deno.land/std@0.208.0/path/windows/parse.d.ts +6 -0
  266. package/script/deps/deno.land/{std@0.201.0/path/_parse.js → std@0.208.0/path/windows/parse.js} +8 -100
  267. package/script/deps/deno.land/std@0.208.0/path/windows/relative.d.ts +12 -0
  268. package/script/deps/deno.land/std@0.208.0/path/windows/relative.js +125 -0
  269. package/script/deps/deno.land/std@0.208.0/path/windows/resolve.d.ts +5 -0
  270. package/script/deps/deno.land/{std@0.201.0/path/_resolve.js → std@0.208.0/path/windows/resolve.js} +10 -51
  271. package/script/deps/deno.land/std@0.208.0/path/windows/separator.d.ts +2 -0
  272. package/script/deps/deno.land/std@0.208.0/path/windows/separator.js +7 -0
  273. package/{esm/deps/deno.land/std@0.201.0/path/_to_file_url.d.ts → script/deps/deno.land/std@0.208.0/path/windows/to_file_url.d.ts} +1 -12
  274. package/script/deps/deno.land/std@0.208.0/path/windows/to_file_url.js +35 -0
  275. package/script/deps/deno.land/std@0.208.0/path/windows/to_namespaced_path.d.ts +5 -0
  276. package/script/deps/deno.land/{std@0.201.0/path/_to_namespaced_path.js → std@0.208.0/path/windows/to_namespaced_path.js} +11 -20
  277. package/script/deps.d.ts +2 -2
  278. package/script/deps.js +2 -2
  279. package/script/mod.js +2 -2
  280. package/script/src/environment.d.ts +5 -0
  281. package/script/src/environment.js +52 -24
  282. package/script/src/tokenizer.d.ts +7 -2
  283. package/script/src/tokenizer.js +77 -66
  284. package/esm/deps/deno.land/std@0.201.0/path/_basename.d.ts +0 -16
  285. package/esm/deps/deno.land/std@0.201.0/path/_basename.js +0 -78
  286. package/esm/deps/deno.land/std@0.201.0/path/_dirname.d.ts +0 -10
  287. package/esm/deps/deno.land/std@0.201.0/path/_extname.d.ts +0 -12
  288. package/esm/deps/deno.land/std@0.201.0/path/_format.d.ts +0 -11
  289. package/esm/deps/deno.land/std@0.201.0/path/_is_absolute.d.ts +0 -10
  290. package/esm/deps/deno.land/std@0.201.0/path/_join.d.ts +0 -10
  291. package/esm/deps/deno.land/std@0.201.0/path/_normalize.d.ts +0 -14
  292. package/esm/deps/deno.land/std@0.201.0/path/_os.d.ts +0 -4
  293. package/esm/deps/deno.land/std@0.201.0/path/_parse.d.ts +0 -11
  294. package/esm/deps/deno.land/std@0.201.0/path/_relative.d.ts +0 -19
  295. package/esm/deps/deno.land/std@0.201.0/path/_resolve.d.ts +0 -10
  296. package/esm/deps/deno.land/std@0.201.0/path/_to_namespaced_path.d.ts +0 -10
  297. package/esm/deps/deno.land/std@0.201.0/path/_util.d.ts +0 -6
  298. package/esm/deps/deno.land/std@0.201.0/path/posix.d.ts +0 -15
  299. package/esm/deps/deno.land/std@0.201.0/path/posix.js +0 -19
  300. package/esm/deps/deno.land/std@0.201.0/path/win32.d.ts +0 -15
  301. package/esm/deps/deno.land/std@0.201.0/path/win32.js +0 -19
  302. package/script/deps/deno.land/std@0.201.0/path/_basename.d.ts +0 -16
  303. package/script/deps/deno.land/std@0.201.0/path/_basename.js +0 -83
  304. package/script/deps/deno.land/std@0.201.0/path/_dirname.d.ts +0 -10
  305. package/script/deps/deno.land/std@0.201.0/path/_extname.d.ts +0 -12
  306. package/script/deps/deno.land/std@0.201.0/path/_format.d.ts +0 -11
  307. package/script/deps/deno.land/std@0.201.0/path/_format.js +0 -40
  308. package/script/deps/deno.land/std@0.201.0/path/_is_absolute.d.ts +0 -10
  309. package/script/deps/deno.land/std@0.201.0/path/_join.d.ts +0 -10
  310. package/script/deps/deno.land/std@0.201.0/path/_normalize.d.ts +0 -14
  311. package/script/deps/deno.land/std@0.201.0/path/_os.d.ts +0 -4
  312. package/script/deps/deno.land/std@0.201.0/path/_parse.d.ts +0 -11
  313. package/script/deps/deno.land/std@0.201.0/path/_relative.js +0 -221
  314. package/script/deps/deno.land/std@0.201.0/path/_resolve.d.ts +0 -10
  315. package/script/deps/deno.land/std@0.201.0/path/_to_file_url.js +0 -66
  316. package/script/deps/deno.land/std@0.201.0/path/_to_namespaced_path.d.ts +0 -10
  317. package/script/deps/deno.land/std@0.201.0/path/_util.d.ts +0 -6
  318. package/script/deps/deno.land/std@0.201.0/path/posix.d.ts +0 -15
  319. package/script/deps/deno.land/std@0.201.0/path/posix.js +0 -35
  320. package/script/deps/deno.land/std@0.201.0/path/win32.d.ts +0 -15
  321. package/script/deps/deno.land/std@0.201.0/path/win32.js +0 -35
  322. /package/esm/deps/deno.land/{std@0.201.0 → std@0.208.0}/assert/assert.d.ts +0 -0
  323. /package/esm/deps/deno.land/{std@0.201.0 → std@0.208.0}/assert/assert.js +0 -0
  324. /package/esm/deps/deno.land/{std@0.201.0 → std@0.208.0}/assert/assertion_error.d.ts +0 -0
  325. /package/esm/deps/deno.land/{std@0.201.0 → std@0.208.0}/assert/assertion_error.js +0 -0
  326. /package/esm/deps/deno.land/{std@0.201.0 → std@0.208.0}/html/entities.d.ts +0 -0
  327. /package/esm/deps/deno.land/{std@0.201.0 → std@0.208.0}/html/entities.js +0 -0
  328. /package/esm/deps/deno.land/{std@0.201.0 → std@0.208.0}/html/mod.d.ts +0 -0
  329. /package/esm/deps/deno.land/{std@0.201.0 → std@0.208.0}/html/mod.js +0 -0
  330. /package/esm/deps/deno.land/{std@0.201.0/path/_constants.d.ts → std@0.208.0/path/_common/constants.d.ts} +0 -0
  331. /package/esm/deps/deno.land/{std@0.201.0/path/_constants.js → std@0.208.0/path/_common/constants.js} +0 -0
  332. /package/esm/deps/deno.land/{std@0.201.0 → std@0.208.0}/path/_interface.d.ts +0 -0
  333. /package/esm/deps/deno.land/{std@0.201.0 → std@0.208.0}/path/_interface.js +0 -0
  334. /package/esm/deps/deno.land/{std@0.201.0 → std@0.208.0}/path/basename.d.ts +0 -0
  335. /package/esm/deps/deno.land/{std@0.201.0 → std@0.208.0}/path/common.d.ts +0 -0
  336. /package/esm/deps/deno.land/{std@0.201.0 → std@0.208.0}/path/dirname.d.ts +0 -0
  337. /package/esm/deps/deno.land/{std@0.201.0 → std@0.208.0}/path/extname.d.ts +0 -0
  338. /package/esm/deps/deno.land/{std@0.201.0 → std@0.208.0}/path/format.d.ts +0 -0
  339. /package/esm/deps/deno.land/{std@0.201.0 → std@0.208.0}/path/from_file_url.d.ts +0 -0
  340. /package/esm/deps/deno.land/{std@0.201.0 → std@0.208.0}/path/is_absolute.d.ts +0 -0
  341. /package/esm/deps/deno.land/{std@0.201.0 → std@0.208.0}/path/join.d.ts +0 -0
  342. /package/esm/deps/deno.land/{std@0.201.0 → std@0.208.0}/path/normalize.d.ts +0 -0
  343. /package/esm/deps/deno.land/{std@0.201.0 → std@0.208.0}/path/parse.d.ts +0 -0
  344. /package/{script/deps/deno.land/std@0.201.0/path → esm/deps/deno.land/std@0.208.0/path/posix}/basename.d.ts +0 -0
  345. /package/{script/deps/deno.land/std@0.201.0/path → esm/deps/deno.land/std@0.208.0/path/posix}/common.d.ts +0 -0
  346. /package/{script/deps/deno.land/std@0.201.0/path → esm/deps/deno.land/std@0.208.0/path/posix}/dirname.d.ts +0 -0
  347. /package/{script/deps/deno.land/std@0.201.0/path → esm/deps/deno.land/std@0.208.0/path/posix}/extname.d.ts +0 -0
  348. /package/{script/deps/deno.land/std@0.201.0/path → esm/deps/deno.land/std@0.208.0/path/posix}/is_absolute.d.ts +0 -0
  349. /package/{script/deps/deno.land/std@0.201.0/path → esm/deps/deno.land/std@0.208.0/path/posix}/join.d.ts +0 -0
  350. /package/{script/deps/deno.land/std@0.201.0/path → esm/deps/deno.land/std@0.208.0/path/posix}/normalize.d.ts +0 -0
  351. /package/esm/deps/deno.land/{std@0.201.0/path → std@0.208.0/path/posix}/resolve.d.ts +0 -0
  352. /package/esm/deps/deno.land/{std@0.201.0/path → std@0.208.0/path/posix}/to_namespaced_path.d.ts +0 -0
  353. /package/esm/deps/deno.land/{std@0.201.0 → std@0.208.0}/path/relative.d.ts +0 -0
  354. /package/{script/deps/deno.land/std@0.201.0 → esm/deps/deno.land/std@0.208.0}/path/resolve.d.ts +0 -0
  355. /package/esm/deps/deno.land/{std@0.201.0 → std@0.208.0}/path/separator.d.ts +0 -0
  356. /package/esm/deps/deno.land/{std@0.201.0 → std@0.208.0}/path/separator.js +0 -0
  357. /package/esm/deps/deno.land/{std@0.201.0 → std@0.208.0}/path/to_file_url.d.ts +0 -0
  358. /package/{script/deps/deno.land/std@0.201.0 → esm/deps/deno.land/std@0.208.0}/path/to_namespaced_path.d.ts +0 -0
  359. /package/{script/deps/deno.land/std@0.201.0/path → esm/deps/deno.land/std@0.208.0/path/windows}/relative.d.ts +0 -0
  360. /package/script/deps/deno.land/{std@0.201.0 → std@0.208.0}/assert/assert.d.ts +0 -0
  361. /package/script/deps/deno.land/{std@0.201.0 → std@0.208.0}/assert/assert.js +0 -0
  362. /package/script/deps/deno.land/{std@0.201.0 → std@0.208.0}/assert/assertion_error.d.ts +0 -0
  363. /package/script/deps/deno.land/{std@0.201.0 → std@0.208.0}/assert/assertion_error.js +0 -0
  364. /package/script/deps/deno.land/{std@0.201.0 → std@0.208.0}/html/entities.d.ts +0 -0
  365. /package/script/deps/deno.land/{std@0.201.0 → std@0.208.0}/html/entities.js +0 -0
  366. /package/script/deps/deno.land/{std@0.201.0 → std@0.208.0}/html/mod.d.ts +0 -0
  367. /package/script/deps/deno.land/{std@0.201.0 → std@0.208.0}/html/mod.js +0 -0
  368. /package/script/deps/deno.land/{std@0.201.0/path/_constants.d.ts → std@0.208.0/path/_common/constants.d.ts} +0 -0
  369. /package/script/deps/deno.land/{std@0.201.0/path/_constants.js → std@0.208.0/path/_common/constants.js} +0 -0
  370. /package/script/deps/deno.land/{std@0.201.0 → std@0.208.0}/path/_interface.d.ts +0 -0
  371. /package/script/deps/deno.land/{std@0.201.0 → std@0.208.0}/path/_interface.js +0 -0
  372. /package/script/deps/deno.land/{std@0.201.0 → std@0.208.0}/path/format.d.ts +0 -0
  373. /package/script/deps/deno.land/{std@0.201.0 → std@0.208.0}/path/from_file_url.d.ts +0 -0
  374. /package/script/deps/deno.land/{std@0.201.0 → std@0.208.0}/path/parse.d.ts +0 -0
  375. /package/script/deps/deno.land/{std@0.201.0 → std@0.208.0}/path/separator.d.ts +0 -0
  376. /package/script/deps/deno.land/{std@0.201.0 → std@0.208.0}/path/separator.js +0 -0
  377. /package/script/deps/deno.land/{std@0.201.0 → std@0.208.0}/path/to_file_url.d.ts +0 -0
@@ -1,104 +1,13 @@
1
1
  // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
2
2
  // This module is browser compatible.
3
- import { CHAR_COLON, CHAR_DOT } from "./_constants.js";
4
- import { assertPath, isPathSeparator, isPosixPathSeparator, isWindowsDeviceRoot, stripTrailingSeparators, } from "./_util.js";
3
+ import { CHAR_COLON, CHAR_DOT } from "../_common/constants.js";
4
+ import { assertPath } from "../_common/assert_path.js";
5
+ import { isPathSeparator, isWindowsDeviceRoot } from "./_util.js";
5
6
  /**
6
7
  * Return a `ParsedPath` object of the `path`.
7
8
  * @param path to process
8
9
  */
9
- export function posixParse(path) {
10
- assertPath(path);
11
- const ret = { root: "", dir: "", base: "", ext: "", name: "" };
12
- if (path.length === 0)
13
- return ret;
14
- const isAbsolute = isPosixPathSeparator(path.charCodeAt(0));
15
- let start;
16
- if (isAbsolute) {
17
- ret.root = "/";
18
- start = 1;
19
- }
20
- else {
21
- start = 0;
22
- }
23
- let startDot = -1;
24
- let startPart = 0;
25
- let end = -1;
26
- let matchedSlash = true;
27
- let i = path.length - 1;
28
- // Track the state of characters (if any) we see before our first dot and
29
- // after any path separator we find
30
- let preDotState = 0;
31
- // Get non-dir info
32
- for (; i >= start; --i) {
33
- const code = path.charCodeAt(i);
34
- if (isPosixPathSeparator(code)) {
35
- // If we reached a path separator that was not part of a set of path
36
- // separators at the end of the string, stop now
37
- if (!matchedSlash) {
38
- startPart = i + 1;
39
- break;
40
- }
41
- continue;
42
- }
43
- if (end === -1) {
44
- // We saw the first non-path separator, mark this as the end of our
45
- // extension
46
- matchedSlash = false;
47
- end = i + 1;
48
- }
49
- if (code === CHAR_DOT) {
50
- // If this is our first dot, mark it as the start of our extension
51
- if (startDot === -1)
52
- startDot = i;
53
- else if (preDotState !== 1)
54
- preDotState = 1;
55
- }
56
- else if (startDot !== -1) {
57
- // We saw a non-dot and non-path separator before our dot, so we should
58
- // have a good chance at having a non-empty extension
59
- preDotState = -1;
60
- }
61
- }
62
- if (startDot === -1 ||
63
- end === -1 ||
64
- // We saw a non-dot character immediately before the dot
65
- preDotState === 0 ||
66
- // The (right-most) trimmed path component is exactly '..'
67
- (preDotState === 1 && startDot === end - 1 && startDot === startPart + 1)) {
68
- if (end !== -1) {
69
- if (startPart === 0 && isAbsolute) {
70
- ret.base = ret.name = path.slice(1, end);
71
- }
72
- else {
73
- ret.base = ret.name = path.slice(startPart, end);
74
- }
75
- }
76
- // Fallback to '/' in case there is no basename
77
- ret.base = ret.base || "/";
78
- }
79
- else {
80
- if (startPart === 0 && isAbsolute) {
81
- ret.name = path.slice(1, startDot);
82
- ret.base = path.slice(1, end);
83
- }
84
- else {
85
- ret.name = path.slice(startPart, startDot);
86
- ret.base = path.slice(startPart, end);
87
- }
88
- ret.ext = path.slice(startDot, end);
89
- }
90
- if (startPart > 0) {
91
- ret.dir = stripTrailingSeparators(path.slice(0, startPart - 1), isPosixPathSeparator);
92
- }
93
- else if (isAbsolute)
94
- ret.dir = "/";
95
- return ret;
96
- }
97
- /**
98
- * Return a `ParsedPath` object of the `path`.
99
- * @param path to process
100
- */
101
- export function windowsParse(path) {
10
+ export function parse(path) {
102
11
  assertPath(path);
103
12
  const ret = { root: "", dir: "", base: "", ext: "", name: "" };
104
13
  const len = path.length;
@@ -1,103 +1,8 @@
1
1
  // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
2
2
  // This module is browser compatible.
3
- import { CHAR_BACKWARD_SLASH } from "./_constants.js";
4
- import { assertPath, isPosixPathSeparator } from "./_util.js";
5
- import { posixResolve, windowsResolve } from "./_resolve.js";
6
- function assertArgs(from, to) {
7
- assertPath(from);
8
- assertPath(to);
9
- if (from === to)
10
- return "";
11
- }
12
- /**
13
- * Return the relative path from `from` to `to` based on current working directory.
14
- *
15
- * @param from path in current working directory
16
- * @param to path in current working directory
17
- */
18
- export function posixRelative(from, to) {
19
- assertArgs(from, to);
20
- from = posixResolve(from);
21
- to = posixResolve(to);
22
- if (from === to)
23
- return "";
24
- // Trim any leading backslashes
25
- let fromStart = 1;
26
- const fromEnd = from.length;
27
- for (; fromStart < fromEnd; ++fromStart) {
28
- if (!isPosixPathSeparator(from.charCodeAt(fromStart)))
29
- break;
30
- }
31
- const fromLen = fromEnd - fromStart;
32
- // Trim any leading backslashes
33
- let toStart = 1;
34
- const toEnd = to.length;
35
- for (; toStart < toEnd; ++toStart) {
36
- if (!isPosixPathSeparator(to.charCodeAt(toStart)))
37
- break;
38
- }
39
- const toLen = toEnd - toStart;
40
- // Compare paths to find the longest common path from root
41
- const length = fromLen < toLen ? fromLen : toLen;
42
- let lastCommonSep = -1;
43
- let i = 0;
44
- for (; i <= length; ++i) {
45
- if (i === length) {
46
- if (toLen > length) {
47
- if (isPosixPathSeparator(to.charCodeAt(toStart + i))) {
48
- // We get here if `from` is the exact base path for `to`.
49
- // For example: from='/foo/bar'; to='/foo/bar/baz'
50
- return to.slice(toStart + i + 1);
51
- }
52
- else if (i === 0) {
53
- // We get here if `from` is the root
54
- // For example: from='/'; to='/foo'
55
- return to.slice(toStart + i);
56
- }
57
- }
58
- else if (fromLen > length) {
59
- if (isPosixPathSeparator(from.charCodeAt(fromStart + i))) {
60
- // We get here if `to` is the exact base path for `from`.
61
- // For example: from='/foo/bar/baz'; to='/foo/bar'
62
- lastCommonSep = i;
63
- }
64
- else if (i === 0) {
65
- // We get here if `to` is the root.
66
- // For example: from='/foo'; to='/'
67
- lastCommonSep = 0;
68
- }
69
- }
70
- break;
71
- }
72
- const fromCode = from.charCodeAt(fromStart + i);
73
- const toCode = to.charCodeAt(toStart + i);
74
- if (fromCode !== toCode)
75
- break;
76
- else if (isPosixPathSeparator(fromCode))
77
- lastCommonSep = i;
78
- }
79
- let out = "";
80
- // Generate the relative path based on the path difference between `to`
81
- // and `from`
82
- for (i = fromStart + lastCommonSep + 1; i <= fromEnd; ++i) {
83
- if (i === fromEnd || isPosixPathSeparator(from.charCodeAt(i))) {
84
- if (out.length === 0)
85
- out += "..";
86
- else
87
- out += "/..";
88
- }
89
- }
90
- // Lastly, append the rest of the destination (`to`) path that comes after
91
- // the common path parts
92
- if (out.length > 0)
93
- return out + to.slice(toStart + lastCommonSep);
94
- else {
95
- toStart += lastCommonSep;
96
- if (isPosixPathSeparator(to.charCodeAt(toStart)))
97
- ++toStart;
98
- return to.slice(toStart);
99
- }
100
- }
3
+ import { CHAR_BACKWARD_SLASH } from "../_common/constants.js";
4
+ import { resolve } from "./resolve.js";
5
+ import { assertArgs } from "../_common/relative.js";
101
6
  /**
102
7
  * Return the relative path from `from` to `to` based on current working directory.
103
8
  *
@@ -109,10 +14,10 @@ export function posixRelative(from, to) {
109
14
  * @param from path in current working directory
110
15
  * @param to path in current working directory
111
16
  */
112
- export function windowsRelative(from, to) {
17
+ export function relative(from, to) {
113
18
  assertArgs(from, to);
114
- const fromOrig = windowsResolve(from);
115
- const toOrig = windowsResolve(to);
19
+ const fromOrig = resolve(from);
20
+ const toOrig = resolve(to);
116
21
  if (fromOrig === toOrig)
117
22
  return "";
118
23
  from = fromOrig.toLowerCase();
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Resolves path segments into a `path`
3
+ * @param pathSegments to process to path
4
+ */
5
+ export declare function resolve(...pathSegments: string[]): string;
@@ -1,55 +1,15 @@
1
1
  // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
2
2
  // This module is browser compatible.
3
- import * as dntShim from "../../../../_dnt.shims.js";
4
- import { CHAR_COLON } from "./_constants.js";
5
- import { assertPath, isPathSeparator, isPosixPathSeparator, isWindowsDeviceRoot, normalizeString, } from "./_util.js";
3
+ import * as dntShim from "../../../../../_dnt.shims.js";
4
+ import { CHAR_COLON } from "../_common/constants.js";
5
+ import { normalizeString } from "../_common/normalize_string.js";
6
+ import { assertPath } from "../_common/assert_path.js";
7
+ import { isPathSeparator, isWindowsDeviceRoot } from "./_util.js";
6
8
  /**
7
9
  * Resolves path segments into a `path`
8
10
  * @param pathSegments to process to path
9
11
  */
10
- export function posixResolve(...pathSegments) {
11
- let resolvedPath = "";
12
- let resolvedAbsolute = false;
13
- for (let i = pathSegments.length - 1; i >= -1 && !resolvedAbsolute; i--) {
14
- let path;
15
- if (i >= 0)
16
- path = pathSegments[i];
17
- else {
18
- // deno-lint-ignore no-explicit-any
19
- const { Deno } = dntShim.dntGlobalThis;
20
- if (typeof Deno?.cwd !== "function") {
21
- throw new TypeError("Resolved a relative path without a CWD.");
22
- }
23
- path = Deno.cwd();
24
- }
25
- assertPath(path);
26
- // Skip empty entries
27
- if (path.length === 0) {
28
- continue;
29
- }
30
- resolvedPath = `${path}/${resolvedPath}`;
31
- resolvedAbsolute = isPosixPathSeparator(path.charCodeAt(0));
32
- }
33
- // At this point the path should be resolved to a full absolute path, but
34
- // handle relative paths to be safe (might happen when Deno.cwd() fails)
35
- // Normalize the path
36
- resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute, "/", isPosixPathSeparator);
37
- if (resolvedAbsolute) {
38
- if (resolvedPath.length > 0)
39
- return `/${resolvedPath}`;
40
- else
41
- return "/";
42
- }
43
- else if (resolvedPath.length > 0)
44
- return resolvedPath;
45
- else
46
- return ".";
47
- }
48
- /**
49
- * Resolves path segments into a `path`
50
- * @param pathSegments to process to path
51
- */
52
- export function windowsResolve(...pathSegments) {
12
+ export function resolve(...pathSegments) {
53
13
  let resolvedDevice = "";
54
14
  let resolvedTail = "";
55
15
  let resolvedAbsolute = false;
@@ -0,0 +1,2 @@
1
+ export declare const SEP = "\\";
2
+ export declare const SEP_PATTERN: RegExp;
@@ -0,0 +1,4 @@
1
+ // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
2
+ // This module is browser compatible.
3
+ export const SEP = "\\";
4
+ export const SEP_PATTERN = /[\\/]+/;
@@ -1,15 +1,4 @@
1
1
  /// <reference types="node" />
2
- /**
3
- * Converts a path string to a file URL.
4
- *
5
- * ```ts
6
- * import { toFileUrl } from "https://deno.land/std@$STD_VERSION/path/posix.ts";
7
- *
8
- * toFileUrl("/home/foo"); // new URL("file:///home/foo")
9
- * ```
10
- * @param path to convert to file URL
11
- */
12
- export declare function posixToFileUrl(path: string): import("url").URL;
13
2
  /**
14
3
  * Converts a path string to a file URL.
15
4
  *
@@ -22,4 +11,4 @@ export declare function posixToFileUrl(path: string): import("url").URL;
22
11
  * ```
23
12
  * @param path to convert to file URL
24
13
  */
25
- export declare function windowsToFileUrl(path: string): URL;
14
+ export declare function toFileUrl(path: string): URL;
@@ -1,37 +1,7 @@
1
1
  // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
2
2
  // This module is browser compatible.
3
- import { posixIsAbsolute, windowsIsAbsolute } from "./_is_absolute.js";
4
- const WHITESPACE_ENCODINGS = {
5
- "\u0009": "%09",
6
- "\u000A": "%0A",
7
- "\u000B": "%0B",
8
- "\u000C": "%0C",
9
- "\u000D": "%0D",
10
- "\u0020": "%20",
11
- };
12
- function encodeWhitespace(string) {
13
- return string.replaceAll(/[\s]/g, (c) => {
14
- return WHITESPACE_ENCODINGS[c] ?? c;
15
- });
16
- }
17
- /**
18
- * Converts a path string to a file URL.
19
- *
20
- * ```ts
21
- * import { toFileUrl } from "https://deno.land/std@$STD_VERSION/path/posix.ts";
22
- *
23
- * toFileUrl("/home/foo"); // new URL("file:///home/foo")
24
- * ```
25
- * @param path to convert to file URL
26
- */
27
- export function posixToFileUrl(path) {
28
- if (!posixIsAbsolute(path)) {
29
- throw new TypeError("Must be an absolute path.");
30
- }
31
- const url = new URL("file:///");
32
- url.pathname = encodeWhitespace(path.replace(/%/g, "%25").replace(/\\/g, "%5C"));
33
- return url;
34
- }
3
+ import { encodeWhitespace } from "../_common/to_file_url.js";
4
+ import { isAbsolute } from "./is_absolute.js";
35
5
  /**
36
6
  * Converts a path string to a file URL.
37
7
  *
@@ -44,8 +14,8 @@ export function posixToFileUrl(path) {
44
14
  * ```
45
15
  * @param path to convert to file URL
46
16
  */
47
- export function windowsToFileUrl(path) {
48
- if (!windowsIsAbsolute(path)) {
17
+ export function toFileUrl(path) {
18
+ if (!isAbsolute(path)) {
49
19
  throw new TypeError("Must be an absolute path.");
50
20
  }
51
21
  const [, hostname, pathname] = path.match(/^(?:[/\\]{2}([^/\\]+)(?=[/\\](?:[^/\\]|$)))?(.*)/);
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Resolves path to a namespace path
3
+ * @param path to resolve to namespace
4
+ */
5
+ export declare function toNamespacedPath(path: string): string;
@@ -1,27 +1,19 @@
1
1
  // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
2
2
  // This module is browser compatible.
3
- import { CHAR_BACKWARD_SLASH, CHAR_COLON, CHAR_DOT, CHAR_QUESTION_MARK, } from "./_constants.js";
3
+ import { CHAR_BACKWARD_SLASH, CHAR_COLON, CHAR_DOT, CHAR_QUESTION_MARK, } from "../_common/constants.js";
4
4
  import { isWindowsDeviceRoot } from "./_util.js";
5
- import { windowsResolve } from "./_resolve.js";
5
+ import { resolve } from "./resolve.js";
6
6
  /**
7
7
  * Resolves path to a namespace path
8
8
  * @param path to resolve to namespace
9
9
  */
10
- export function posixToNamespacedPath(path) {
11
- // Non-op on posix systems
12
- return path;
13
- }
14
- /**
15
- * Resolves path to a namespace path
16
- * @param path to resolve to namespace
17
- */
18
- export function windowsToNamespacedPath(path) {
10
+ export function toNamespacedPath(path) {
19
11
  // Note: this will *probably* throw somewhere.
20
12
  if (typeof path !== "string")
21
13
  return path;
22
14
  if (path.length === 0)
23
15
  return "";
24
- const resolvedPath = windowsResolve(path);
16
+ const resolvedPath = resolve(path);
25
17
  if (resolvedPath.length >= 3) {
26
18
  if (resolvedPath.charCodeAt(0) === CHAR_BACKWARD_SLASH) {
27
19
  // Possible UNC root
package/esm/deps.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export * as path from "./deps/deno.land/std@0.201.0/path/mod.js";
2
- export * as html from "./deps/deno.land/std@0.201.0/html/mod.js";
1
+ export * as path from "./deps/deno.land/std@0.208.0/path/mod.js";
2
+ export * as html from "./deps/deno.land/std@0.208.0/html/mod.js";
package/esm/deps.js CHANGED
@@ -1,2 +1,2 @@
1
- export * as path from "./deps/deno.land/std@0.201.0/path/mod.js";
2
- export * as html from "./deps/deno.land/std@0.201.0/html/mod.js";
1
+ export * as path from "./deps/deno.land/std@0.208.0/path/mod.js";
2
+ export * as html from "./deps/deno.land/std@0.208.0/html/mod.js";
package/esm/mod.js CHANGED
@@ -20,8 +20,8 @@ export default function (options = {}) {
20
20
  const env = new Environment({
21
21
  loader,
22
22
  dataVarname: options.dataVarname || "it",
23
- autoescape: options.autoescape || false,
24
- useWith: options.useWith || true,
23
+ autoescape: options.autoescape ?? false,
24
+ useWith: options.useWith ?? true,
25
25
  });
26
26
  // Register basic plugins
27
27
  env.use(ifTag());
@@ -6,11 +6,13 @@ export interface TemplateResult {
6
6
  }
7
7
  export interface Template {
8
8
  (data?: Record<string, unknown>): Promise<TemplateResult>;
9
+ source: string;
9
10
  code: string;
10
11
  file?: string;
11
12
  }
12
13
  export interface TemplateSync {
13
14
  (data?: Record<string, unknown>): TemplateResult;
15
+ source: string;
14
16
  code: string;
15
17
  file?: string;
16
18
  }
@@ -39,4 +41,7 @@ export declare class Environment {
39
41
  load(file: string, from?: string): Promise<Template>;
40
42
  compileTokens(tokens: Token[], outputVar?: string, stopAt?: string[]): string[];
41
43
  compileFilters(tokens: Token[], output: string, autoescape?: boolean): string;
44
+ createError(path: string, source: string, position: number, cause: Error): Error;
42
45
  }
46
+ /** Returns the number and code of the errored line */
47
+ export declare function errorLine(source: string, pos: number): [number, number, string];
@@ -34,30 +34,30 @@ export class Environment {
34
34
  return template(data);
35
35
  }
36
36
  compile(source, path, defaults, sync = false) {
37
- try {
38
- const tokens = tokenize(source);
39
- const code = this.compileTokens(tokens).join("\n");
40
- const { dataVarname, useWith } = this.options;
41
- const constructor = new Function("__file", "__env", "__defaults", `return${sync ? "" : " async"} function (${dataVarname}) {
42
- try {
43
- ${dataVarname} = Object.assign({}, __defaults, ${dataVarname});
44
- const __exports = { content: "" };
45
- ${useWith ? `with (${dataVarname}) {${code}}` : code}
46
- return __exports;
47
- } catch (cause) {
48
- throw new Error(\`Error rendering template: \${__file}\`, { cause });
49
- }
50
- }
51
- `);
52
- // console.log(code);
53
- const template = constructor(path, this, defaults);
54
- template.file = path;
55
- template.code = code;
56
- return template;
37
+ const { tokens, position, error } = tokenize(source);
38
+ if (error) {
39
+ throw this.createError(path || "unknown", source, position, error);
57
40
  }
58
- catch (cause) {
59
- throw new Error(`Error compiling template: ${path || source}`, { cause });
41
+ const code = this.compileTokens(tokens).join("\n");
42
+ const { dataVarname, useWith } = this.options;
43
+ const constructor = new Function("__file", "__env", "__defaults", `return${sync ? "" : " async"} function (${dataVarname}) {
44
+ let __pos = 0;
45
+ try {
46
+ ${dataVarname} = Object.assign({}, __defaults, ${dataVarname});
47
+ const __exports = { content: "" };
48
+ ${useWith ? `with (${dataVarname}) {${code}}` : code}
49
+ return __exports;
50
+ } catch (cause) {
51
+ const template = __env.cache.get(__file);
52
+ throw __env.createError(__file, template?.source || "", __pos, cause);
60
53
  }
54
+ }
55
+ `);
56
+ const template = constructor(path, this, defaults);
57
+ template.file = path;
58
+ template.code = code;
59
+ template.source = source;
60
+ return template;
61
61
  }
62
62
  async load(file, from) {
63
63
  const path = from ? this.options.loader.resolve(from, file) : file;
@@ -74,7 +74,7 @@ export class Environment {
74
74
  if (stopAt && tokens[0][0] === "tag" && stopAt.includes(tokens[0][1])) {
75
75
  break;
76
76
  }
77
- const [type, code] = tokens.shift();
77
+ const [type, code, pos] = tokens.shift();
78
78
  if (type === "comment") {
79
79
  continue;
80
80
  }
@@ -83,6 +83,7 @@ export class Environment {
83
83
  continue;
84
84
  }
85
85
  if (type === "tag") {
86
+ compiled.push(`__pos = ${pos};`);
86
87
  for (const tag of this.tags) {
87
88
  const compiledTag = tag(this, code, outputVar, tokens);
88
89
  if (typeof compiledTag === "string") {
@@ -132,6 +133,13 @@ export class Environment {
132
133
  }
133
134
  return output;
134
135
  }
136
+ createError(path, source, position, cause) {
137
+ if (!source) {
138
+ return cause;
139
+ }
140
+ const [line, column, code] = errorLine(source, position);
141
+ return new Error(`Error in the template ${path}:${line}:${column}\n\n${code.trim()}\n\n> ${cause.message}\n`, { cause });
142
+ }
135
143
  }
136
144
  function isGlobal(name) {
137
145
  // @ts-ignore TS doesn't know about globalThis
@@ -144,3 +152,22 @@ function isGlobal(name) {
144
152
  return typeof dntShim.dntGlobalThis[obj]?.[prop] === "function";
145
153
  }
146
154
  }
155
+ /** Returns the number and code of the errored line */
156
+ export function errorLine(source, pos) {
157
+ let line = 1;
158
+ let column = 1;
159
+ for (let index = 0; index < pos; index++) {
160
+ if (source[index] === "\n" ||
161
+ (source[index] === "\r" && source[index + 1] === "\n")) {
162
+ line++;
163
+ column = 1;
164
+ if (source[index] === "\r") {
165
+ index++;
166
+ }
167
+ }
168
+ else {
169
+ column++;
170
+ }
171
+ }
172
+ return [line, column, source.split("\n")[line - 1]];
173
+ }
@@ -1,6 +1,11 @@
1
1
  export type TokenType = "string" | "tag" | "filter" | "comment";
2
- export type Token = [TokenType, string];
3
- export default function tokenize(source: string): Token[];
2
+ export type Token = [TokenType, string, number?];
3
+ export interface TokenizeResult {
4
+ tokens: Token[];
5
+ position: number;
6
+ error: Error | undefined;
7
+ }
8
+ export default function tokenize(source: string): TokenizeResult;
4
9
  /**
5
10
  * Parse a tag and return the indexes of the start and end brackets, and the filters between.
6
11
  * For example: {{ tag |> filter1 |> filter2 }} => [2, 9, 20, 31]