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
@@ -2,84 +2,95 @@ export default function tokenize(source) {
2
2
  const tokens = [];
3
3
  let type = "string";
4
4
  let trimNext = false;
5
- while (source.length > 0) {
6
- if (type === "string") {
7
- const index = source.indexOf("{{");
8
- const code = index === -1 ? source : source.slice(0, index);
9
- if (trimNext) {
10
- tokens.push([type, code.trimStart()]);
11
- trimNext = false;
12
- }
13
- else {
14
- tokens.push([type, code]);
15
- }
16
- if (index === -1) {
17
- break;
5
+ let position = 0;
6
+ try {
7
+ while (source.length > 0) {
8
+ if (type === "string") {
9
+ const index = source.indexOf("{{");
10
+ const code = index === -1 ? source : source.slice(0, index);
11
+ if (trimNext) {
12
+ tokens.push([type, code.trimStart(), position]);
13
+ trimNext = false;
14
+ }
15
+ else {
16
+ tokens.push([type, code, position]);
17
+ }
18
+ if (index === -1) {
19
+ break;
20
+ }
21
+ position += index;
22
+ source = source.slice(index);
23
+ type = source.startsWith("{{#") ? "comment" : "tag";
24
+ continue;
18
25
  }
19
- source = source.slice(index);
20
- type = source.startsWith("{{#") ? "comment" : "tag";
21
- continue;
22
- }
23
- if (type === "comment") {
24
- source = source.slice(3);
25
- const index = source.indexOf("#}}");
26
- const comment = index === -1 ? source : source.slice(0, index);
27
- tokens.push([type, comment]);
28
- if (index === -1) {
29
- break;
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, position]);
31
+ if (index === -1) {
32
+ break;
33
+ }
34
+ position += index + 3;
35
+ source = source.slice(index + 3);
36
+ type = "string";
37
+ continue;
30
38
  }
31
- source = source.slice(index + 3);
32
- type = "string";
33
- continue;
34
- }
35
- if (type === "tag") {
36
- const indexes = parseTag(source);
37
- const lastIndex = indexes.length - 1;
38
- let tag;
39
- indexes.reduce((prev, curr, index) => {
40
- let code = source.slice(prev, curr - 2);
41
- // Tag
42
- if (index === 1) {
43
- // Left trim
44
- if (code.startsWith("-")) {
45
- code = code.slice(1);
46
- const lastToken = tokens[tokens.length - 1];
47
- lastToken[1] = lastToken[1].trimEnd();
39
+ if (type === "tag") {
40
+ const indexes = parseTag(source);
41
+ const lastIndex = indexes.length - 1;
42
+ let tag;
43
+ indexes.reduce((prev, curr, index) => {
44
+ let code = source.slice(prev, curr - 2);
45
+ // Tag
46
+ if (index === 1) {
47
+ // Left trim
48
+ if (code.startsWith("-")) {
49
+ code = code.slice(1);
50
+ const lastToken = tokens[tokens.length - 1];
51
+ lastToken[1] = lastToken[1].trimEnd();
52
+ }
53
+ // Right trim
54
+ if (code.endsWith("-") && index === lastIndex) {
55
+ code = code.slice(0, -1);
56
+ trimNext = true;
57
+ }
58
+ tag = [type, code.trim(), position];
59
+ tokens.push(tag);
60
+ return curr;
48
61
  }
49
62
  // Right trim
50
- if (code.endsWith("-") && index === lastIndex) {
63
+ if (index === lastIndex && code.endsWith("-")) {
51
64
  code = code.slice(0, -1);
52
65
  trimNext = true;
53
66
  }
54
- tag = [type, code.trim()];
55
- tokens.push(tag);
67
+ // Filters
68
+ tokens.push(["filter", code.trim()]);
56
69
  return curr;
70
+ });
71
+ position += indexes[lastIndex];
72
+ source = source.slice(indexes[lastIndex]);
73
+ type = "string";
74
+ // Search the closing echo tag {{ /echo }}
75
+ if (tag?.[1] === "echo") {
76
+ const end = source.match(/{{\s*\/echo\s*}}/);
77
+ if (!end) {
78
+ throw new Error("Unclosed echo tag");
79
+ }
80
+ const rawCode = source.slice(0, end.index);
81
+ tag[1] = `echo ${JSON.stringify(rawCode)}`;
82
+ const length = Number(end.index) + end[0].length;
83
+ source = source.slice(length);
84
+ position += length;
57
85
  }
58
- // Right trim
59
- if (index === lastIndex && code.endsWith("-")) {
60
- code = code.slice(0, -1);
61
- trimNext = true;
62
- }
63
- // Filters
64
- tokens.push(["filter", code.trim()]);
65
- return curr;
66
- });
67
- source = source.slice(indexes[indexes.length - 1]);
68
- type = "string";
69
- // Search the closing echo tag {{ /echo }}
70
- if (tag?.[1] === "echo") {
71
- const end = source.match(/{{\s*\/echo\s*}}/);
72
- if (!end) {
73
- throw new Error("Unclosed echo tag");
74
- }
75
- const rawCode = source.slice(0, end.index);
76
- tag[1] = `echo ${JSON.stringify(rawCode)}`;
77
- source = source.slice(Number(end.index) + end[0].length);
86
+ continue;
78
87
  }
79
- continue;
80
88
  }
81
89
  }
82
- return tokens;
90
+ catch (error) {
91
+ return { tokens, position, error };
92
+ }
93
+ return { tokens, position, error: undefined };
83
94
  }
84
95
  /**
85
96
  * Parse a tag and return the indexes of the start and end brackets, and the filters between.
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "module": "./esm/mod.js",
3
3
  "main": "./script/mod.js",
4
4
  "name": "ventojs",
5
- "version": "0.9.0",
5
+ "version": "0.9.2",
6
6
  "description": "🌬 A minimal but powerful template engine",
7
7
  "license": "MIT",
8
8
  "repository": "github:oscarotero/vento",
@@ -0,0 +1 @@
1
+ export declare function assertPath(path: string): void;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
3
+ // Copyright the Browserify authors. MIT License.
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.assertPath = void 0;
6
+ function assertPath(path) {
7
+ if (typeof path !== "string") {
8
+ throw new TypeError(`Path must be a string. Received ${JSON.stringify(path)}`);
9
+ }
10
+ }
11
+ exports.assertPath = assertPath;
@@ -0,0 +1,3 @@
1
+ export declare function stripSuffix(name: string, suffix: string): string;
2
+ export declare function lastPathSegment(path: string, isSep: (char: number) => boolean, start?: number): string;
3
+ export declare function assertArgs(path: string, suffix: string): string | undefined;
@@ -0,0 +1,46 @@
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.assertArgs = exports.lastPathSegment = exports.stripSuffix = void 0;
6
+ const assert_path_js_1 = require("./assert_path.js");
7
+ function stripSuffix(name, suffix) {
8
+ if (suffix.length >= name.length) {
9
+ return name;
10
+ }
11
+ const lenDiff = name.length - suffix.length;
12
+ for (let i = suffix.length - 1; i >= 0; --i) {
13
+ if (name.charCodeAt(lenDiff + i) !== suffix.charCodeAt(i)) {
14
+ return name;
15
+ }
16
+ }
17
+ return name.slice(0, -suffix.length);
18
+ }
19
+ exports.stripSuffix = stripSuffix;
20
+ function lastPathSegment(path, isSep, start = 0) {
21
+ let matchedNonSeparator = false;
22
+ let end = path.length;
23
+ for (let i = path.length - 1; i >= start; --i) {
24
+ if (isSep(path.charCodeAt(i))) {
25
+ if (matchedNonSeparator) {
26
+ start = i + 1;
27
+ break;
28
+ }
29
+ }
30
+ else if (!matchedNonSeparator) {
31
+ matchedNonSeparator = true;
32
+ end = i + 1;
33
+ }
34
+ }
35
+ return path.slice(start, end);
36
+ }
37
+ exports.lastPathSegment = lastPathSegment;
38
+ function assertArgs(path, suffix) {
39
+ (0, assert_path_js_1.assertPath)(path);
40
+ if (path.length === 0)
41
+ return path;
42
+ if (typeof suffix !== "string") {
43
+ throw new TypeError(`Suffix must be a string. Received ${JSON.stringify(suffix)}`);
44
+ }
45
+ }
46
+ exports.assertArgs = assertArgs;
@@ -0,0 +1 @@
1
+ export declare function _common(paths: string[], sep: string): string;
@@ -2,21 +2,8 @@
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.common = void 0;
6
- const separator_js_1 = require("./separator.js");
7
- /** Determines the common path from a set of paths, using an optional separator,
8
- * which defaults to the OS default separator.
9
- *
10
- * ```ts
11
- * import { common } from "https://deno.land/std@$STD_VERSION/path/mod.ts";
12
- * const p = common([
13
- * "./deno/std/path/mod.ts",
14
- * "./deno/std/fs/mod.ts",
15
- * ]);
16
- * console.log(p); // "./deno/std/"
17
- * ```
18
- */
19
- function common(paths, sep = separator_js_1.SEP) {
5
+ exports._common = void 0;
6
+ function _common(paths, sep) {
20
7
  const [first = "", ...remaining] = paths;
21
8
  if (first === "" || remaining.length === 0) {
22
9
  return first.substring(0, first.lastIndexOf(sep) + 1);
@@ -37,4 +24,4 @@ function common(paths, sep = separator_js_1.SEP) {
37
24
  const prefix = parts.slice(0, endOfPrefix).join(sep);
38
25
  return prefix.endsWith(sep) ? prefix : `${prefix}${sep}`;
39
26
  }
40
- exports.common = common;
27
+ exports._common = _common;
@@ -0,0 +1 @@
1
+ export declare function assertArg(path: string): "." | undefined;
@@ -0,0 +1,12 @@
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.assertArg = void 0;
6
+ const assert_path_js_1 = require("./assert_path.js");
7
+ function assertArg(path) {
8
+ (0, assert_path_js_1.assertPath)(path);
9
+ if (path.length === 0)
10
+ return ".";
11
+ }
12
+ exports.assertArg = assertArg;
@@ -0,0 +1,3 @@
1
+ import type { FormatInputPathObject } from "../_interface.js";
2
+ export declare function _format(sep: string, pathObject: FormatInputPathObject): string;
3
+ export declare function assertArg(pathObject: FormatInputPathObject): void;
@@ -1,5 +1,8 @@
1
+ "use strict";
1
2
  // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
2
3
  // This module is browser compatible.
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.assertArg = exports._format = void 0;
3
6
  function _format(sep, pathObject) {
4
7
  const dir = pathObject.dir || pathObject.root;
5
8
  const base = pathObject.base ||
@@ -12,24 +15,10 @@ function _format(sep, pathObject) {
12
15
  return dir + base;
13
16
  return dir + sep + base;
14
17
  }
18
+ exports._format = _format;
15
19
  function assertArg(pathObject) {
16
20
  if (pathObject === null || typeof pathObject !== "object") {
17
21
  throw new TypeError(`The "pathObject" argument must be of type Object. Received type ${typeof pathObject}`);
18
22
  }
19
23
  }
20
- /**
21
- * Generate a path from `FormatInputPathObject` object.
22
- * @param pathObject with path
23
- */
24
- export function posixFormat(pathObject) {
25
- assertArg(pathObject);
26
- return _format("/", pathObject);
27
- }
28
- /**
29
- * Generate a path from `FormatInputPathObject` object.
30
- * @param pathObject with path
31
- */
32
- export function windowsFormat(pathObject) {
33
- assertArg(pathObject);
34
- return _format("\\", pathObject);
35
- }
24
+ exports.assertArg = assertArg;
@@ -0,0 +1,2 @@
1
+ /// <reference types="node" />
2
+ export declare function assertArg(url: URL | string): URL;
@@ -0,0 +1,13 @@
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.assertArg = void 0;
6
+ function assertArg(url) {
7
+ url = url instanceof URL ? url : new URL(url);
8
+ if (url.protocol !== "file:") {
9
+ throw new TypeError("Must be a file URL.");
10
+ }
11
+ return url;
12
+ }
13
+ exports.assertArg = assertArg;
@@ -0,0 +1,27 @@
1
+ export interface GlobOptions {
2
+ /** Extended glob syntax.
3
+ * See https://www.linuxjournal.com/content/bash-extended-globbing.
4
+ *
5
+ * @default {true}
6
+ */
7
+ extended?: boolean;
8
+ /** Globstar syntax.
9
+ * See https://www.linuxjournal.com/content/globstar-new-bash-globbing-option.
10
+ * If false, `**` is treated like `*`.
11
+ *
12
+ * @default {true}
13
+ */
14
+ globstar?: boolean;
15
+ /** Whether globstar should be case-insensitive. */
16
+ caseInsensitive?: boolean;
17
+ }
18
+ export type GlobToRegExpOptions = GlobOptions;
19
+ export interface GlobConstants {
20
+ sep: string;
21
+ sepMaybe: string;
22
+ seps: string[];
23
+ globstar: string;
24
+ wildcard: string;
25
+ escapePrefix: string;
26
+ }
27
+ export declare function _globToRegExp(c: GlobConstants, glob: string, { extended, globstar: globstarOption, caseInsensitive, }?: GlobToRegExpOptions): RegExp;
@@ -1,37 +1,8 @@
1
1
  "use strict";
2
2
  // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
3
3
  // This module is browser compatible.
4
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
5
- if (k2 === undefined) k2 = k;
6
- var desc = Object.getOwnPropertyDescriptor(m, k);
7
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
8
- desc = { enumerable: true, get: function() { return m[k]; } };
9
- }
10
- Object.defineProperty(o, k2, desc);
11
- }) : (function(o, m, k, k2) {
12
- if (k2 === undefined) k2 = k;
13
- o[k2] = m[k];
14
- }));
15
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
16
- Object.defineProperty(o, "default", { enumerable: true, value: v });
17
- }) : function(o, v) {
18
- o["default"] = v;
19
- });
20
- var __importStar = (this && this.__importStar) || function (mod) {
21
- if (mod && mod.__esModule) return mod;
22
- var result = {};
23
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
24
- __setModuleDefault(result, mod);
25
- return result;
26
- };
27
4
  Object.defineProperty(exports, "__esModule", { value: true });
28
- exports.joinGlobs = exports.normalizeGlob = exports.isGlob = exports.globToRegExp = void 0;
29
- const _os_js_1 = require("./_os.js");
30
- const separator_js_1 = require("./separator.js");
31
- const _win32 = __importStar(require("./win32.js"));
32
- const _posix = __importStar(require("./posix.js"));
33
- const path = _os_js_1.isWindows ? _win32 : _posix;
34
- const { join, normalize } = path;
5
+ exports._globToRegExp = void 0;
35
6
  const regExpEscapeChars = [
36
7
  "!",
37
8
  "$",
@@ -49,76 +20,15 @@ const regExpEscapeChars = [
49
20
  "|",
50
21
  ];
51
22
  const rangeEscapeChars = ["-", "\\", "]"];
52
- /** Convert a glob string to a regular expression.
53
- *
54
- * Tries to match bash glob expansion as closely as possible.
55
- *
56
- * Basic glob syntax:
57
- * - `*` - Matches everything without leaving the path segment.
58
- * - `?` - Matches any single character.
59
- * - `{foo,bar}` - Matches `foo` or `bar`.
60
- * - `[abcd]` - Matches `a`, `b`, `c` or `d`.
61
- * - `[a-d]` - Matches `a`, `b`, `c` or `d`.
62
- * - `[!abcd]` - Matches any single character besides `a`, `b`, `c` or `d`.
63
- * - `[[:<class>:]]` - Matches any character belonging to `<class>`.
64
- * - `[[:alnum:]]` - Matches any digit or letter.
65
- * - `[[:digit:]abc]` - Matches any digit, `a`, `b` or `c`.
66
- * - See https://facelessuser.github.io/wcmatch/glob/#posix-character-classes
67
- * for a complete list of supported character classes.
68
- * - `\` - Escapes the next character for an `os` other than `"windows"`.
69
- * - \` - Escapes the next character for `os` set to `"windows"`.
70
- * - `/` - Path separator.
71
- * - `\` - Additional path separator only for `os` set to `"windows"`.
72
- *
73
- * Extended syntax:
74
- * - Requires `{ extended: true }`.
75
- * - `?(foo|bar)` - Matches 0 or 1 instance of `{foo,bar}`.
76
- * - `@(foo|bar)` - Matches 1 instance of `{foo,bar}`. They behave the same.
77
- * - `*(foo|bar)` - Matches _n_ instances of `{foo,bar}`.
78
- * - `+(foo|bar)` - Matches _n > 0_ instances of `{foo,bar}`.
79
- * - `!(foo|bar)` - Matches anything other than `{foo,bar}`.
80
- * - See https://www.linuxjournal.com/content/bash-extended-globbing.
81
- *
82
- * Globstar syntax:
83
- * - Requires `{ globstar: true }`.
84
- * - `**` - Matches any number of any path segments.
85
- * - Must comprise its entire path segment in the provided glob.
86
- * - See https://www.linuxjournal.com/content/globstar-new-bash-globbing-option.
87
- *
88
- * Note the following properties:
89
- * - The generated `RegExp` is anchored at both start and end.
90
- * - Repeating and trailing separators are tolerated. Trailing separators in the
91
- * provided glob have no meaning and are discarded.
92
- * - Absolute globs will only match absolute paths, etc.
93
- * - Empty globs will match nothing.
94
- * - Any special glob syntax must be contained to one path segment. For example,
95
- * `?(foo|bar/baz)` is invalid. The separator will take precedence and the
96
- * first segment ends with an unclosed group.
97
- * - If a path segment ends with unclosed groups or a dangling escape prefix, a
98
- * parse error has occurred. Every character for that segment is taken
99
- * literally in this event.
100
- *
101
- * Limitations:
102
- * - A negative group like `!(foo|bar)` will wrongly be converted to a negative
103
- * look-ahead followed by a wildcard. This means that `!(foo).js` will wrongly
104
- * fail to match `foobar.js`, even though `foobar` is not `foo`. Effectively,
105
- * `!(foo|bar)` is treated like `!(@(foo|bar)*)`. This will work correctly if
106
- * the group occurs not nested at the end of the segment. */
107
- function globToRegExp(glob, { extended = true, globstar: globstarOption = true, os = _os_js_1.osType, caseInsensitive = false, } = {}) {
23
+ function _globToRegExp(c, glob, { extended = true, globstar: globstarOption = true,
24
+ // os = osType,
25
+ caseInsensitive = false, } = {}) {
108
26
  if (glob === "") {
109
27
  return /(?!)/;
110
28
  }
111
- const sep = os === "windows" ? "(?:\\\\|/)+" : "/+";
112
- const sepMaybe = os === "windows" ? "(?:\\\\|/)*" : "/*";
113
- const seps = os === "windows" ? ["\\", "/"] : ["/"];
114
- const globstar = os === "windows"
115
- ? "(?:[^\\\\/]*(?:\\\\|/|$)+)*"
116
- : "(?:[^/]*(?:/|$)+)*";
117
- const wildcard = os === "windows" ? "[^\\\\/]*" : "[^/]*";
118
- const escapePrefix = os === "windows" ? "`" : "\\";
119
29
  // Remove trailing separators.
120
30
  let newLength = glob.length;
121
- for (; newLength > 1 && seps.includes(glob[newLength - 1]); newLength--)
31
+ for (; newLength > 1 && c.seps.includes(glob[newLength - 1]); newLength--)
122
32
  ;
123
33
  glob = glob.slice(0, newLength);
124
34
  let regExpString = "";
@@ -131,14 +41,14 @@ function globToRegExp(glob, { extended = true, globstar: globstarOption = true,
131
41
  let endsWithSep = false;
132
42
  let i = j;
133
43
  // Terminates with `i` at the non-inclusive end of the current segment.
134
- for (; i < glob.length && !seps.includes(glob[i]); i++) {
44
+ for (; i < glob.length && !c.seps.includes(glob[i]); i++) {
135
45
  if (inEscape) {
136
46
  inEscape = false;
137
47
  const escapeChars = inRange ? rangeEscapeChars : regExpEscapeChars;
138
48
  segment += escapeChars.includes(glob[i]) ? `\\${glob[i]}` : glob[i];
139
49
  continue;
140
50
  }
141
- if (glob[i] === escapePrefix) {
51
+ if (glob[i] === c.escapePrefix) {
142
52
  inEscape = true;
143
53
  continue;
144
54
  }
@@ -217,7 +127,7 @@ function globToRegExp(glob, { extended = true, globstar: globstarOption = true,
217
127
  segment += ")";
218
128
  const type = groupStack.pop();
219
129
  if (type === "!") {
220
- segment += wildcard;
130
+ segment += c.wildcard;
221
131
  }
222
132
  else if (type !== "@") {
223
133
  segment += type;
@@ -287,13 +197,13 @@ function globToRegExp(glob, { extended = true, globstar: globstarOption = true,
287
197
  }
288
198
  const nextChar = glob[i + 1];
289
199
  if (globstarOption && numStars === 2 &&
290
- [...seps, undefined].includes(prevChar) &&
291
- [...seps, undefined].includes(nextChar)) {
292
- segment += globstar;
200
+ [...c.seps, undefined].includes(prevChar) &&
201
+ [...c.seps, undefined].includes(nextChar)) {
202
+ segment += c.globstar;
293
203
  endsWithSep = true;
294
204
  }
295
205
  else {
296
- segment += wildcard;
206
+ segment += c.wildcard;
297
207
  }
298
208
  }
299
209
  continue;
@@ -311,11 +221,11 @@ function globToRegExp(glob, { extended = true, globstar: globstarOption = true,
311
221
  }
312
222
  regExpString += segment;
313
223
  if (!endsWithSep) {
314
- regExpString += i < glob.length ? sep : sepMaybe;
224
+ regExpString += i < glob.length ? c.sep : c.sepMaybe;
315
225
  endsWithSep = true;
316
226
  }
317
227
  // Terminates with `i` at the start of the next segment.
318
- while (seps.includes(glob[i]))
228
+ while (c.seps.includes(glob[i]))
319
229
  i++;
320
230
  // Check that the next value of `j` is indeed higher than the current value.
321
231
  if (!(i > j)) {
@@ -326,66 +236,4 @@ function globToRegExp(glob, { extended = true, globstar: globstarOption = true,
326
236
  regExpString = `^${regExpString}$`;
327
237
  return new RegExp(regExpString, caseInsensitive ? "i" : "");
328
238
  }
329
- exports.globToRegExp = globToRegExp;
330
- /** Test whether the given string is a glob */
331
- function isGlob(str) {
332
- const chars = { "{": "}", "(": ")", "[": "]" };
333
- const regex = /\\(.)|(^!|\*|\?|[\].+)]\?|\[[^\\\]]+\]|\{[^\\}]+\}|\(\?[:!=][^\\)]+\)|\([^|]+\|[^\\)]+\))/;
334
- if (str === "") {
335
- return false;
336
- }
337
- let match;
338
- while ((match = regex.exec(str))) {
339
- if (match[2])
340
- return true;
341
- let idx = match.index + match[0].length;
342
- // if an open bracket/brace/paren is escaped,
343
- // set the index to the next closing character
344
- const open = match[1];
345
- const close = open ? chars[open] : null;
346
- if (open && close) {
347
- const n = str.indexOf(close, idx);
348
- if (n !== -1) {
349
- idx = n + 1;
350
- }
351
- }
352
- str = str.slice(idx);
353
- }
354
- return false;
355
- }
356
- exports.isGlob = isGlob;
357
- /** Like normalize(), but doesn't collapse "**\/.." when `globstar` is true. */
358
- function normalizeGlob(glob, { globstar = false } = {}) {
359
- if (glob.match(/\0/g)) {
360
- throw new Error(`Glob contains invalid characters: "${glob}"`);
361
- }
362
- if (!globstar) {
363
- return normalize(glob);
364
- }
365
- const s = separator_js_1.SEP_PATTERN.source;
366
- const badParentPattern = new RegExp(`(?<=(${s}|^)\\*\\*${s})\\.\\.(?=${s}|$)`, "g");
367
- return normalize(glob.replace(badParentPattern, "\0")).replace(/\0/g, "..");
368
- }
369
- exports.normalizeGlob = normalizeGlob;
370
- /** Like join(), but doesn't collapse "**\/.." when `globstar` is true. */
371
- function joinGlobs(globs, { extended = true, globstar = false } = {}) {
372
- if (!globstar || globs.length === 0) {
373
- return join(...globs);
374
- }
375
- if (globs.length === 0)
376
- return ".";
377
- let joined;
378
- for (const glob of globs) {
379
- const path = glob;
380
- if (path.length > 0) {
381
- if (!joined)
382
- joined = path;
383
- else
384
- joined += `${separator_js_1.SEP}${path}`;
385
- }
386
- }
387
- if (!joined)
388
- return ".";
389
- return normalizeGlob(joined, { extended, globstar });
390
- }
391
- exports.joinGlobs = joinGlobs;
239
+ exports._globToRegExp = _globToRegExp;
@@ -0,0 +1 @@
1
+ export declare function assertArg(path: string): "." | undefined;
@@ -0,0 +1,12 @@
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.assertArg = void 0;
6
+ const assert_path_js_1 = require("./assert_path.js");
7
+ function assertArg(path) {
8
+ (0, assert_path_js_1.assertPath)(path);
9
+ if (path.length === 0)
10
+ return ".";
11
+ }
12
+ exports.assertArg = assertArg;
@@ -0,0 +1 @@
1
+ export declare function normalizeString(path: string, allowAboveRoot: boolean, separator: string, isPathSeparator: (code: number) => boolean): string;