ventojs 0.8.1 → 0.9.1

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 (362) hide show
  1. package/README.md +7 -63
  2. package/esm/deps/deno.land/std@0.205.0/html/entities.d.ts +38 -0
  3. package/esm/deps/deno.land/std@0.205.0/html/entities.js +76 -0
  4. package/esm/deps/deno.land/std@0.205.0/html/mod.d.ts +6 -0
  5. package/esm/deps/deno.land/std@0.205.0/html/mod.js +8 -0
  6. package/esm/deps/deno.land/std@0.205.0/path/_common/assert_path.d.ts +1 -0
  7. package/esm/deps/deno.land/std@0.205.0/path/_common/assert_path.js +7 -0
  8. package/esm/deps/deno.land/std@0.205.0/path/_common/basename.d.ts +3 -0
  9. package/esm/deps/deno.land/std@0.205.0/path/_common/basename.js +40 -0
  10. package/esm/deps/deno.land/std@0.205.0/path/_common/common.d.ts +1 -0
  11. package/esm/deps/deno.land/{std@0.201.0/path → std@0.205.0/path/_common}/common.js +1 -14
  12. package/esm/deps/deno.land/std@0.205.0/path/_common/dirname.d.ts +1 -0
  13. package/esm/deps/deno.land/std@0.205.0/path/_common/dirname.js +8 -0
  14. package/esm/deps/deno.land/std@0.205.0/path/_common/format.d.ts +3 -0
  15. package/esm/deps/deno.land/std@0.205.0/path/_common/format.js +19 -0
  16. package/esm/deps/deno.land/std@0.205.0/path/_common/from_file_url.d.ts +2 -0
  17. package/esm/deps/deno.land/std@0.205.0/path/_common/from_file_url.js +9 -0
  18. package/esm/deps/deno.land/std@0.205.0/path/_common/glob_to_reg_exp.d.ts +27 -0
  19. package/esm/deps/deno.land/{std@0.201.0/path/glob.js → std@0.205.0/path/_common/glob_to_reg_exp.js} +13 -139
  20. package/esm/deps/deno.land/std@0.205.0/path/_common/is_glob.d.ts +2 -0
  21. package/esm/deps/deno.land/std@0.205.0/path/_common/is_glob.js +28 -0
  22. package/esm/deps/deno.land/std@0.205.0/path/_common/normalize.d.ts +1 -0
  23. package/esm/deps/deno.land/std@0.205.0/path/_common/normalize.js +8 -0
  24. package/esm/deps/deno.land/std@0.205.0/path/_common/normalize_string.d.ts +1 -0
  25. package/esm/deps/deno.land/{std@0.201.0/path/_util.js → std@0.205.0/path/_common/normalize_string.js} +1 -31
  26. package/esm/deps/deno.land/std@0.205.0/path/_common/relative.d.ts +1 -0
  27. package/esm/deps/deno.land/std@0.205.0/path/_common/relative.js +9 -0
  28. package/esm/deps/deno.land/std@0.205.0/path/_common/strip_trailing_separators.d.ts +1 -0
  29. package/esm/deps/deno.land/std@0.205.0/path/_common/strip_trailing_separators.js +19 -0
  30. package/esm/deps/deno.land/std@0.205.0/path/_common/to_file_url.d.ts +1 -0
  31. package/esm/deps/deno.land/std@0.205.0/path/_common/to_file_url.js +15 -0
  32. package/esm/deps/deno.land/std@0.205.0/path/_os.d.ts +3 -0
  33. package/esm/deps/deno.land/{std@0.201.0 → std@0.205.0}/path/_os.js +1 -1
  34. package/esm/deps/deno.land/{std@0.201.0 → std@0.205.0}/path/basename.js +2 -1
  35. package/esm/deps/deno.land/std@0.205.0/path/common.js +19 -0
  36. package/esm/deps/deno.land/{std@0.201.0 → std@0.205.0}/path/dirname.js +2 -1
  37. package/esm/deps/deno.land/{std@0.201.0 → std@0.205.0}/path/extname.js +2 -1
  38. package/esm/deps/deno.land/{std@0.201.0 → std@0.205.0}/path/format.js +2 -1
  39. package/esm/deps/deno.land/{std@0.201.0 → std@0.205.0}/path/from_file_url.js +2 -1
  40. package/esm/deps/deno.land/std@0.205.0/path/glob.d.ts +67 -0
  41. package/esm/deps/deno.land/std@0.205.0/path/glob.js +78 -0
  42. package/esm/deps/deno.land/{std@0.201.0 → std@0.205.0}/path/is_absolute.js +2 -1
  43. package/esm/deps/deno.land/{std@0.201.0 → std@0.205.0}/path/join.js +2 -1
  44. package/esm/deps/deno.land/{std@0.201.0 → std@0.205.0}/path/mod.d.ts +6 -3
  45. package/esm/deps/deno.land/std@0.205.0/path/mod.js +60 -0
  46. package/esm/deps/deno.land/{std@0.201.0 → std@0.205.0}/path/normalize.js +2 -1
  47. package/esm/deps/deno.land/{std@0.201.0 → std@0.205.0}/path/parse.js +2 -1
  48. package/esm/deps/deno.land/std@0.205.0/path/posix/_util.d.ts +1 -0
  49. package/esm/deps/deno.land/std@0.205.0/path/posix/_util.js +8 -0
  50. package/esm/deps/deno.land/std@0.205.0/path/posix/basename.js +18 -0
  51. package/esm/deps/deno.land/std@0.205.0/path/posix/common.js +19 -0
  52. package/esm/deps/deno.land/std@0.205.0/path/posix/dirname.js +36 -0
  53. package/esm/deps/deno.land/std@0.205.0/path/posix/extname.js +59 -0
  54. package/esm/deps/deno.land/std@0.205.0/path/posix/format.d.ts +6 -0
  55. package/esm/deps/deno.land/std@0.205.0/path/posix/format.js +11 -0
  56. package/esm/deps/deno.land/std@0.205.0/path/posix/from_file_url.d.ts +12 -0
  57. package/esm/deps/deno.land/std@0.205.0/path/posix/from_file_url.js +17 -0
  58. package/{script/deps/deno.land/std@0.201.0/path → esm/deps/deno.land/std@0.205.0/path/posix}/glob.d.ts +3 -24
  59. package/esm/deps/deno.land/std@0.205.0/path/posix/glob.js +106 -0
  60. package/esm/deps/deno.land/std@0.205.0/path/posix/is_absolute.js +12 -0
  61. package/esm/deps/deno.land/std@0.205.0/path/posix/join.js +26 -0
  62. package/esm/deps/deno.land/std@0.205.0/path/posix/mod.d.ts +37 -0
  63. package/esm/deps/deno.land/{std@0.201.0/path → std@0.205.0/path/posix}/mod.js +4 -8
  64. package/esm/deps/deno.land/std@0.205.0/path/posix/normalize.js +25 -0
  65. package/esm/deps/deno.land/std@0.205.0/path/posix/parse.d.ts +6 -0
  66. package/esm/deps/deno.land/std@0.205.0/path/posix/parse.js +98 -0
  67. package/esm/deps/deno.land/std@0.205.0/path/posix/relative.d.ts +7 -0
  68. package/esm/deps/deno.land/std@0.205.0/path/posix/relative.js +94 -0
  69. package/esm/deps/deno.land/std@0.205.0/path/posix/resolve.js +48 -0
  70. package/esm/deps/deno.land/std@0.205.0/path/posix/separator.d.ts +2 -0
  71. package/esm/deps/deno.land/std@0.205.0/path/posix/separator.js +4 -0
  72. package/esm/deps/deno.land/std@0.205.0/path/posix/to_file_url.d.ts +12 -0
  73. package/esm/deps/deno.land/std@0.205.0/path/posix/to_file_url.js +22 -0
  74. package/esm/deps/deno.land/std@0.205.0/path/posix/to_namespaced_path.js +10 -0
  75. package/esm/deps/deno.land/{std@0.201.0 → std@0.205.0}/path/relative.js +2 -1
  76. package/esm/deps/deno.land/{std@0.201.0 → std@0.205.0}/path/resolve.js +2 -1
  77. package/esm/deps/deno.land/{std@0.201.0 → std@0.205.0}/path/to_file_url.js +2 -1
  78. package/esm/deps/deno.land/{std@0.201.0 → std@0.205.0}/path/to_namespaced_path.js +2 -1
  79. package/esm/deps/deno.land/std@0.205.0/path/windows/_util.d.ts +3 -0
  80. package/esm/deps/deno.land/std@0.205.0/path/windows/_util.js +15 -0
  81. package/esm/deps/deno.land/std@0.205.0/path/windows/basename.d.ts +8 -0
  82. package/esm/deps/deno.land/std@0.205.0/path/windows/basename.js +30 -0
  83. package/esm/deps/deno.land/std@0.205.0/path/windows/common.d.ts +13 -0
  84. package/esm/deps/deno.land/std@0.205.0/path/windows/common.js +19 -0
  85. package/esm/deps/deno.land/std@0.205.0/path/windows/dirname.d.ts +5 -0
  86. package/esm/deps/deno.land/{std@0.201.0/path/_dirname.js → std@0.205.0/path/windows/dirname.js} +5 -39
  87. package/esm/deps/deno.land/std@0.205.0/path/windows/extname.d.ts +6 -0
  88. package/esm/deps/deno.land/{std@0.201.0/path/_extname.js → std@0.205.0/path/windows/extname.js} +4 -57
  89. package/esm/deps/deno.land/std@0.205.0/path/windows/format.d.ts +6 -0
  90. package/esm/deps/deno.land/std@0.205.0/path/windows/format.js +11 -0
  91. package/esm/deps/deno.land/{std@0.201.0/path/_from_file_url.d.ts → std@0.205.0/path/windows/from_file_url.d.ts} +1 -12
  92. package/esm/deps/deno.land/{std@0.201.0/path/_from_file_url.js → std@0.205.0/path/windows/from_file_url.js} +2 -22
  93. package/esm/deps/deno.land/{std@0.201.0/path → std@0.205.0/path/windows}/glob.d.ts +3 -24
  94. package/esm/deps/deno.land/std@0.205.0/path/windows/glob.js +106 -0
  95. package/esm/deps/deno.land/std@0.205.0/path/windows/is_absolute.d.ts +5 -0
  96. package/esm/deps/deno.land/{std@0.201.0/path/_is_absolute.js → std@0.205.0/path/windows/is_absolute.js} +4 -11
  97. package/esm/deps/deno.land/std@0.205.0/path/windows/join.d.ts +5 -0
  98. package/esm/deps/deno.land/{std@0.201.0/path/_join.js → std@0.205.0/path/windows/join.js} +6 -27
  99. package/esm/deps/deno.land/std@0.205.0/path/windows/mod.d.ts +37 -0
  100. package/esm/deps/deno.land/std@0.205.0/path/windows/mod.js +41 -0
  101. package/esm/deps/deno.land/std@0.205.0/path/windows/normalize.d.ts +7 -0
  102. package/esm/deps/deno.land/{std@0.201.0/path/_normalize.js → std@0.205.0/path/windows/normalize.js} +5 -28
  103. package/esm/deps/deno.land/std@0.205.0/path/windows/parse.d.ts +6 -0
  104. package/esm/deps/deno.land/{std@0.201.0/path/_parse.js → std@0.205.0/path/windows/parse.js} +4 -95
  105. package/esm/deps/deno.land/{std@0.201.0/path/_relative.js → std@0.205.0/path/windows/relative.js} +6 -101
  106. package/esm/deps/deno.land/std@0.205.0/path/windows/resolve.d.ts +5 -0
  107. package/esm/deps/deno.land/{std@0.201.0/path/_resolve.js → std@0.205.0/path/windows/resolve.js} +6 -46
  108. package/esm/deps/deno.land/std@0.205.0/path/windows/separator.d.ts +2 -0
  109. package/esm/deps/deno.land/std@0.205.0/path/windows/separator.js +4 -0
  110. package/{script/deps/deno.land/std@0.201.0/path/_to_file_url.d.ts → esm/deps/deno.land/std@0.205.0/path/windows/to_file_url.d.ts} +1 -12
  111. package/esm/deps/deno.land/{std@0.201.0/path/_to_file_url.js → std@0.205.0/path/windows/to_file_url.js} +4 -34
  112. package/esm/deps/deno.land/std@0.205.0/path/windows/to_namespaced_path.d.ts +5 -0
  113. package/esm/deps/deno.land/{std@0.201.0/path/_to_namespaced_path.js → std@0.205.0/path/windows/to_namespaced_path.js} +4 -12
  114. package/esm/deps.d.ts +2 -1
  115. package/esm/deps.js +2 -1
  116. package/esm/mod.d.ts +1 -0
  117. package/esm/mod.js +1 -0
  118. package/esm/plugins/escape.js +2 -12
  119. package/esm/plugins/export.js +5 -4
  120. package/esm/plugins/import.js +4 -11
  121. package/esm/plugins/include.js +3 -2
  122. package/esm/plugins/layout.js +4 -3
  123. package/esm/plugins/set.js +5 -4
  124. package/esm/plugins/unescape.js +2 -12
  125. package/esm/src/environment.d.ts +6 -0
  126. package/esm/src/environment.js +55 -31
  127. package/esm/src/tokenizer.d.ts +7 -2
  128. package/esm/src/tokenizer.js +77 -66
  129. package/package.json +1 -1
  130. package/script/deps/deno.land/std@0.205.0/html/entities.d.ts +38 -0
  131. package/script/deps/deno.land/std@0.205.0/html/entities.js +81 -0
  132. package/script/deps/deno.land/std@0.205.0/html/mod.d.ts +6 -0
  133. package/script/deps/deno.land/std@0.205.0/html/mod.js +24 -0
  134. package/script/deps/deno.land/std@0.205.0/path/_common/assert_path.d.ts +1 -0
  135. package/script/deps/deno.land/std@0.205.0/path/_common/assert_path.js +11 -0
  136. package/script/deps/deno.land/std@0.205.0/path/_common/basename.d.ts +3 -0
  137. package/script/deps/deno.land/std@0.205.0/path/_common/basename.js +46 -0
  138. package/script/deps/deno.land/std@0.205.0/path/_common/common.d.ts +1 -0
  139. package/script/deps/deno.land/{std@0.201.0/path → std@0.205.0/path/_common}/common.js +3 -16
  140. package/script/deps/deno.land/std@0.205.0/path/_common/dirname.d.ts +1 -0
  141. package/script/deps/deno.land/std@0.205.0/path/_common/dirname.js +12 -0
  142. package/script/deps/deno.land/std@0.205.0/path/_common/format.d.ts +3 -0
  143. package/{esm/deps/deno.land/std@0.201.0/path/_format.js → script/deps/deno.land/std@0.205.0/path/_common/format.js} +5 -16
  144. package/script/deps/deno.land/std@0.205.0/path/_common/from_file_url.d.ts +2 -0
  145. package/script/deps/deno.land/std@0.205.0/path/_common/from_file_url.js +13 -0
  146. package/script/deps/deno.land/std@0.205.0/path/_common/glob_to_reg_exp.d.ts +27 -0
  147. package/script/deps/deno.land/{std@0.201.0/path/glob.js → std@0.205.0/path/_common/glob_to_reg_exp.js} +15 -167
  148. package/script/deps/deno.land/std@0.205.0/path/_common/is_glob.d.ts +2 -0
  149. package/script/deps/deno.land/std@0.205.0/path/_common/is_glob.js +32 -0
  150. package/script/deps/deno.land/std@0.205.0/path/_common/normalize.d.ts +1 -0
  151. package/script/deps/deno.land/std@0.205.0/path/_common/normalize.js +12 -0
  152. package/script/deps/deno.land/std@0.205.0/path/_common/normalize_string.d.ts +1 -0
  153. package/script/deps/deno.land/{std@0.201.0/path/_util.js → std@0.205.0/path/_common/normalize_string.js} +6 -41
  154. package/script/deps/deno.land/std@0.205.0/path/_common/relative.d.ts +1 -0
  155. package/script/deps/deno.land/std@0.205.0/path/_common/relative.js +13 -0
  156. package/script/deps/deno.land/std@0.205.0/path/_common/strip_trailing_separators.d.ts +1 -0
  157. package/script/deps/deno.land/std@0.205.0/path/_common/strip_trailing_separators.js +23 -0
  158. package/script/deps/deno.land/std@0.205.0/path/_common/to_file_url.d.ts +1 -0
  159. package/script/deps/deno.land/std@0.205.0/path/_common/to_file_url.js +19 -0
  160. package/script/deps/deno.land/std@0.205.0/path/_os.d.ts +3 -0
  161. package/script/deps/deno.land/{std@0.201.0 → std@0.205.0}/path/_os.js +4 -4
  162. package/script/deps/deno.land/std@0.205.0/path/basename.d.ts +8 -0
  163. package/script/deps/deno.land/{std@0.201.0 → std@0.205.0}/path/basename.js +4 -3
  164. package/script/deps/deno.land/std@0.205.0/path/common.d.ts +13 -0
  165. package/script/deps/deno.land/std@0.205.0/path/common.js +23 -0
  166. package/script/deps/deno.land/std@0.205.0/path/dirname.d.ts +5 -0
  167. package/script/deps/deno.land/{std@0.201.0 → std@0.205.0}/path/dirname.js +3 -2
  168. package/script/deps/deno.land/std@0.205.0/path/extname.d.ts +6 -0
  169. package/script/deps/deno.land/{std@0.201.0 → std@0.205.0}/path/extname.js +3 -2
  170. package/script/deps/deno.land/{std@0.201.0 → std@0.205.0}/path/format.js +3 -2
  171. package/script/deps/deno.land/{std@0.201.0 → std@0.205.0}/path/from_file_url.js +3 -2
  172. package/script/deps/deno.land/std@0.205.0/path/glob.d.ts +67 -0
  173. package/script/deps/deno.land/std@0.205.0/path/glob.js +85 -0
  174. package/script/deps/deno.land/std@0.205.0/path/is_absolute.d.ts +5 -0
  175. package/script/deps/deno.land/{std@0.201.0 → std@0.205.0}/path/is_absolute.js +3 -2
  176. package/script/deps/deno.land/std@0.205.0/path/join.d.ts +5 -0
  177. package/script/deps/deno.land/{std@0.201.0 → std@0.205.0}/path/join.js +3 -2
  178. package/script/deps/deno.land/{std@0.201.0 → std@0.205.0}/path/mod.d.ts +6 -3
  179. package/script/deps/deno.land/std@0.205.0/path/mod.js +89 -0
  180. package/script/deps/deno.land/std@0.205.0/path/normalize.d.ts +7 -0
  181. package/script/deps/deno.land/{std@0.201.0 → std@0.205.0}/path/normalize.js +3 -2
  182. package/script/deps/deno.land/{std@0.201.0 → std@0.205.0}/path/parse.js +3 -2
  183. package/script/deps/deno.land/std@0.205.0/path/posix/_util.d.ts +1 -0
  184. package/script/deps/deno.land/std@0.205.0/path/posix/_util.js +12 -0
  185. package/script/deps/deno.land/std@0.205.0/path/posix/basename.d.ts +8 -0
  186. package/script/deps/deno.land/std@0.205.0/path/posix/basename.js +22 -0
  187. package/script/deps/deno.land/std@0.205.0/path/posix/common.d.ts +13 -0
  188. package/script/deps/deno.land/std@0.205.0/path/posix/common.js +23 -0
  189. package/script/deps/deno.land/std@0.205.0/path/posix/dirname.d.ts +5 -0
  190. package/script/deps/deno.land/std@0.205.0/path/posix/dirname.js +40 -0
  191. package/script/deps/deno.land/std@0.205.0/path/posix/extname.d.ts +6 -0
  192. package/script/deps/deno.land/std@0.205.0/path/posix/extname.js +63 -0
  193. package/script/deps/deno.land/std@0.205.0/path/posix/format.d.ts +6 -0
  194. package/script/deps/deno.land/std@0.205.0/path/posix/format.js +15 -0
  195. package/script/deps/deno.land/std@0.205.0/path/posix/from_file_url.d.ts +12 -0
  196. package/script/deps/deno.land/std@0.205.0/path/posix/from_file_url.js +21 -0
  197. package/script/deps/deno.land/std@0.205.0/path/posix/glob.d.ts +62 -0
  198. package/script/deps/deno.land/std@0.205.0/path/posix/glob.js +113 -0
  199. package/script/deps/deno.land/std@0.205.0/path/posix/is_absolute.d.ts +5 -0
  200. package/script/deps/deno.land/std@0.205.0/path/posix/is_absolute.js +16 -0
  201. package/script/deps/deno.land/std@0.205.0/path/posix/join.d.ts +5 -0
  202. package/script/deps/deno.land/std@0.205.0/path/posix/join.js +30 -0
  203. package/script/deps/deno.land/std@0.205.0/path/posix/mod.d.ts +37 -0
  204. package/script/deps/deno.land/{std@0.201.0/path → std@0.205.0/path/posix}/mod.js +5 -21
  205. package/script/deps/deno.land/std@0.205.0/path/posix/normalize.d.ts +7 -0
  206. package/script/deps/deno.land/std@0.205.0/path/posix/normalize.js +29 -0
  207. package/script/deps/deno.land/std@0.205.0/path/posix/parse.d.ts +6 -0
  208. package/script/deps/deno.land/std@0.205.0/path/posix/parse.js +102 -0
  209. package/script/deps/deno.land/std@0.205.0/path/posix/relative.d.ts +7 -0
  210. package/script/deps/deno.land/std@0.205.0/path/posix/relative.js +98 -0
  211. package/script/deps/deno.land/std@0.205.0/path/posix/resolve.d.ts +5 -0
  212. package/script/deps/deno.land/std@0.205.0/path/posix/resolve.js +75 -0
  213. package/script/deps/deno.land/std@0.205.0/path/posix/separator.d.ts +2 -0
  214. package/script/deps/deno.land/std@0.205.0/path/posix/separator.js +7 -0
  215. package/script/deps/deno.land/std@0.205.0/path/posix/to_file_url.d.ts +12 -0
  216. package/script/deps/deno.land/std@0.205.0/path/posix/to_file_url.js +26 -0
  217. package/script/deps/deno.land/std@0.205.0/path/posix/to_namespaced_path.d.ts +5 -0
  218. package/script/deps/deno.land/std@0.205.0/path/posix/to_namespaced_path.js +14 -0
  219. package/script/deps/deno.land/{std@0.201.0/path/_relative.d.ts → std@0.205.0/path/relative.d.ts} +1 -8
  220. package/script/deps/deno.land/{std@0.201.0 → std@0.205.0}/path/relative.js +3 -2
  221. package/script/deps/deno.land/std@0.205.0/path/resolve.d.ts +5 -0
  222. package/script/deps/deno.land/{std@0.201.0 → std@0.205.0}/path/resolve.js +4 -3
  223. package/script/deps/deno.land/{std@0.201.0 → std@0.205.0}/path/to_file_url.js +3 -2
  224. package/script/deps/deno.land/std@0.205.0/path/to_namespaced_path.d.ts +5 -0
  225. package/script/deps/deno.land/{std@0.201.0 → std@0.205.0}/path/to_namespaced_path.js +4 -3
  226. package/script/deps/deno.land/std@0.205.0/path/windows/_util.d.ts +3 -0
  227. package/script/deps/deno.land/std@0.205.0/path/windows/_util.js +21 -0
  228. package/script/deps/deno.land/std@0.205.0/path/windows/basename.d.ts +8 -0
  229. package/script/deps/deno.land/std@0.205.0/path/windows/basename.js +34 -0
  230. package/script/deps/deno.land/std@0.205.0/path/windows/common.d.ts +13 -0
  231. package/script/deps/deno.land/std@0.205.0/path/windows/common.js +23 -0
  232. package/script/deps/deno.land/std@0.205.0/path/windows/dirname.d.ts +5 -0
  233. package/script/deps/deno.land/{std@0.201.0/path/_dirname.js → std@0.205.0/path/windows/dirname.js} +9 -44
  234. package/script/deps/deno.land/std@0.205.0/path/windows/extname.d.ts +6 -0
  235. package/script/deps/deno.land/{std@0.201.0/path/_extname.js → std@0.205.0/path/windows/extname.js} +8 -62
  236. package/script/deps/deno.land/std@0.205.0/path/windows/format.d.ts +6 -0
  237. package/script/deps/deno.land/std@0.205.0/path/windows/format.js +15 -0
  238. package/script/deps/deno.land/{std@0.201.0/path/_from_file_url.d.ts → std@0.205.0/path/windows/from_file_url.d.ts} +1 -12
  239. package/script/deps/deno.land/{std@0.201.0/path/_from_file_url.js → std@0.205.0/path/windows/from_file_url.js} +5 -26
  240. package/script/deps/deno.land/std@0.205.0/path/windows/glob.d.ts +62 -0
  241. package/script/deps/deno.land/std@0.205.0/path/windows/glob.js +113 -0
  242. package/script/deps/deno.land/std@0.205.0/path/windows/is_absolute.d.ts +5 -0
  243. package/script/deps/deno.land/{std@0.201.0/path/_is_absolute.js → std@0.205.0/path/windows/is_absolute.js} +7 -15
  244. package/script/deps/deno.land/std@0.205.0/path/windows/join.d.ts +5 -0
  245. package/script/deps/deno.land/{std@0.201.0/path/_join.js → std@0.205.0/path/windows/join.js} +8 -30
  246. package/script/deps/deno.land/std@0.205.0/path/windows/mod.d.ts +37 -0
  247. package/script/deps/deno.land/std@0.205.0/path/windows/mod.js +58 -0
  248. package/script/deps/deno.land/std@0.205.0/path/windows/normalize.d.ts +7 -0
  249. package/script/deps/deno.land/{std@0.201.0/path/_normalize.js → std@0.205.0/path/windows/normalize.js} +9 -33
  250. package/script/deps/deno.land/std@0.205.0/path/windows/parse.d.ts +6 -0
  251. package/script/deps/deno.land/{std@0.201.0/path/_parse.js → std@0.205.0/path/windows/parse.js} +8 -100
  252. package/script/deps/deno.land/std@0.205.0/path/windows/relative.d.ts +12 -0
  253. package/script/deps/deno.land/std@0.205.0/path/windows/relative.js +125 -0
  254. package/script/deps/deno.land/std@0.205.0/path/windows/resolve.d.ts +5 -0
  255. package/script/deps/deno.land/{std@0.201.0/path/_resolve.js → std@0.205.0/path/windows/resolve.js} +10 -51
  256. package/script/deps/deno.land/std@0.205.0/path/windows/separator.d.ts +2 -0
  257. package/script/deps/deno.land/std@0.205.0/path/windows/separator.js +7 -0
  258. package/{esm/deps/deno.land/std@0.201.0/path/_to_file_url.d.ts → script/deps/deno.land/std@0.205.0/path/windows/to_file_url.d.ts} +1 -12
  259. package/script/deps/deno.land/std@0.205.0/path/windows/to_file_url.js +35 -0
  260. package/script/deps/deno.land/std@0.205.0/path/windows/to_namespaced_path.d.ts +5 -0
  261. package/script/deps/deno.land/{std@0.201.0/path/_to_namespaced_path.js → std@0.205.0/path/windows/to_namespaced_path.js} +11 -20
  262. package/script/deps.d.ts +2 -1
  263. package/script/deps.js +3 -2
  264. package/script/mod.d.ts +1 -0
  265. package/script/mod.js +1 -0
  266. package/script/plugins/escape.js +2 -12
  267. package/script/plugins/export.js +5 -4
  268. package/script/plugins/import.js +4 -11
  269. package/script/plugins/include.js +3 -2
  270. package/script/plugins/layout.js +4 -3
  271. package/script/plugins/set.js +5 -4
  272. package/script/plugins/unescape.js +2 -12
  273. package/script/src/environment.d.ts +6 -0
  274. package/script/src/environment.js +57 -32
  275. package/script/src/tokenizer.d.ts +7 -2
  276. package/script/src/tokenizer.js +77 -66
  277. package/esm/deps/deno.land/std@0.201.0/path/_basename.d.ts +0 -16
  278. package/esm/deps/deno.land/std@0.201.0/path/_basename.js +0 -78
  279. package/esm/deps/deno.land/std@0.201.0/path/_dirname.d.ts +0 -10
  280. package/esm/deps/deno.land/std@0.201.0/path/_extname.d.ts +0 -12
  281. package/esm/deps/deno.land/std@0.201.0/path/_format.d.ts +0 -11
  282. package/esm/deps/deno.land/std@0.201.0/path/_is_absolute.d.ts +0 -10
  283. package/esm/deps/deno.land/std@0.201.0/path/_join.d.ts +0 -10
  284. package/esm/deps/deno.land/std@0.201.0/path/_normalize.d.ts +0 -14
  285. package/esm/deps/deno.land/std@0.201.0/path/_os.d.ts +0 -4
  286. package/esm/deps/deno.land/std@0.201.0/path/_parse.d.ts +0 -11
  287. package/esm/deps/deno.land/std@0.201.0/path/_relative.d.ts +0 -19
  288. package/esm/deps/deno.land/std@0.201.0/path/_resolve.d.ts +0 -10
  289. package/esm/deps/deno.land/std@0.201.0/path/_to_namespaced_path.d.ts +0 -10
  290. package/esm/deps/deno.land/std@0.201.0/path/_util.d.ts +0 -6
  291. package/esm/deps/deno.land/std@0.201.0/path/posix.d.ts +0 -15
  292. package/esm/deps/deno.land/std@0.201.0/path/posix.js +0 -19
  293. package/esm/deps/deno.land/std@0.201.0/path/win32.d.ts +0 -15
  294. package/esm/deps/deno.land/std@0.201.0/path/win32.js +0 -19
  295. package/script/deps/deno.land/std@0.201.0/path/_basename.d.ts +0 -16
  296. package/script/deps/deno.land/std@0.201.0/path/_basename.js +0 -83
  297. package/script/deps/deno.land/std@0.201.0/path/_dirname.d.ts +0 -10
  298. package/script/deps/deno.land/std@0.201.0/path/_extname.d.ts +0 -12
  299. package/script/deps/deno.land/std@0.201.0/path/_format.d.ts +0 -11
  300. package/script/deps/deno.land/std@0.201.0/path/_format.js +0 -40
  301. package/script/deps/deno.land/std@0.201.0/path/_is_absolute.d.ts +0 -10
  302. package/script/deps/deno.land/std@0.201.0/path/_join.d.ts +0 -10
  303. package/script/deps/deno.land/std@0.201.0/path/_normalize.d.ts +0 -14
  304. package/script/deps/deno.land/std@0.201.0/path/_os.d.ts +0 -4
  305. package/script/deps/deno.land/std@0.201.0/path/_parse.d.ts +0 -11
  306. package/script/deps/deno.land/std@0.201.0/path/_relative.js +0 -221
  307. package/script/deps/deno.land/std@0.201.0/path/_resolve.d.ts +0 -10
  308. package/script/deps/deno.land/std@0.201.0/path/_to_file_url.js +0 -66
  309. package/script/deps/deno.land/std@0.201.0/path/_to_namespaced_path.d.ts +0 -10
  310. package/script/deps/deno.land/std@0.201.0/path/_util.d.ts +0 -6
  311. package/script/deps/deno.land/std@0.201.0/path/posix.d.ts +0 -15
  312. package/script/deps/deno.land/std@0.201.0/path/posix.js +0 -35
  313. package/script/deps/deno.land/std@0.201.0/path/win32.d.ts +0 -15
  314. package/script/deps/deno.land/std@0.201.0/path/win32.js +0 -35
  315. /package/esm/deps/deno.land/{std@0.201.0 → std@0.205.0}/assert/assert.d.ts +0 -0
  316. /package/esm/deps/deno.land/{std@0.201.0 → std@0.205.0}/assert/assert.js +0 -0
  317. /package/esm/deps/deno.land/{std@0.201.0 → std@0.205.0}/assert/assertion_error.d.ts +0 -0
  318. /package/esm/deps/deno.land/{std@0.201.0 → std@0.205.0}/assert/assertion_error.js +0 -0
  319. /package/esm/deps/deno.land/{std@0.201.0/path/_constants.d.ts → std@0.205.0/path/_common/constants.d.ts} +0 -0
  320. /package/esm/deps/deno.land/{std@0.201.0/path/_constants.js → std@0.205.0/path/_common/constants.js} +0 -0
  321. /package/esm/deps/deno.land/{std@0.201.0 → std@0.205.0}/path/_interface.d.ts +0 -0
  322. /package/esm/deps/deno.land/{std@0.201.0 → std@0.205.0}/path/_interface.js +0 -0
  323. /package/esm/deps/deno.land/{std@0.201.0 → std@0.205.0}/path/basename.d.ts +0 -0
  324. /package/esm/deps/deno.land/{std@0.201.0 → std@0.205.0}/path/common.d.ts +0 -0
  325. /package/esm/deps/deno.land/{std@0.201.0 → std@0.205.0}/path/dirname.d.ts +0 -0
  326. /package/esm/deps/deno.land/{std@0.201.0 → std@0.205.0}/path/extname.d.ts +0 -0
  327. /package/esm/deps/deno.land/{std@0.201.0 → std@0.205.0}/path/format.d.ts +0 -0
  328. /package/esm/deps/deno.land/{std@0.201.0 → std@0.205.0}/path/from_file_url.d.ts +0 -0
  329. /package/esm/deps/deno.land/{std@0.201.0 → std@0.205.0}/path/is_absolute.d.ts +0 -0
  330. /package/esm/deps/deno.land/{std@0.201.0 → std@0.205.0}/path/join.d.ts +0 -0
  331. /package/esm/deps/deno.land/{std@0.201.0 → std@0.205.0}/path/normalize.d.ts +0 -0
  332. /package/esm/deps/deno.land/{std@0.201.0 → std@0.205.0}/path/parse.d.ts +0 -0
  333. /package/{script/deps/deno.land/std@0.201.0/path → esm/deps/deno.land/std@0.205.0/path/posix}/basename.d.ts +0 -0
  334. /package/{script/deps/deno.land/std@0.201.0/path → esm/deps/deno.land/std@0.205.0/path/posix}/common.d.ts +0 -0
  335. /package/{script/deps/deno.land/std@0.201.0/path → esm/deps/deno.land/std@0.205.0/path/posix}/dirname.d.ts +0 -0
  336. /package/{script/deps/deno.land/std@0.201.0/path → esm/deps/deno.land/std@0.205.0/path/posix}/extname.d.ts +0 -0
  337. /package/{script/deps/deno.land/std@0.201.0/path → esm/deps/deno.land/std@0.205.0/path/posix}/is_absolute.d.ts +0 -0
  338. /package/{script/deps/deno.land/std@0.201.0/path → esm/deps/deno.land/std@0.205.0/path/posix}/join.d.ts +0 -0
  339. /package/{script/deps/deno.land/std@0.201.0/path → esm/deps/deno.land/std@0.205.0/path/posix}/normalize.d.ts +0 -0
  340. /package/esm/deps/deno.land/{std@0.201.0/path → std@0.205.0/path/posix}/resolve.d.ts +0 -0
  341. /package/esm/deps/deno.land/{std@0.201.0/path → std@0.205.0/path/posix}/to_namespaced_path.d.ts +0 -0
  342. /package/esm/deps/deno.land/{std@0.201.0 → std@0.205.0}/path/relative.d.ts +0 -0
  343. /package/{script/deps/deno.land/std@0.201.0 → esm/deps/deno.land/std@0.205.0}/path/resolve.d.ts +0 -0
  344. /package/esm/deps/deno.land/{std@0.201.0 → std@0.205.0}/path/separator.d.ts +0 -0
  345. /package/esm/deps/deno.land/{std@0.201.0 → std@0.205.0}/path/separator.js +0 -0
  346. /package/esm/deps/deno.land/{std@0.201.0 → std@0.205.0}/path/to_file_url.d.ts +0 -0
  347. /package/{script/deps/deno.land/std@0.201.0 → esm/deps/deno.land/std@0.205.0}/path/to_namespaced_path.d.ts +0 -0
  348. /package/{script/deps/deno.land/std@0.201.0/path → esm/deps/deno.land/std@0.205.0/path/windows}/relative.d.ts +0 -0
  349. /package/script/deps/deno.land/{std@0.201.0 → std@0.205.0}/assert/assert.d.ts +0 -0
  350. /package/script/deps/deno.land/{std@0.201.0 → std@0.205.0}/assert/assert.js +0 -0
  351. /package/script/deps/deno.land/{std@0.201.0 → std@0.205.0}/assert/assertion_error.d.ts +0 -0
  352. /package/script/deps/deno.land/{std@0.201.0 → std@0.205.0}/assert/assertion_error.js +0 -0
  353. /package/script/deps/deno.land/{std@0.201.0/path/_constants.d.ts → std@0.205.0/path/_common/constants.d.ts} +0 -0
  354. /package/script/deps/deno.land/{std@0.201.0/path/_constants.js → std@0.205.0/path/_common/constants.js} +0 -0
  355. /package/script/deps/deno.land/{std@0.201.0 → std@0.205.0}/path/_interface.d.ts +0 -0
  356. /package/script/deps/deno.land/{std@0.201.0 → std@0.205.0}/path/_interface.js +0 -0
  357. /package/script/deps/deno.land/{std@0.201.0 → std@0.205.0}/path/format.d.ts +0 -0
  358. /package/script/deps/deno.land/{std@0.201.0 → std@0.205.0}/path/from_file_url.d.ts +0 -0
  359. /package/script/deps/deno.land/{std@0.201.0 → std@0.205.0}/path/parse.d.ts +0 -0
  360. /package/script/deps/deno.land/{std@0.201.0 → std@0.205.0}/path/separator.d.ts +0 -0
  361. /package/script/deps/deno.land/{std@0.201.0 → std@0.205.0}/path/separator.js +0 -0
  362. /package/script/deps/deno.land/{std@0.201.0 → std@0.205.0}/path/to_file_url.d.ts +0 -0
