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
@@ -23,60 +23,19 @@ var __importStar = (this && this.__importStar) || function (mod) {
23
23
  return result;
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.windowsResolve = exports.posixResolve = void 0;
26
+ exports.resolve = void 0;
27
27
  // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
28
28
  // This module is browser compatible.
29
- const dntShim = __importStar(require("../../../../_dnt.shims.js"));
30
- const _constants_js_1 = require("./_constants.js");
29
+ const dntShim = __importStar(require("../../../../../_dnt.shims.js"));
30
+ const constants_js_1 = require("../_common/constants.js");
31
+ const normalize_string_js_1 = require("../_common/normalize_string.js");
32
+ const assert_path_js_1 = require("../_common/assert_path.js");
31
33
  const _util_js_1 = require("./_util.js");
32
34
  /**
33
35
  * Resolves path segments into a `path`
34
36
  * @param pathSegments to process to path
35
37
  */
36
- function posixResolve(...pathSegments) {
37
- let resolvedPath = "";
38
- let resolvedAbsolute = false;
39
- for (let i = pathSegments.length - 1; i >= -1 && !resolvedAbsolute; i--) {
40
- let path;
41
- if (i >= 0)
42
- path = pathSegments[i];
43
- else {
44
- // deno-lint-ignore no-explicit-any
45
- const { Deno } = dntShim.dntGlobalThis;
46
- if (typeof Deno?.cwd !== "function") {
47
- throw new TypeError("Resolved a relative path without a CWD.");
48
- }
49
- path = Deno.cwd();
50
- }
51
- (0, _util_js_1.assertPath)(path);
52
- // Skip empty entries
53
- if (path.length === 0) {
54
- continue;
55
- }
56
- resolvedPath = `${path}/${resolvedPath}`;
57
- resolvedAbsolute = (0, _util_js_1.isPosixPathSeparator)(path.charCodeAt(0));
58
- }
59
- // At this point the path should be resolved to a full absolute path, but
60
- // handle relative paths to be safe (might happen when Deno.cwd() fails)
61
- // Normalize the path
62
- resolvedPath = (0, _util_js_1.normalizeString)(resolvedPath, !resolvedAbsolute, "/", _util_js_1.isPosixPathSeparator);
63
- if (resolvedAbsolute) {
64
- if (resolvedPath.length > 0)
65
- return `/${resolvedPath}`;
66
- else
67
- return "/";
68
- }
69
- else if (resolvedPath.length > 0)
70
- return resolvedPath;
71
- else
72
- return ".";
73
- }
74
- exports.posixResolve = posixResolve;
75
- /**
76
- * Resolves path segments into a `path`
77
- * @param pathSegments to process to path
78
- */
79
- function windowsResolve(...pathSegments) {
38
+ function resolve(...pathSegments) {
80
39
  let resolvedDevice = "";
81
40
  let resolvedTail = "";
82
41
  let resolvedAbsolute = false;
@@ -105,7 +64,7 @@ function windowsResolve(...pathSegments) {
105
64
  path = `${resolvedDevice}\\`;
106
65
  }
107
66
  }
108
- (0, _util_js_1.assertPath)(path);
67
+ (0, assert_path_js_1.assertPath)(path);
109
68
  const len = path.length;
110
69
  // Skip empty entries
111
70
  if (len === 0)
@@ -166,7 +125,7 @@ function windowsResolve(...pathSegments) {
166
125
  }
167
126
  else if ((0, _util_js_1.isWindowsDeviceRoot)(code)) {
168
127
  // Possible device root
169
- if (path.charCodeAt(1) === _constants_js_1.CHAR_COLON) {
128
+ if (path.charCodeAt(1) === constants_js_1.CHAR_COLON) {
170
129
  device = path.slice(0, 2);
171
130
  rootEnd = 2;
172
131
  if (len > 2) {
@@ -205,7 +164,7 @@ function windowsResolve(...pathSegments) {
205
164
  // but handle relative paths to be safe (might happen when Deno.cwd()
206
165
  // fails)
207
166
  // Normalize the tail path
208
- resolvedTail = (0, _util_js_1.normalizeString)(resolvedTail, !resolvedAbsolute, "\\", _util_js_1.isPathSeparator);
167
+ resolvedTail = (0, normalize_string_js_1.normalizeString)(resolvedTail, !resolvedAbsolute, "\\", _util_js_1.isPathSeparator);
209
168
  return resolvedDevice + (resolvedAbsolute ? "\\" : "") + resolvedTail || ".";
210
169
  }
211
- exports.windowsResolve = windowsResolve;
170
+ exports.resolve = resolve;
@@ -0,0 +1,2 @@
1
+ export declare const SEP = "\\";
2
+ export declare const SEP_PATTERN: RegExp;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
3
+ // This module is browser compatible.
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.SEP_PATTERN = exports.SEP = void 0;
6
+ exports.SEP = "\\";
7
+ exports.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;
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
3
+ // This module is browser compatible.
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.toFileUrl = void 0;
6
+ const to_file_url_js_1 = require("../_common/to_file_url.js");
7
+ const is_absolute_js_1 = require("./is_absolute.js");
8
+ /**
9
+ * Converts a path string to a file URL.
10
+ *
11
+ * ```ts
12
+ * import { toFileUrl } from "https://deno.land/std@$STD_VERSION/path/win32.ts";
13
+ *
14
+ * toFileUrl("\\home\\foo"); // new URL("file:///home/foo")
15
+ * toFileUrl("C:\\Users\\foo"); // new URL("file:///C:/Users/foo")
16
+ * toFileUrl("\\\\127.0.0.1\\home\\foo"); // new URL("file://127.0.0.1/home/foo")
17
+ * ```
18
+ * @param path to convert to file URL
19
+ */
20
+ function toFileUrl(path) {
21
+ if (!(0, is_absolute_js_1.isAbsolute)(path)) {
22
+ throw new TypeError("Must be an absolute path.");
23
+ }
24
+ const [, hostname, pathname] = path.match(/^(?:[/\\]{2}([^/\\]+)(?=[/\\](?:[^/\\]|$)))?(.*)/);
25
+ const url = new URL("file:///");
26
+ url.pathname = (0, to_file_url_js_1.encodeWhitespace)(pathname.replace(/%/g, "%25"));
27
+ if (hostname !== undefined && hostname !== "localhost") {
28
+ url.hostname = hostname;
29
+ if (!url.hostname) {
30
+ throw new TypeError("Invalid hostname.");
31
+ }
32
+ }
33
+ return url;
34
+ }
35
+ exports.toFileUrl = toFileUrl;
@@ -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;
@@ -2,36 +2,27 @@
2
2
  // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
3
3
  // This module is browser compatible.
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.windowsToNamespacedPath = exports.posixToNamespacedPath = void 0;
6
- const _constants_js_1 = require("./_constants.js");
5
+ exports.toNamespacedPath = void 0;
6
+ const constants_js_1 = require("../_common/constants.js");
7
7
  const _util_js_1 = require("./_util.js");
8
- const _resolve_js_1 = require("./_resolve.js");
8
+ const resolve_js_1 = require("./resolve.js");
9
9
  /**
10
10
  * Resolves path to a namespace path
11
11
  * @param path to resolve to namespace
12
12
  */
13
- function posixToNamespacedPath(path) {
14
- // Non-op on posix systems
15
- return path;
16
- }
17
- exports.posixToNamespacedPath = posixToNamespacedPath;
18
- /**
19
- * Resolves path to a namespace path
20
- * @param path to resolve to namespace
21
- */
22
- function windowsToNamespacedPath(path) {
13
+ function toNamespacedPath(path) {
23
14
  // Note: this will *probably* throw somewhere.
24
15
  if (typeof path !== "string")
25
16
  return path;
26
17
  if (path.length === 0)
27
18
  return "";
28
- const resolvedPath = (0, _resolve_js_1.windowsResolve)(path);
19
+ const resolvedPath = (0, resolve_js_1.resolve)(path);
29
20
  if (resolvedPath.length >= 3) {
30
- if (resolvedPath.charCodeAt(0) === _constants_js_1.CHAR_BACKWARD_SLASH) {
21
+ if (resolvedPath.charCodeAt(0) === constants_js_1.CHAR_BACKWARD_SLASH) {
31
22
  // Possible UNC root
32
- if (resolvedPath.charCodeAt(1) === _constants_js_1.CHAR_BACKWARD_SLASH) {
23
+ if (resolvedPath.charCodeAt(1) === constants_js_1.CHAR_BACKWARD_SLASH) {
33
24
  const code = resolvedPath.charCodeAt(2);
34
- if (code !== _constants_js_1.CHAR_QUESTION_MARK && code !== _constants_js_1.CHAR_DOT) {
25
+ if (code !== constants_js_1.CHAR_QUESTION_MARK && code !== constants_js_1.CHAR_DOT) {
35
26
  // Matched non-long UNC root, convert the path to a long UNC path
36
27
  return `\\\\?\\UNC\\${resolvedPath.slice(2)}`;
37
28
  }
@@ -39,8 +30,8 @@ function windowsToNamespacedPath(path) {
39
30
  }
40
31
  else if ((0, _util_js_1.isWindowsDeviceRoot)(resolvedPath.charCodeAt(0))) {
41
32
  // Possible device root
42
- if (resolvedPath.charCodeAt(1) === _constants_js_1.CHAR_COLON &&
43
- resolvedPath.charCodeAt(2) === _constants_js_1.CHAR_BACKWARD_SLASH) {
33
+ if (resolvedPath.charCodeAt(1) === constants_js_1.CHAR_COLON &&
34
+ resolvedPath.charCodeAt(2) === constants_js_1.CHAR_BACKWARD_SLASH) {
44
35
  // Matched device root, convert the path to a long UNC path
45
36
  return `\\\\?\\${resolvedPath}`;
46
37
  }
@@ -48,4 +39,4 @@ function windowsToNamespacedPath(path) {
48
39
  }
49
40
  return path;
50
41
  }
51
- exports.windowsToNamespacedPath = windowsToNamespacedPath;
42
+ exports.toNamespacedPath = toNamespacedPath;
package/script/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/script/deps.js CHANGED
@@ -24,5 +24,5 @@ var __importStar = (this && this.__importStar) || function (mod) {
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
26
  exports.html = exports.path = void 0;
27
- exports.path = __importStar(require("./deps/deno.land/std@0.201.0/path/mod.js"));
28
- exports.html = __importStar(require("./deps/deno.land/std@0.201.0/html/mod.js"));
27
+ exports.path = __importStar(require("./deps/deno.land/std@0.208.0/path/mod.js"));
28
+ exports.html = __importStar(require("./deps/deno.land/std@0.208.0/html/mod.js"));
package/script/mod.js CHANGED
@@ -48,8 +48,8 @@ function default_1(options = {}) {
48
48
  const env = new environment_js_1.Environment({
49
49
  loader,
50
50
  dataVarname: options.dataVarname || "it",
51
- autoescape: options.autoescape || false,
52
- useWith: options.useWith || true,
51
+ autoescape: options.autoescape ?? false,
52
+ useWith: options.useWith ?? true,
53
53
  });
54
54
  // Register basic plugins
55
55
  env.use((0, if_js_1.default)());
@@ -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];
@@ -26,7 +26,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
26
26
  return (mod && mod.__esModule) ? mod : { "default": mod };
27
27
  };
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
- exports.Environment = void 0;
29
+ exports.errorLine = exports.Environment = void 0;
30
30
  const dntShim = __importStar(require("../_dnt.shims.js"));
31
31
  const tokenizer_js_1 = __importDefault(require("./tokenizer.js"));
32
32
  class Environment {
@@ -63,30 +63,30 @@ class Environment {
63
63
  return template(data);
64
64
  }
65
65
  compile(source, path, defaults, sync = false) {
66
- try {
67
- const tokens = (0, tokenizer_js_1.default)(source);
68
- const code = this.compileTokens(tokens).join("\n");
69
- const { dataVarname, useWith } = this.options;
70
- const constructor = new Function("__file", "__env", "__defaults", `return${sync ? "" : " async"} function (${dataVarname}) {
71
- try {
72
- ${dataVarname} = Object.assign({}, __defaults, ${dataVarname});
73
- const __exports = { content: "" };
74
- ${useWith ? `with (${dataVarname}) {${code}}` : code}
75
- return __exports;
76
- } catch (cause) {
77
- throw new Error(\`Error rendering template: \${__file}\`, { cause });
78
- }
79
- }
80
- `);
81
- // console.log(code);
82
- const template = constructor(path, this, defaults);
83
- template.file = path;
84
- template.code = code;
85
- return template;
66
+ const { tokens, position, error } = (0, tokenizer_js_1.default)(source);
67
+ if (error) {
68
+ throw this.createError(path || "unknown", source, position, error);
86
69
  }
87
- catch (cause) {
88
- throw new Error(`Error compiling template: ${path || source}`, { cause });
70
+ const code = this.compileTokens(tokens).join("\n");
71
+ const { dataVarname, useWith } = this.options;
72
+ const constructor = new Function("__file", "__env", "__defaults", `return${sync ? "" : " async"} function (${dataVarname}) {
73
+ let __pos = 0;
74
+ try {
75
+ ${dataVarname} = Object.assign({}, __defaults, ${dataVarname});
76
+ const __exports = { content: "" };
77
+ ${useWith ? `with (${dataVarname}) {${code}}` : code}
78
+ return __exports;
79
+ } catch (cause) {
80
+ const template = __env.cache.get(__file);
81
+ throw __env.createError(__file, template?.source || "", __pos, cause);
89
82
  }
83
+ }
84
+ `);
85
+ const template = constructor(path, this, defaults);
86
+ template.file = path;
87
+ template.code = code;
88
+ template.source = source;
89
+ return template;
90
90
  }
91
91
  async load(file, from) {
92
92
  const path = from ? this.options.loader.resolve(from, file) : file;
@@ -103,7 +103,7 @@ class Environment {
103
103
  if (stopAt && tokens[0][0] === "tag" && stopAt.includes(tokens[0][1])) {
104
104
  break;
105
105
  }
106
- const [type, code] = tokens.shift();
106
+ const [type, code, pos] = tokens.shift();
107
107
  if (type === "comment") {
108
108
  continue;
109
109
  }
@@ -112,6 +112,7 @@ class Environment {
112
112
  continue;
113
113
  }
114
114
  if (type === "tag") {
115
+ compiled.push(`__pos = ${pos};`);
115
116
  for (const tag of this.tags) {
116
117
  const compiledTag = tag(this, code, outputVar, tokens);
117
118
  if (typeof compiledTag === "string") {
@@ -161,6 +162,13 @@ class Environment {
161
162
  }
162
163
  return output;
163
164
  }
165
+ createError(path, source, position, cause) {
166
+ if (!source) {
167
+ return cause;
168
+ }
169
+ const [line, column, code] = errorLine(source, position);
170
+ return new Error(`Error in the template ${path}:${line}:${column}\n\n${code.trim()}\n\n> ${cause.message}\n`, { cause });
171
+ }
164
172
  }
165
173
  exports.Environment = Environment;
166
174
  function isGlobal(name) {
@@ -174,3 +182,23 @@ function isGlobal(name) {
174
182
  return typeof dntShim.dntGlobalThis[obj]?.[prop] === "function";
175
183
  }
176
184
  }
185
+ /** Returns the number and code of the errored line */
186
+ function errorLine(source, pos) {
187
+ let line = 1;
188
+ let column = 1;
189
+ for (let index = 0; index < pos; index++) {
190
+ if (source[index] === "\n" ||
191
+ (source[index] === "\r" && source[index + 1] === "\n")) {
192
+ line++;
193
+ column = 1;
194
+ if (source[index] === "\r") {
195
+ index++;
196
+ }
197
+ }
198
+ else {
199
+ column++;
200
+ }
201
+ }
202
+ return [line, column, source.split("\n")[line - 1]];
203
+ }
204
+ exports.errorLine = errorLine;
@@ -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]
@@ -5,84 +5,95 @@ function tokenize(source) {
5
5
  const tokens = [];
6
6
  let type = "string";
7
7
  let trimNext = false;
8
- while (source.length > 0) {
9
- if (type === "string") {
10
- const index = source.indexOf("{{");
11
- const code = index === -1 ? source : source.slice(0, index);
12
- if (trimNext) {
13
- tokens.push([type, code.trimStart()]);
14
- trimNext = false;
15
- }
16
- else {
17
- tokens.push([type, code]);
18
- }
19
- if (index === -1) {
20
- break;
8
+ let position = 0;
9
+ try {
10
+ while (source.length > 0) {
11
+ if (type === "string") {
12
+ const index = source.indexOf("{{");
13
+ const code = index === -1 ? source : source.slice(0, index);
14
+ if (trimNext) {
15
+ tokens.push([type, code.trimStart(), position]);
16
+ trimNext = false;
17
+ }
18
+ else {
19
+ tokens.push([type, code, position]);
20
+ }
21
+ if (index === -1) {
22
+ break;
23
+ }
24
+ position += index;
25
+ source = source.slice(index);
26
+ type = source.startsWith("{{#") ? "comment" : "tag";
27
+ continue;
21
28
  }
22
- source = source.slice(index);
23
- type = source.startsWith("{{#") ? "comment" : "tag";
24
- continue;
25
- }
26
- if (type === "comment") {
27
- source = source.slice(3);
28
- const index = source.indexOf("#}}");
29
- const comment = index === -1 ? source : source.slice(0, index);
30
- tokens.push([type, comment]);
31
- if (index === -1) {
32
- break;
29
+ if (type === "comment") {
30
+ source = source.slice(3);
31
+ const index = source.indexOf("#}}");
32
+ const comment = index === -1 ? source : source.slice(0, index);
33
+ tokens.push([type, comment, position]);
34
+ if (index === -1) {
35
+ break;
36
+ }
37
+ position += index + 3;
38
+ source = source.slice(index + 3);
39
+ type = "string";
40
+ continue;
33
41
  }
34
- source = source.slice(index + 3);
35
- type = "string";
36
- continue;
37
- }
38
- if (type === "tag") {
39
- const indexes = parseTag(source);
40
- const lastIndex = indexes.length - 1;
41
- let tag;
42
- indexes.reduce((prev, curr, index) => {
43
- let code = source.slice(prev, curr - 2);
44
- // Tag
45
- if (index === 1) {
46
- // Left trim
47
- if (code.startsWith("-")) {
48
- code = code.slice(1);
49
- const lastToken = tokens[tokens.length - 1];
50
- lastToken[1] = lastToken[1].trimEnd();
42
+ if (type === "tag") {
43
+ const indexes = parseTag(source);
44
+ const lastIndex = indexes.length - 1;
45
+ let tag;
46
+ indexes.reduce((prev, curr, index) => {
47
+ let code = source.slice(prev, curr - 2);
48
+ // Tag
49
+ if (index === 1) {
50
+ // Left trim
51
+ if (code.startsWith("-")) {
52
+ code = code.slice(1);
53
+ const lastToken = tokens[tokens.length - 1];
54
+ lastToken[1] = lastToken[1].trimEnd();
55
+ }
56
+ // Right trim
57
+ if (code.endsWith("-") && index === lastIndex) {
58
+ code = code.slice(0, -1);
59
+ trimNext = true;
60
+ }
61
+ tag = [type, code.trim(), position];
62
+ tokens.push(tag);
63
+ return curr;
51
64
  }
52
65
  // Right trim
53
- if (code.endsWith("-") && index === lastIndex) {
66
+ if (index === lastIndex && code.endsWith("-")) {
54
67
  code = code.slice(0, -1);
55
68
  trimNext = true;
56
69
  }
57
- tag = [type, code.trim()];
58
- tokens.push(tag);
70
+ // Filters
71
+ tokens.push(["filter", code.trim()]);
59
72
  return curr;
73
+ });
74
+ position += indexes[lastIndex];
75
+ source = source.slice(indexes[lastIndex]);
76
+ type = "string";
77
+ // Search the closing echo tag {{ /echo }}
78
+ if (tag?.[1] === "echo") {
79
+ const end = source.match(/{{\s*\/echo\s*}}/);
80
+ if (!end) {
81
+ throw new Error("Unclosed echo tag");
82
+ }
83
+ const rawCode = source.slice(0, end.index);
84
+ tag[1] = `echo ${JSON.stringify(rawCode)}`;
85
+ const length = Number(end.index) + end[0].length;
86
+ source = source.slice(length);
87
+ position += length;
60
88
  }
61
- // Right trim
62
- if (index === lastIndex && code.endsWith("-")) {
63
- code = code.slice(0, -1);
64
- trimNext = true;
65
- }
66
- // Filters
67
- tokens.push(["filter", code.trim()]);
68
- return curr;
69
- });
70
- source = source.slice(indexes[indexes.length - 1]);
71
- type = "string";
72
- // Search the closing echo tag {{ /echo }}
73
- if (tag?.[1] === "echo") {
74
- const end = source.match(/{{\s*\/echo\s*}}/);
75
- if (!end) {
76
- throw new Error("Unclosed echo tag");
77
- }
78
- const rawCode = source.slice(0, end.index);
79
- tag[1] = `echo ${JSON.stringify(rawCode)}`;
80
- source = source.slice(Number(end.index) + end[0].length);
89
+ continue;
81
90
  }
82
- continue;
83
91
  }
84
92
  }
85
- return tokens;
93
+ catch (error) {
94
+ return { tokens, position, error };
95
+ }
96
+ return { tokens, position, error: undefined };
86
97
  }
87
98
  exports.default = tokenize;
88
99
  /**
@@ -1,16 +0,0 @@
1
- /**
2
- * Return the last portion of a `path`.
3
- * Trailing directory separators are ignored, and optional suffix is removed.
4
- *
5
- * @param path - path to extract the name from.
6
- * @param [suffix] - suffix to remove from extracted name.
7
- */
8
- export declare function posixBasename(path: string, suffix?: string): string;
9
- /**
10
- * Return the last portion of a `path`.
11
- * Trailing directory separators are ignored, and optional suffix is removed.
12
- *
13
- * @param path - path to extract the name from.
14
- * @param [suffix] - suffix to remove from extracted name.
15
- */
16
- export declare function windowsBasename(path: string, suffix?: string): string;