package/README.md CHANGED
@@ -1,7 +1,7 @@
1
- # VENTO
1
+ # Vento
2
2
 
3
3
  This is a minimal template engine inspired by other great engines like Nunjucks,
4
- Liquid, Mustache or EJS.
4
+ Liquid, Mustache, and EJS.
5
5
 
6
6
  ## Why another template engine?
7
7
 
@@ -32,6 +32,7 @@ neither is). The issues I found in existing template engines:
32
32
  ### Liquid
33
33
 
34
34
  - I like:
35
+
35
36
  - The support for async evaluation is less hacky than Nunjucks.
36
37
  - The variables are not escaped by default, there's an `escape` filter for
37
38
  that.
@@ -91,66 +92,9 @@ First, let's take a look at this syntax example:
91
92
 
92
93
  ## Getting started
93
94
 
94
- This is a library for Deno. ~~I'm planning to release an NPM version in the
95
- future.~~
96
- [There's already an NPM version](https://www.npmjs.com/package/ventojs) that you
97
- can install with `npm install ventojs`.
98
-
99
- Import the library and create an instance:
100
-
101
- ```ts
102
- import vento from "https://deno.land/x/vento/mod.ts";
103
-
104
- const vto = vento({
105
- // Resolve the non-relative includes paths
106
- includes: "./path/to/includes",
107
- });
108
- ```
109
-
110
- Or in Node:
111
-
112
- ```ts
113
- import vento from "ventojs";
114
-
115
- const vto = vento({
116
- // Resolve the non-relative includes paths
117
- includes: "./path/to/includes",
118
- });
119
- ```
120
-
121
- There are different ways to load, compile and run a template. For example, you
122
- can use `load` to load and compile a template file and return it.
123
-
124
- ```ts
125
- // Load and return a template
126
- const template = await vto.load("my-template.vto");
127
-
128
- // Now you can use it passing the data
129
- const result = await template({ title: "Hello world" });
130
- console.log(result.content);
131
- ```
132
-
133
- Alternatively, you can load and run the template file in a single call:
134
-
135
- ```ts
136
- const result = await vto.run("my-template.vto", { title: "Hello world" });
137
- console.log(result.content);
138
- ```
139
-
140
- If the template code is not a file, you can run it directly:
141
-
142
- ```ts
143
- const result = await vto.runString("<h1>{{ title }}</h1>", {
144
- title: "Hello world",
145
- });
146
- console.log(result.content);
147
- ```
148
-
149
- ## Visual Studio Code Support
150
-
151
- [The Vento extension for VS Code](https://marketplace.visualstudio.com/items?itemName=oscarotero.vento-syntax)
152
- enables syntax highlight and provides some useful snippets.
95
+ See [Getting started](https://vento.js.org/getting-started/) on the docs.
153
96
 
154
- ## API
97
+ ## Editor support
155
98
 
156
- [Read the docs](https://oscarotero.github.io/vento/)
99
+ See [Editor integrations](https://vento.js.org/editor-integrations/) on the
100
+ docs.
@@ -0,0 +1,38 @@
1
+ export type EntityList = Record<string, string>;
2
+ /**
3
+ * Escapes text for safe interpolation into HTML text content and quoted attributes
4
+ *
5
+ * @example
6
+ * ```ts
7
+ * import { escape } from "https://deno.land/std@$STD_VERSION/html/entities.ts";
8
+ * import { assertEquals } from "https://deno.land/std@$STD_VERSION/assert/assert_equals.ts";
9
+ *
10
+ * assertEquals(escape("<>'&AA"), "&lt;&gt;&#39;&amp;AA");
11
+ *
12
+ * // characters that don't need to be escaped will be left alone,
13
+ * // even if named HTML entities exist for them
14
+ * assertEquals(escape("þð"), "þð");
15
+ * ```
16
+ */
17
+ export declare function escape(str: string): string;
18
+ export type UnescapeOptions = {
19
+ entityList: EntityList;
20
+ };
21
+ /**
22
+ * Unescapes HTML entities in text
23
+ *
24
+ * @example
25
+ * ```ts
26
+ * import { unescape } from "https://deno.land/std@$STD_VERSION/html/entities.ts";
27
+ * import { assertEquals } from "https://deno.land/std@$STD_VERSION/assert/assert_equals.ts";
28
+ *
29
+ * // default options (only handles &<>'" and numeric entities)
30
+ * assertEquals(unescape("&lt;&gt;&apos;&amp;&#65;&#x41;"), "<>'&AA");
31
+ * assertEquals(unescape("&thorn;&eth;"), "&thorn;&eth;");
32
+ *
33
+ * // using the full named entity list from the HTML spec (~47K unminified)
34
+ * import entityList from "https://deno.land/std@$STD_VERSION/html/named_entity_list.json" assert { type: "json" };
35
+ * assertEquals(unescape("&thorn;&eth;", { entityList }), "þð");
36
+ * ```
37
+ */
38
+ export declare function unescape(str: string, options?: Partial<UnescapeOptions>): string;
@@ -0,0 +1,76 @@
1
+ // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
2
+ // This module is browser compatible.
3
+ const rawToEntityEntries = [
4
+ ["&", "&amp;"],
5
+ ["<", "&lt;"],
6
+ [">", "&gt;"],
7
+ ['"', "&quot;"],
8
+ ["'", "&#39;"],
9
+ ];
10
+ const defaultEntityList = Object.fromEntries([
11
+ ...rawToEntityEntries.map(([raw, entity]) => [entity, raw]),
12
+ ["&apos;", "'"],
13
+ ["&nbsp;", "\xa0"],
14
+ ]);
15
+ const rawToEntity = new Map(rawToEntityEntries);
16
+ const rawRe = new RegExp(`[${[...rawToEntity.keys()].join("")}]`, "g");
17
+ /**
18
+ * Escapes text for safe interpolation into HTML text content and quoted attributes
19
+ *
20
+ * @example
21
+ * ```ts
22
+ * import { escape } from "https://deno.land/std@$STD_VERSION/html/entities.ts";
23
+ * import { assertEquals } from "https://deno.land/std@$STD_VERSION/assert/assert_equals.ts";
24
+ *
25
+ * assertEquals(escape("<>'&AA"), "&lt;&gt;&#39;&amp;AA");
26
+ *
27
+ * // characters that don't need to be escaped will be left alone,
28
+ * // even if named HTML entities exist for them
29
+ * assertEquals(escape("þð"), "þð");
30
+ * ```
31
+ */
32
+ export function escape(str) {
33
+ return str.replaceAll(rawRe, (m) => rawToEntity.get(m));
34
+ }
35
+ const defaultUnescapeOptions = {
36
+ entityList: defaultEntityList,
37
+ };
38
+ const MAX_CODE_POINT = 0x10ffff;
39
+ const RX_DEC_ENTITY = /&#([0-9]+);/g;
40
+ const RX_HEX_ENTITY = /&#x(\p{AHex}+);/gu;
41
+ const entityListRegexCache = new WeakMap();
42
+ /**
43
+ * Unescapes HTML entities in text
44
+ *
45
+ * @example
46
+ * ```ts
47
+ * import { unescape } from "https://deno.land/std@$STD_VERSION/html/entities.ts";
48
+ * import { assertEquals } from "https://deno.land/std@$STD_VERSION/assert/assert_equals.ts";
49
+ *
50
+ * // default options (only handles &<>'" and numeric entities)
51
+ * assertEquals(unescape("&lt;&gt;&apos;&amp;&#65;&#x41;"), "<>'&AA");
52
+ * assertEquals(unescape("&thorn;&eth;"), "&thorn;&eth;");
53
+ *
54
+ * // using the full named entity list from the HTML spec (~47K unminified)
55
+ * import entityList from "https://deno.land/std@$STD_VERSION/html/named_entity_list.json" assert { type: "json" };
56
+ * assertEquals(unescape("&thorn;&eth;", { entityList }), "þð");
57
+ * ```
58
+ */
59
+ export function unescape(str, options = {}) {
60
+ const { entityList } = { ...defaultUnescapeOptions, ...options };
61
+ let entityRe = entityListRegexCache.get(entityList);
62
+ if (!entityRe) {
63
+ entityRe = new RegExp(`(${Object.keys(entityList)
64
+ .sort((a, b) => b.length - a.length)
65
+ .join("|")})`, "g");
66
+ entityListRegexCache.set(entityList, entityRe);
67
+ }
68
+ return str
69
+ .replaceAll(entityRe, (m) => entityList[m])
70
+ .replaceAll(RX_DEC_ENTITY, (_, dec) => codePointStrToChar(dec, 10))
71
+ .replaceAll(RX_HEX_ENTITY, (_, hex) => codePointStrToChar(hex, 16));
72
+ }
73
+ function codePointStrToChar(codePointStr, radix) {
74
+ const codePoint = parseInt(codePointStr, radix);
75
+ return codePoint > MAX_CODE_POINT ? "�" : String.fromCodePoint(codePoint);
76
+ }
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Functions for HTML tasks such as escaping or unescaping HTML entities
3
+ *
4
+ * @module
5
+ */
6
+ export * from "./entities.js";
@@ -0,0 +1,8 @@
1
+ // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
2
+ // This module is browser compatible.
3
+ /**
4
+ * Functions for HTML tasks such as escaping or unescaping HTML entities
5
+ *
6
+ * @module
7
+ */
8
+ export * from "./entities.js";
@@ -0,0 +1 @@
1
+ export declare function assertPath(path: string): void;
@@ -0,0 +1,7 @@
1
+ // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
2
+ // Copyright the Browserify authors. MIT License.
3
+ export function assertPath(path) {
4
+ if (typeof path !== "string") {
5
+ throw new TypeError(`Path must be a string. Received ${JSON.stringify(path)}`);
6
+ }
7
+ }
@@ -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,40 @@
1
+ // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
2
+ // This module is browser compatible.
3
+ import { assertPath } from "./assert_path.js";
4
+ export function stripSuffix(name, suffix) {
5
+ if (suffix.length >= name.length) {
6
+ return name;
7
+ }
8
+ const lenDiff = name.length - suffix.length;
9
+ for (let i = suffix.length - 1; i >= 0; --i) {
10
+ if (name.charCodeAt(lenDiff + i) !== suffix.charCodeAt(i)) {
11
+ return name;
12
+ }
13
+ }
14
+ return name.slice(0, -suffix.length);
15
+ }
16
+ export function lastPathSegment(path, isSep, start = 0) {
17
+ let matchedNonSeparator = false;
18
+ let end = path.length;
19
+ for (let i = path.length - 1; i >= start; --i) {
20
+ if (isSep(path.charCodeAt(i))) {
21
+ if (matchedNonSeparator) {
22
+ start = i + 1;
23
+ break;
24
+ }
25
+ }
26
+ else if (!matchedNonSeparator) {
27
+ matchedNonSeparator = true;
28
+ end = i + 1;
29
+ }
30
+ }
31
+ return path.slice(start, end);
32
+ }
33
+ export function assertArgs(path, suffix) {
34
+ assertPath(path);
35
+ if (path.length === 0)
36
+ return path;
37
+ if (typeof suffix !== "string") {
38
+ throw new TypeError(`Suffix must be a string. Received ${JSON.stringify(suffix)}`);
39
+ }
40
+ }
@@ -0,0 +1 @@
1
+ export declare function _common(paths: string[], sep: string): string;
@@ -1,19 +1,6 @@
1
1
  // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
2
2
  // This module is browser compatible.
3
- import { SEP } from "./separator.js";
4
- /** Determines the common path from a set of paths, using an optional separator,
5
- * which defaults to the OS default separator.
6
- *
7
- * ```ts
8
- * import { common } from "https://deno.land/std@$STD_VERSION/path/mod.ts";
9
- * const p = common([
10
- * "./deno/std/path/mod.ts",
11
- * "./deno/std/fs/mod.ts",
12
- * ]);
13
- * console.log(p); // "./deno/std/"
14
- * ```
15
- */
16
- export function common(paths, sep = SEP) {
3
+ export function _common(paths, sep) {
17
4
  const [first = "", ...remaining] = paths;
18
5
  if (first === "" || remaining.length === 0) {
19
6
  return first.substring(0, first.lastIndexOf(sep) + 1);
@@ -0,0 +1 @@
1
+ export declare function assertArg(path: string): "." | undefined;
@@ -0,0 +1,8 @@
1
+ // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
2
+ // This module is browser compatible.
3
+ import { assertPath } from "./assert_path.js";
4
+ export function assertArg(path) {
5
+ assertPath(path);
6
+ if (path.length === 0)
7
+ return ".";
8
+ }
@@ -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;
@@ -0,0 +1,19 @@
1
+ // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
2
+ // This module is browser compatible.
3
+ export function _format(sep, pathObject) {
4
+ const dir = pathObject.dir || pathObject.root;
5
+ const base = pathObject.base ||
6
+ (pathObject.name || "") + (pathObject.ext || "");
7
+ if (!dir)
8
+ return base;
9
+ if (base === sep)
10
+ return dir;
11
+ if (dir === pathObject.root)
12
+ return dir + base;
13
+ return dir + sep + base;
14
+ }
15
+ export function assertArg(pathObject) {
16
+ if (pathObject === null || typeof pathObject !== "object") {
17
+ throw new TypeError(`The "pathObject" argument must be of type Object. Received type ${typeof pathObject}`);
18
+ }
19
+ }
@@ -0,0 +1,2 @@
1
+ /// <reference types="node" />
2
+ export declare function assertArg(url: URL | string): URL;
@@ -0,0 +1,9 @@
1
+ // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
2
+ // This module is browser compatible.
3
+ export function assertArg(url) {
4
+ url = url instanceof URL ? url : new URL(url);
5
+ if (url.protocol !== "file:") {
6
+ throw new TypeError("Must be a file URL.");
7
+ }
8
+ return url;
9
+ }
@@ -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,11 +1,5 @@
1
1
  // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
2
2
  // This module is browser compatible.
3
- import { isWindows, osType } from "./_os.js";
4
- import { SEP, SEP_PATTERN } from "./separator.js";
5
- import * as _win32 from "./win32.js";
6
- import * as _posix from "./posix.js";
7
- const path = isWindows ? _win32 : _posix;
8
- const { join, normalize } = path;
9
3
  const regExpEscapeChars = [
10
4
  "!",
11
5
  "$",
@@ -23,76 +17,15 @@ const regExpEscapeChars = [
23
17
  "|",
24
18
  ];
25
19
  const rangeEscapeChars = ["-", "\\", "]"];
26
- /** Convert a glob string to a regular expression.
27
- *
28
- * Tries to match bash glob expansion as closely as possible.
29
- *
30
- * Basic glob syntax:
31
- * - `*` - Matches everything without leaving the path segment.
32
- * - `?` - Matches any single character.
33
- * - `{foo,bar}` - Matches `foo` or `bar`.
34
- * - `[abcd]` - Matches `a`, `b`, `c` or `d`.
35
- * - `[a-d]` - Matches `a`, `b`, `c` or `d`.
36
- * - `[!abcd]` - Matches any single character besides `a`, `b`, `c` or `d`.
37
- * - `[[:<class>:]]` - Matches any character belonging to `<class>`.
38
- * - `[[:alnum:]]` - Matches any digit or letter.
39
- * - `[[:digit:]abc]` - Matches any digit, `a`, `b` or `c`.
40
- * - See https://facelessuser.github.io/wcmatch/glob/#posix-character-classes
41
- * for a complete list of supported character classes.
42
- * - `\` - Escapes the next character for an `os` other than `"windows"`.
43
- * - \` - Escapes the next character for `os` set to `"windows"`.
44
- * - `/` - Path separator.
45
- * - `\` - Additional path separator only for `os` set to `"windows"`.
46
- *
47
- * Extended syntax:
48
- * - Requires `{ extended: true }`.
49
- * - `?(foo|bar)` - Matches 0 or 1 instance of `{foo,bar}`.
50
- * - `@(foo|bar)` - Matches 1 instance of `{foo,bar}`. They behave the same.
51
- * - `*(foo|bar)` - Matches _n_ instances of `{foo,bar}`.
52
- * - `+(foo|bar)` - Matches _n > 0_ instances of `{foo,bar}`.
53
- * - `!(foo|bar)` - Matches anything other than `{foo,bar}`.
54
- * - See https://www.linuxjournal.com/content/bash-extended-globbing.
55
- *
56
- * Globstar syntax:
57
- * - Requires `{ globstar: true }`.
58
- * - `**` - Matches any number of any path segments.
59
- * - Must comprise its entire path segment in the provided glob.
60
- * - See https://www.linuxjournal.com/content/globstar-new-bash-globbing-option.
61
- *
62
- * Note the following properties:
63
- * - The generated `RegExp` is anchored at both start and end.
64
- * - Repeating and trailing separators are tolerated. Trailing separators in the
65
- * provided glob have no meaning and are discarded.
66
- * - Absolute globs will only match absolute paths, etc.
67
- * - Empty globs will match nothing.
68
- * - Any special glob syntax must be contained to one path segment. For example,
69
- * `?(foo|bar/baz)` is invalid. The separator will take precedence and the
70
- * first segment ends with an unclosed group.
71
- * - If a path segment ends with unclosed groups or a dangling escape prefix, a
72
- * parse error has occurred. Every character for that segment is taken
73
- * literally in this event.
74
- *
75
- * Limitations:
76
- * - A negative group like `!(foo|bar)` will wrongly be converted to a negative
77
- * look-ahead followed by a wildcard. This means that `!(foo).js` will wrongly
78
- * fail to match `foobar.js`, even though `foobar` is not `foo`. Effectively,
79
- * `!(foo|bar)` is treated like `!(@(foo|bar)*)`. This will work correctly if
80
- * the group occurs not nested at the end of the segment. */
81
- export function globToRegExp(glob, { extended = true, globstar: globstarOption = true, os = osType, caseInsensitive = false, } = {}) {
20
+ export function _globToRegExp(c, glob, { extended = true, globstar: globstarOption = true,
21
+ // os = osType,
22
+ caseInsensitive = false, } = {}) {
82
23
  if (glob === "") {
83
24
  return /(?!)/;
84
25
  }
85
- const sep = os === "windows" ? "(?:\\\\|/)+" : "/+";
86
- const sepMaybe = os === "windows" ? "(?:\\\\|/)*" : "/*";
87
- const seps = os === "windows" ? ["\\", "/"] : ["/"];
88
- const globstar = os === "windows"
89
- ? "(?:[^\\\\/]*(?:\\\\|/|$)+)*"
90
- : "(?:[^/]*(?:/|$)+)*";
91
- const wildcard = os === "windows" ? "[^\\\\/]*" : "[^/]*";
92
- const escapePrefix = os === "windows" ? "`" : "\\";
93
26
  // Remove trailing separators.
94
27
  let newLength = glob.length;
95
- for (; newLength > 1 && seps.includes(glob[newLength - 1]); newLength--)
28
+ for (; newLength > 1 && c.seps.includes(glob[newLength - 1]); newLength--)
96
29
  ;
97
30
  glob = glob.slice(0, newLength);
98
31
  let regExpString = "";
@@ -105,14 +38,14 @@ export function globToRegExp(glob, { extended = true, globstar: globstarOption =
105
38
  let endsWithSep = false;
106
39
  let i = j;
107
40
  // Terminates with `i` at the non-inclusive end of the current segment.
108
- for (; i < glob.length && !seps.includes(glob[i]); i++) {
41
+ for (; i < glob.length && !c.seps.includes(glob[i]); i++) {
109
42
  if (inEscape) {
110
43
  inEscape = false;
111
44
  const escapeChars = inRange ? rangeEscapeChars : regExpEscapeChars;
112
45
  segment += escapeChars.includes(glob[i]) ? `\\${glob[i]}` : glob[i];
113
46
  continue;
114
47
  }
115
- if (glob[i] === escapePrefix) {
48
+ if (glob[i] === c.escapePrefix) {
116
49
  inEscape = true;
117
50
  continue;
118
51
  }
@@ -191,7 +124,7 @@ export function globToRegExp(glob, { extended = true, globstar: globstarOption =
191
124
  segment += ")";
192
125
  const type = groupStack.pop();
193
126
  if (type === "!") {
194
- segment += wildcard;
127
+ segment += c.wildcard;
195
128
  }
196
129
  else if (type !== "@") {
197
130
  segment += type;
@@ -261,13 +194,13 @@ export function globToRegExp(glob, { extended = true, globstar: globstarOption =
261
194
  }
262
195
  const nextChar = glob[i + 1];
263
196
  if (globstarOption && numStars === 2 &&
264
- [...seps, undefined].includes(prevChar) &&
265
- [...seps, undefined].includes(nextChar)) {
266
- segment += globstar;
197
+ [...c.seps, undefined].includes(prevChar) &&
198
+ [...c.seps, undefined].includes(nextChar)) {
199
+ segment += c.globstar;
267
200
  endsWithSep = true;
268
201
  }
269
202
  else {
270
- segment += wildcard;
203
+ segment += c.wildcard;
271
204
  }
272
205
  }
273
206
  continue;
@@ -285,11 +218,11 @@ export function globToRegExp(glob, { extended = true, globstar: globstarOption =
285
218
  }
286
219
  regExpString += segment;
287
220
  if (!endsWithSep) {
288
- regExpString += i < glob.length ? sep : sepMaybe;
221
+ regExpString += i < glob.length ? c.sep : c.sepMaybe;
289
222
  endsWithSep = true;
290
223
  }
291
224
  // Terminates with `i` at the start of the next segment.
292
- while (seps.includes(glob[i]))
225
+ while (c.seps.includes(glob[i]))
293
226
  i++;
294
227
  // Check that the next value of `j` is indeed higher than the current value.
295
228
  if (!(i > j)) {
@@ -300,62 +233,3 @@ export function globToRegExp(glob, { extended = true, globstar: globstarOption =
300
233
  regExpString = `^${regExpString}$`;
301
234
  return new RegExp(regExpString, caseInsensitive ? "i" : "");
302
235
  }
303
- /** Test whether the given string is a glob */
304
- export function isGlob(str) {
305
- const chars = { "{": "}", "(": ")", "[": "]" };
306
- const regex = /\\(.)|(^!|\*|\?|[\].+)]\?|\[[^\\\]]+\]|\{[^\\}]+\}|\(\?[:!=][^\\)]+\)|\([^|]+\|[^\\)]+\))/;
307
- if (str === "") {
308
- return false;
309
- }
310
- let match;
311
- while ((match = regex.exec(str))) {
312
- if (match[2])
313
- return true;
314
- let idx = match.index + match[0].length;
315
- // if an open bracket/brace/paren is escaped,
316
- // set the index to the next closing character
317
- const open = match[1];
318
- const close = open ? chars[open] : null;
319
- if (open && close) {
320
- const n = str.indexOf(close, idx);
321
- if (n !== -1) {
322
- idx = n + 1;
323
- }
324
- }
325
- str = str.slice(idx);
326
- }
327
- return false;
328
- }
329
- /** Like normalize(), but doesn't collapse "**\/.." when `globstar` is true. */
330
- export function normalizeGlob(glob, { globstar = false } = {}) {
331
- if (glob.match(/\0/g)) {
332
- throw new Error(`Glob contains invalid characters: "${glob}"`);
333
- }
334
- if (!globstar) {
335
- return normalize(glob);
336
- }
337
- const s = SEP_PATTERN.source;
338
- const badParentPattern = new RegExp(`(?<=(${s}|^)\\*\\*${s})\\.\\.(?=${s}|$)`, "g");
339
- return normalize(glob.replace(badParentPattern, "\0")).replace(/\0/g, "..");
340
- }
341
- /** Like join(), but doesn't collapse "**\/.." when `globstar` is true. */
342
- export function joinGlobs(globs, { extended = true, globstar = false } = {}) {
343
- if (!globstar || globs.length === 0) {
344
- return join(...globs);
345
- }
346
- if (globs.length === 0)
347
- return ".";
348
- let joined;
349
- for (const glob of globs) {
350
- const path = glob;
351
- if (path.length > 0) {
352
- if (!joined)
353
- joined = path;
354
- else
355
- joined += `${SEP}${path}`;
356
- }
357
- }
358
- if (!joined)
359
- return ".";
360
- return normalizeGlob(joined, { extended, globstar });
361
- }
@@ -0,0 +1,2 @@
1
+ /** Test whether the given string is a glob */
2
+ export declare function isGlob(str: string): boolean;
@@ -0,0 +1,28 @@
1
+ // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
2
+ // This module is browser compatible.
3
+ /** Test whether the given string is a glob */
4
+ export function isGlob(str) {
5
+ const chars = { "{": "}", "(": ")", "[": "]" };
6
+ const regex = /\\(.)|(^!|\*|\?|[\].+)]\?|\[[^\\\]]+\]|\{[^\\}]+\}|\(\?[:!=][^\\)]+\)|\([^|]+\|[^\\)]+\))/;
7
+ if (str === "") {
8
+ return false;
9
+ }
10
+ let match;
11
+ while ((match = regex.exec(str))) {
12
+ if (match[2])
13
+ return true;
14
+ let idx = match.index + match[0].length;
15
+ // if an open bracket/brace/paren is escaped,
16
+ // set the index to the next closing character
17
+ const open = match[1];
18
+ const close = open ? chars[open] : null;
19
+ if (open && close) {
20
+ const n = str.indexOf(close, idx);
21
+ if (n !== -1) {
22
+ idx = n + 1;
23
+ }
24
+ }
25
+ str = str.slice(idx);
26
+ }
27
+ return false;
28
+ }
@@ -0,0 +1 @@
1
+ export declare function assertArg(path: string): "." | undefined;
@@ -0,0 +1,8 @@
1
+ // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
2
+ // This module is browser compatible.
3
+ import { assertPath } from "./assert_path.js";
4
+ export function assertArg(path) {
5
+ assertPath(path);
6
+ if (path.length === 0)
7
+ return ".";
8
+ }
@@ -0,0 +1 @@
1
+ export declare function normalizeString(path: string, allowAboveRoot: boolean, separator: string, isPathSeparator: (code: number) => boolean): string;