ventojs 0.12.2 → 0.12.4

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 (376) hide show
  1. package/esm/_dnt.shims.d.ts +1 -0
  2. package/esm/_dnt.shims.d.ts.map +1 -0
  3. package/esm/_dnt.test_polyfills.d.ts.map +1 -0
  4. package/esm/_dnt.test_shims.d.ts.map +1 -0
  5. package/esm/deps/deno.land/std@0.221.0/assert/_constants.d.ts.map +1 -0
  6. package/esm/deps/deno.land/std@0.221.0/assert/_diff.d.ts.map +1 -0
  7. package/esm/deps/deno.land/std@0.221.0/assert/_format.d.ts.map +1 -0
  8. package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/assert/assert.d.ts +1 -0
  9. package/esm/deps/deno.land/std@0.221.0/assert/assert.d.ts.map +1 -0
  10. package/esm/deps/deno.land/std@0.221.0/assert/assert_equals.d.ts.map +1 -0
  11. package/esm/deps/deno.land/std@0.221.0/assert/assert_is_error.d.ts.map +1 -0
  12. package/esm/deps/deno.land/std@0.221.0/assert/assert_throws.d.ts.map +1 -0
  13. package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/assert/assertion_error.d.ts +1 -0
  14. package/esm/deps/deno.land/std@0.221.0/assert/assertion_error.d.ts.map +1 -0
  15. package/esm/deps/deno.land/std@0.221.0/assert/equal.d.ts.map +1 -0
  16. package/esm/deps/deno.land/std@0.221.0/collections/_utils.d.ts.map +1 -0
  17. package/esm/deps/deno.land/std@0.221.0/collections/deep_merge.d.ts.map +1 -0
  18. package/esm/deps/deno.land/std@0.221.0/fmt/colors.d.ts.map +1 -0
  19. package/esm/deps/deno.land/std@0.221.0/front_matter/_formats.d.ts.map +1 -0
  20. package/esm/deps/deno.land/std@0.221.0/front_matter/create_extractor.d.ts.map +1 -0
  21. package/esm/deps/deno.land/std@0.221.0/front_matter/json.d.ts.map +1 -0
  22. package/esm/deps/deno.land/std@0.221.0/front_matter/mod.d.ts.map +1 -0
  23. package/esm/deps/deno.land/std@0.221.0/front_matter/test.d.ts.map +1 -0
  24. package/esm/deps/deno.land/std@0.221.0/front_matter/toml.d.ts.map +1 -0
  25. package/esm/deps/deno.land/std@0.221.0/front_matter/yaml.d.ts.map +1 -0
  26. package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/html/entities.d.ts +1 -0
  27. package/esm/deps/deno.land/std@0.221.0/html/entities.d.ts.map +1 -0
  28. package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/html/mod.d.ts +1 -0
  29. package/esm/deps/deno.land/std@0.221.0/html/mod.d.ts.map +1 -0
  30. package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/_common/assert_path.d.ts +1 -0
  31. package/esm/deps/deno.land/std@0.221.0/path/_common/assert_path.d.ts.map +1 -0
  32. package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/_common/basename.d.ts +1 -0
  33. package/esm/deps/deno.land/std@0.221.0/path/_common/basename.d.ts.map +1 -0
  34. package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/_common/common.d.ts +1 -0
  35. package/esm/deps/deno.land/std@0.221.0/path/_common/common.d.ts.map +1 -0
  36. package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/_common/constants.d.ts +1 -0
  37. package/esm/deps/deno.land/std@0.221.0/path/_common/constants.d.ts.map +1 -0
  38. package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/_common/dirname.d.ts +1 -0
  39. package/esm/deps/deno.land/std@0.221.0/path/_common/dirname.d.ts.map +1 -0
  40. package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/_common/format.d.ts +1 -0
  41. package/esm/deps/deno.land/std@0.221.0/path/_common/format.d.ts.map +1 -0
  42. package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/_common/from_file_url.d.ts +1 -0
  43. package/esm/deps/deno.land/std@0.221.0/path/_common/from_file_url.d.ts.map +1 -0
  44. package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/_common/glob_to_reg_exp.d.ts +1 -0
  45. package/esm/deps/deno.land/std@0.221.0/path/_common/glob_to_reg_exp.d.ts.map +1 -0
  46. package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/_common/normalize.d.ts +1 -0
  47. package/esm/deps/deno.land/std@0.221.0/path/_common/normalize.d.ts.map +1 -0
  48. package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/_common/normalize_string.d.ts +1 -0
  49. package/esm/deps/deno.land/std@0.221.0/path/_common/normalize_string.d.ts.map +1 -0
  50. package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/_common/normalize_string.js +2 -2
  51. package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/_common/relative.d.ts +1 -0
  52. package/esm/deps/deno.land/std@0.221.0/path/_common/relative.d.ts.map +1 -0
  53. package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/_common/strip_trailing_separators.d.ts +1 -0
  54. package/esm/deps/deno.land/std@0.221.0/path/_common/strip_trailing_separators.d.ts.map +1 -0
  55. package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/_common/to_file_url.d.ts +1 -0
  56. package/esm/deps/deno.land/std@0.221.0/path/_common/to_file_url.d.ts.map +1 -0
  57. package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/_interface.d.ts +14 -1
  58. package/esm/deps/deno.land/std@0.221.0/path/_interface.d.ts.map +1 -0
  59. package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/_os.d.ts +1 -0
  60. package/esm/deps/deno.land/std@0.221.0/path/_os.d.ts.map +1 -0
  61. package/esm/deps/deno.land/std@0.221.0/path/basename.d.ts +18 -0
  62. package/esm/deps/deno.land/std@0.221.0/path/basename.d.ts.map +1 -0
  63. package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/basename.js +9 -0
  64. package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/common.d.ts +1 -0
  65. package/esm/deps/deno.land/std@0.221.0/path/common.d.ts.map +1 -0
  66. package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/constants.d.ts +1 -0
  67. package/esm/deps/deno.land/std@0.221.0/path/constants.d.ts.map +1 -0
  68. package/esm/deps/deno.land/{std@0.219.1/path/posix → std@0.221.0/path}/dirname.d.ts +1 -0
  69. package/esm/deps/deno.land/std@0.221.0/path/dirname.d.ts.map +1 -0
  70. package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/extname.d.ts +1 -0
  71. package/esm/deps/deno.land/std@0.221.0/path/extname.d.ts.map +1 -0
  72. package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/format.d.ts +4 -1
  73. package/esm/deps/deno.land/std@0.221.0/path/format.d.ts.map +1 -0
  74. package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/format.js +3 -1
  75. package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/from_file_url.d.ts +1 -0
  76. package/esm/deps/deno.land/std@0.221.0/path/from_file_url.d.ts.map +1 -0
  77. package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/glob_to_regexp.d.ts +1 -0
  78. package/esm/deps/deno.land/std@0.221.0/path/glob_to_regexp.d.ts.map +1 -0
  79. package/esm/deps/deno.land/{std@0.219.1/path/posix → std@0.221.0/path}/is_absolute.d.ts +1 -0
  80. package/esm/deps/deno.land/std@0.221.0/path/is_absolute.d.ts.map +1 -0
  81. package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/is_glob.d.ts +1 -0
  82. package/esm/deps/deno.land/std@0.221.0/path/is_glob.d.ts.map +1 -0
  83. package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/join.d.ts +1 -0
  84. package/esm/deps/deno.land/std@0.221.0/path/join.d.ts.map +1 -0
  85. package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/join_globs.d.ts +1 -0
  86. package/esm/deps/deno.land/std@0.221.0/path/join_globs.d.ts.map +1 -0
  87. package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/mod.d.ts +1 -0
  88. package/esm/deps/deno.land/std@0.221.0/path/mod.d.ts.map +1 -0
  89. package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/normalize.d.ts +1 -0
  90. package/esm/deps/deno.land/std@0.221.0/path/normalize.d.ts.map +1 -0
  91. package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/normalize_glob.d.ts +1 -0
  92. package/esm/deps/deno.land/std@0.221.0/path/normalize_glob.d.ts.map +1 -0
  93. package/esm/deps/deno.land/std@0.221.0/path/parse.d.ts +19 -0
  94. package/esm/deps/deno.land/std@0.221.0/path/parse.d.ts.map +1 -0
  95. package/esm/deps/deno.land/std@0.221.0/path/parse.js +24 -0
  96. package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/posix/_util.d.ts +1 -0
  97. package/esm/deps/deno.land/std@0.221.0/path/posix/_util.d.ts.map +1 -0
  98. package/esm/deps/deno.land/std@0.221.0/path/posix/basename.d.ts +18 -0
  99. package/esm/deps/deno.land/std@0.221.0/path/posix/basename.d.ts.map +1 -0
  100. package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/posix/basename.js +9 -0
  101. package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/posix/common.d.ts +1 -0
  102. package/esm/deps/deno.land/std@0.221.0/path/posix/common.d.ts.map +1 -0
  103. package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/posix/constants.d.ts +1 -0
  104. package/esm/deps/deno.land/std@0.221.0/path/posix/constants.d.ts.map +1 -0
  105. package/esm/deps/deno.land/std@0.221.0/path/posix/dirname.d.ts +15 -0
  106. package/esm/deps/deno.land/std@0.221.0/path/posix/dirname.d.ts.map +1 -0
  107. package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/posix/dirname.js +9 -0
  108. package/esm/deps/deno.land/std@0.221.0/path/posix/extname.d.ts +16 -0
  109. package/esm/deps/deno.land/std@0.221.0/path/posix/extname.d.ts.map +1 -0
  110. package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/posix/extname.js +9 -0
  111. package/esm/deps/deno.land/{std@0.219.1/path/windows → std@0.221.0/path/posix}/format.d.ts +1 -0
  112. package/esm/deps/deno.land/std@0.221.0/path/posix/format.d.ts.map +1 -0
  113. package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/posix/from_file_url.d.ts +1 -0
  114. package/esm/deps/deno.land/std@0.221.0/path/posix/from_file_url.d.ts.map +1 -0
  115. package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/posix/glob_to_regexp.d.ts +1 -0
  116. package/esm/deps/deno.land/std@0.221.0/path/posix/glob_to_regexp.d.ts.map +1 -0
  117. package/esm/deps/deno.land/{std@0.219.1/path/windows → std@0.221.0/path/posix}/is_absolute.d.ts +1 -0
  118. package/esm/deps/deno.land/std@0.221.0/path/posix/is_absolute.d.ts.map +1 -0
  119. package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/posix/is_glob.d.ts +1 -0
  120. package/esm/deps/deno.land/std@0.221.0/path/posix/is_glob.d.ts.map +1 -0
  121. package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/posix/join.d.ts +1 -0
  122. package/esm/deps/deno.land/std@0.221.0/path/posix/join.d.ts.map +1 -0
  123. package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/posix/join.js +1 -1
  124. package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/posix/join_globs.d.ts +1 -0
  125. package/esm/deps/deno.land/std@0.221.0/path/posix/join_globs.d.ts.map +1 -0
  126. package/esm/deps/deno.land/{std@0.219.1/path/windows → std@0.221.0/path/posix}/mod.d.ts +1 -0
  127. package/esm/deps/deno.land/std@0.221.0/path/posix/mod.d.ts.map +1 -0
  128. package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/posix/normalize.d.ts +1 -0
  129. package/esm/deps/deno.land/std@0.221.0/path/posix/normalize.d.ts.map +1 -0
  130. package/esm/deps/deno.land/{std@0.219.1/path/windows → std@0.221.0/path/posix}/normalize_glob.d.ts +1 -0
  131. package/esm/deps/deno.land/std@0.221.0/path/posix/normalize_glob.d.ts.map +1 -0
  132. package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/posix/parse.d.ts +1 -0
  133. package/esm/deps/deno.land/std@0.221.0/path/posix/parse.d.ts.map +1 -0
  134. package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/posix/relative.d.ts +1 -0
  135. package/esm/deps/deno.land/std@0.221.0/path/posix/relative.d.ts.map +1 -0
  136. package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/posix/resolve.d.ts +1 -0
  137. package/esm/deps/deno.land/std@0.221.0/path/posix/resolve.d.ts.map +1 -0
  138. package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/posix/to_file_url.d.ts +1 -0
  139. package/esm/deps/deno.land/std@0.221.0/path/posix/to_file_url.d.ts.map +1 -0
  140. package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/posix/to_namespaced_path.d.ts +1 -0
  141. package/esm/deps/deno.land/std@0.221.0/path/posix/to_namespaced_path.d.ts.map +1 -0
  142. package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/relative.d.ts +1 -0
  143. package/esm/deps/deno.land/std@0.221.0/path/relative.d.ts.map +1 -0
  144. package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/resolve.d.ts +1 -0
  145. package/esm/deps/deno.land/std@0.221.0/path/resolve.d.ts.map +1 -0
  146. package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/to_file_url.d.ts +1 -0
  147. package/esm/deps/deno.land/std@0.221.0/path/to_file_url.d.ts.map +1 -0
  148. package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/to_namespaced_path.d.ts +1 -0
  149. package/esm/deps/deno.land/std@0.221.0/path/to_namespaced_path.d.ts.map +1 -0
  150. package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/windows/_util.d.ts +1 -0
  151. package/esm/deps/deno.land/std@0.221.0/path/windows/_util.d.ts.map +1 -0
  152. package/esm/deps/deno.land/std@0.221.0/path/windows/basename.d.ts +18 -0
  153. package/esm/deps/deno.land/std@0.221.0/path/windows/basename.d.ts.map +1 -0
  154. package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/windows/basename.js +9 -0
  155. package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/windows/common.d.ts +1 -0
  156. package/esm/deps/deno.land/std@0.221.0/path/windows/common.d.ts.map +1 -0
  157. package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/windows/constants.d.ts +1 -0
  158. package/esm/deps/deno.land/std@0.221.0/path/windows/constants.d.ts.map +1 -0
  159. package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/windows/dirname.d.ts +1 -0
  160. package/esm/deps/deno.land/std@0.221.0/path/windows/dirname.d.ts.map +1 -0
  161. package/esm/deps/deno.land/{std@0.219.1/path/posix → std@0.221.0/path/windows}/extname.d.ts +1 -0
  162. package/esm/deps/deno.land/std@0.221.0/path/windows/extname.d.ts.map +1 -0
  163. package/esm/deps/deno.land/{std@0.219.1/path/posix → std@0.221.0/path/windows}/format.d.ts +1 -0
  164. package/esm/deps/deno.land/std@0.221.0/path/windows/format.d.ts.map +1 -0
  165. package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/windows/from_file_url.d.ts +1 -0
  166. package/esm/deps/deno.land/std@0.221.0/path/windows/from_file_url.d.ts.map +1 -0
  167. package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/windows/glob_to_regexp.d.ts +1 -0
  168. package/esm/deps/deno.land/std@0.221.0/path/windows/glob_to_regexp.d.ts.map +1 -0
  169. package/esm/deps/deno.land/{std@0.219.1/path → std@0.221.0/path/windows}/is_absolute.d.ts +1 -0
  170. package/esm/deps/deno.land/std@0.221.0/path/windows/is_absolute.d.ts.map +1 -0
  171. package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/windows/is_glob.d.ts +1 -0
  172. package/esm/deps/deno.land/std@0.221.0/path/windows/is_glob.d.ts.map +1 -0
  173. package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/windows/join.d.ts +1 -0
  174. package/esm/deps/deno.land/std@0.221.0/path/windows/join.d.ts.map +1 -0
  175. package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/windows/join_globs.d.ts +1 -0
  176. package/esm/deps/deno.land/std@0.221.0/path/windows/join_globs.d.ts.map +1 -0
  177. package/esm/deps/deno.land/{std@0.219.1/path/posix → std@0.221.0/path/windows}/mod.d.ts +1 -0
  178. package/esm/deps/deno.land/std@0.221.0/path/windows/mod.d.ts.map +1 -0
  179. package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/windows/normalize.d.ts +1 -0
  180. package/esm/deps/deno.land/std@0.221.0/path/windows/normalize.d.ts.map +1 -0
  181. package/esm/deps/deno.land/{std@0.219.1/path/posix → std@0.221.0/path/windows}/normalize_glob.d.ts +1 -0
  182. package/esm/deps/deno.land/std@0.221.0/path/windows/normalize_glob.d.ts.map +1 -0
  183. package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/windows/parse.d.ts +1 -0
  184. package/esm/deps/deno.land/std@0.221.0/path/windows/parse.d.ts.map +1 -0
  185. package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/windows/relative.d.ts +1 -0
  186. package/esm/deps/deno.land/std@0.221.0/path/windows/relative.d.ts.map +1 -0
  187. package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/windows/resolve.d.ts +1 -0
  188. package/esm/deps/deno.land/std@0.221.0/path/windows/resolve.d.ts.map +1 -0
  189. package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/windows/to_file_url.d.ts +1 -0
  190. package/esm/deps/deno.land/std@0.221.0/path/windows/to_file_url.d.ts.map +1 -0
  191. package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/windows/to_namespaced_path.d.ts +1 -0
  192. package/esm/deps/deno.land/std@0.221.0/path/windows/to_namespaced_path.d.ts.map +1 -0
  193. package/esm/deps/deno.land/std@0.221.0/toml/_parser.d.ts.map +1 -0
  194. package/esm/deps/deno.land/std@0.221.0/toml/parse.d.ts.map +1 -0
  195. package/esm/deps/deno.land/std@0.221.0/yaml/_error.d.ts.map +1 -0
  196. package/esm/deps/deno.land/std@0.221.0/yaml/_loader/loader.d.ts.map +1 -0
  197. package/esm/deps/deno.land/std@0.221.0/yaml/_loader/loader_state.d.ts.map +1 -0
  198. package/esm/deps/deno.land/std@0.221.0/yaml/_mark.d.ts.map +1 -0
  199. package/esm/deps/deno.land/std@0.221.0/yaml/_state.d.ts.map +1 -0
  200. package/esm/deps/deno.land/std@0.221.0/yaml/_type/binary.d.ts.map +1 -0
  201. package/esm/deps/deno.land/std@0.221.0/yaml/_type/bool.d.ts.map +1 -0
  202. package/esm/deps/deno.land/std@0.221.0/yaml/_type/float.d.ts.map +1 -0
  203. package/esm/deps/deno.land/std@0.221.0/yaml/_type/function.d.ts.map +1 -0
  204. package/esm/deps/deno.land/std@0.221.0/yaml/_type/int.d.ts.map +1 -0
  205. package/esm/deps/deno.land/std@0.221.0/yaml/_type/map.d.ts.map +1 -0
  206. package/esm/deps/deno.land/std@0.221.0/yaml/_type/merge.d.ts.map +1 -0
  207. package/esm/deps/deno.land/std@0.221.0/yaml/_type/mod.d.ts.map +1 -0
  208. package/esm/deps/deno.land/std@0.221.0/yaml/_type/nil.d.ts.map +1 -0
  209. package/esm/deps/deno.land/std@0.221.0/yaml/_type/omap.d.ts.map +1 -0
  210. package/esm/deps/deno.land/std@0.221.0/yaml/_type/pairs.d.ts.map +1 -0
  211. package/esm/deps/deno.land/std@0.221.0/yaml/_type/regexp.d.ts.map +1 -0
  212. package/esm/deps/deno.land/std@0.221.0/yaml/_type/seq.d.ts.map +1 -0
  213. package/esm/deps/deno.land/std@0.221.0/yaml/_type/set.d.ts.map +1 -0
  214. package/esm/deps/deno.land/std@0.221.0/yaml/_type/str.d.ts.map +1 -0
  215. package/esm/deps/deno.land/std@0.221.0/yaml/_type/timestamp.d.ts.map +1 -0
  216. package/esm/deps/deno.land/std@0.221.0/yaml/_type/undefined.d.ts.map +1 -0
  217. package/esm/deps/deno.land/std@0.221.0/yaml/_utils.d.ts.map +1 -0
  218. package/esm/deps/deno.land/std@0.221.0/yaml/parse.d.ts.map +1 -0
  219. package/esm/deps/deno.land/std@0.221.0/yaml/schema/core.d.ts.map +1 -0
  220. package/esm/deps/deno.land/std@0.221.0/yaml/schema/default.d.ts.map +1 -0
  221. package/esm/deps/deno.land/std@0.221.0/yaml/schema/extended.d.ts.map +1 -0
  222. package/esm/deps/deno.land/std@0.221.0/yaml/schema/failsafe.d.ts.map +1 -0
  223. package/esm/deps/deno.land/std@0.221.0/yaml/schema/json.d.ts.map +1 -0
  224. package/esm/deps/deno.land/std@0.221.0/yaml/schema/mod.d.ts.map +1 -0
  225. package/esm/deps/deno.land/std@0.221.0/yaml/schema.d.ts.map +1 -0
  226. package/esm/deps/deno.land/std@0.221.0/yaml/type.d.ts.map +1 -0
  227. package/esm/deps/deno.land/x/astring@v1.8.6/src/astring.d.ts +110 -0
  228. package/esm/deps/deno.land/x/astring@v1.8.6/src/astring.d.ts.map +1 -0
  229. package/esm/deps/deno.land/x/astring@v1.8.6/src/astring.js +1159 -0
  230. package/esm/deps.d.ts +3 -2
  231. package/esm/deps.d.ts.map +1 -0
  232. package/esm/deps.js +2 -2
  233. package/esm/mod.d.ts +1 -0
  234. package/esm/mod.d.ts.map +1 -0
  235. package/esm/plugins/auto_trim.d.ts +1 -0
  236. package/esm/plugins/auto_trim.d.ts.map +1 -0
  237. package/esm/plugins/echo.d.ts +1 -0
  238. package/esm/plugins/echo.d.ts.map +1 -0
  239. package/esm/plugins/escape.d.ts +1 -0
  240. package/esm/plugins/escape.d.ts.map +1 -0
  241. package/esm/plugins/export.d.ts +1 -0
  242. package/esm/plugins/export.d.ts.map +1 -0
  243. package/esm/plugins/for.d.ts +1 -0
  244. package/esm/plugins/for.d.ts.map +1 -0
  245. package/esm/plugins/function.d.ts +1 -0
  246. package/esm/plugins/function.d.ts.map +1 -0
  247. package/esm/plugins/if.d.ts +1 -0
  248. package/esm/plugins/if.d.ts.map +1 -0
  249. package/esm/plugins/import.d.ts +1 -0
  250. package/esm/plugins/import.d.ts.map +1 -0
  251. package/esm/plugins/include.d.ts +1 -0
  252. package/esm/plugins/include.d.ts.map +1 -0
  253. package/esm/plugins/include.js +14 -6
  254. package/esm/plugins/js.d.ts +1 -0
  255. package/esm/plugins/js.d.ts.map +1 -0
  256. package/esm/plugins/layout.d.ts +1 -0
  257. package/esm/plugins/layout.d.ts.map +1 -0
  258. package/esm/plugins/set.d.ts +1 -0
  259. package/esm/plugins/set.d.ts.map +1 -0
  260. package/esm/plugins/trim.d.ts +1 -0
  261. package/esm/plugins/trim.d.ts.map +1 -0
  262. package/esm/plugins/unescape.d.ts +1 -0
  263. package/esm/plugins/unescape.d.ts.map +1 -0
  264. package/esm/src/environment.d.ts +55 -0
  265. package/esm/src/environment.d.ts.map +1 -0
  266. package/esm/src/environment.js +200 -0
  267. package/esm/src/js.d.ts +5 -0
  268. package/esm/src/js.d.ts.map +1 -0
  269. package/esm/src/js.js +150 -0
  270. package/esm/src/loader.d.ts +15 -0
  271. package/esm/src/loader.d.ts.map +1 -0
  272. package/esm/src/loader.js +19 -0
  273. package/esm/src/tokenizer.d.ts +14 -0
  274. package/esm/src/tokenizer.d.ts.map +1 -0
  275. package/esm/src/tokenizer.js +92 -0
  276. package/esm/src/transformer.d.ts +2 -0
  277. package/esm/src/transformer.d.ts.map +1 -0
  278. package/esm/src/transformer.js +196 -0
  279. package/esm/test/auto_trim.test.d.ts.map +1 -0
  280. package/esm/test/comment.test.d.ts.map +1 -0
  281. package/esm/test/compile.test.d.ts.map +1 -0
  282. package/esm/test/echo.test.d.ts.map +1 -0
  283. package/esm/test/escape.test.d.ts.map +1 -0
  284. package/esm/test/for.test.d.ts.map +1 -0
  285. package/esm/test/function.test.d.ts.map +1 -0
  286. package/esm/test/if.test.d.ts.map +1 -0
  287. package/esm/test/import.test.d.ts.map +1 -0
  288. package/esm/test/include.test.d.ts.map +1 -0
  289. package/esm/test/js.test.d.ts.map +1 -0
  290. package/esm/test/layout.test.d.ts.map +1 -0
  291. package/esm/test/print.test.d.ts.map +1 -0
  292. package/esm/test/safe.test.d.ts.map +1 -0
  293. package/esm/test/set.test.d.ts.map +1 -0
  294. package/esm/test/tokenizer.test.d.ts.map +1 -0
  295. package/esm/test/unescape.test.d.ts.map +1 -0
  296. package/esm/test/utils.d.ts.map +1 -0
  297. package/package.json +2 -2
  298. package/esm/deps/deno.land/std@0.219.1/path/basename.d.ts +0 -8
  299. package/esm/deps/deno.land/std@0.219.1/path/dirname.d.ts +0 -5
  300. package/esm/deps/deno.land/std@0.219.1/path/parse.d.ts +0 -6
  301. package/esm/deps/deno.land/std@0.219.1/path/parse.js +0 -12
  302. package/esm/deps/deno.land/std@0.219.1/path/posix/basename.d.ts +0 -8
  303. package/esm/deps/deno.land/std@0.219.1/path/windows/basename.d.ts +0 -8
  304. package/esm/deps/deno.land/std@0.219.1/path/windows/extname.d.ts +0 -6
  305. /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/assert/assert.js +0 -0
  306. /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/assert/assertion_error.js +0 -0
  307. /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/html/entities.js +0 -0
  308. /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/html/mod.js +0 -0
  309. /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/_common/assert_path.js +0 -0
  310. /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/_common/basename.js +0 -0
  311. /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/_common/common.js +0 -0
  312. /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/_common/constants.js +0 -0
  313. /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/_common/dirname.js +0 -0
  314. /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/_common/format.js +0 -0
  315. /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/_common/from_file_url.js +0 -0
  316. /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/_common/glob_to_reg_exp.js +0 -0
  317. /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/_common/normalize.js +0 -0
  318. /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/_common/relative.js +0 -0
  319. /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/_common/strip_trailing_separators.js +0 -0
  320. /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/_common/to_file_url.js +0 -0
  321. /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/_interface.js +0 -0
  322. /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/_os.js +0 -0
  323. /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/common.js +0 -0
  324. /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/constants.js +0 -0
  325. /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/dirname.js +0 -0
  326. /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/extname.js +0 -0
  327. /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/from_file_url.js +0 -0
  328. /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/glob_to_regexp.js +0 -0
  329. /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/is_absolute.js +0 -0
  330. /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/is_glob.js +0 -0
  331. /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/join.js +0 -0
  332. /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/join_globs.js +0 -0
  333. /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/mod.js +0 -0
  334. /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/normalize.js +0 -0
  335. /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/normalize_glob.js +0 -0
  336. /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/posix/_util.js +0 -0
  337. /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/posix/common.js +0 -0
  338. /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/posix/constants.js +0 -0
  339. /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/posix/format.js +0 -0
  340. /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/posix/from_file_url.js +0 -0
  341. /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/posix/glob_to_regexp.js +0 -0
  342. /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/posix/is_absolute.js +0 -0
  343. /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/posix/is_glob.js +0 -0
  344. /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/posix/join_globs.js +0 -0
  345. /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/posix/mod.js +0 -0
  346. /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/posix/normalize.js +0 -0
  347. /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/posix/normalize_glob.js +0 -0
  348. /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/posix/parse.js +0 -0
  349. /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/posix/relative.js +0 -0
  350. /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/posix/resolve.js +0 -0
  351. /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/posix/to_file_url.js +0 -0
  352. /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/posix/to_namespaced_path.js +0 -0
  353. /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/relative.js +0 -0
  354. /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/resolve.js +0 -0
  355. /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/to_file_url.js +0 -0
  356. /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/to_namespaced_path.js +0 -0
  357. /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/windows/_util.js +0 -0
  358. /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/windows/common.js +0 -0
  359. /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/windows/constants.js +0 -0
  360. /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/windows/dirname.js +0 -0
  361. /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/windows/extname.js +0 -0
  362. /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/windows/format.js +0 -0
  363. /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/windows/from_file_url.js +0 -0
  364. /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/windows/glob_to_regexp.js +0 -0
  365. /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/windows/is_absolute.js +0 -0
  366. /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/windows/is_glob.js +0 -0
  367. /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/windows/join.js +0 -0
  368. /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/windows/join_globs.js +0 -0
  369. /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/windows/mod.js +0 -0
  370. /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/windows/normalize.js +0 -0
  371. /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/windows/normalize_glob.js +0 -0
  372. /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/windows/parse.js +0 -0
  373. /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/windows/relative.js +0 -0
  374. /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/windows/resolve.js +0 -0
  375. /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/windows/to_file_url.js +0 -0
  376. /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/windows/to_namespaced_path.js +0 -0
package/esm/deps.d.ts CHANGED
@@ -1,6 +1,7 @@
1
- export * as path from "./deps/deno.land/std@0.219.1/path/mod.js";
2
- export * as html from "./deps/deno.land/std@0.219.1/html/mod.js";
1
+ export * as path from "./deps/deno.land/std@0.221.0/path/mod.js";
2
+ export * as html from "./deps/deno.land/std@0.221.0/html/mod.js";
3
3
  export * as astring from "./deps/deno.land/x/astring@v1.8.6/src/astring.js";
4
4
  export * as meriyah from "meriyah";
5
5
  export * as walker from "estree-walker";
6
6
  export type * as ESTree from "estree";
7
+ //# sourceMappingURL=deps.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deps.d.ts","sourceRoot":"","sources":["../src/deps.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,0CAA0C,CAAC;AACjE,OAAO,KAAK,IAAI,MAAM,0CAA0C,CAAC;AAEjE,OAAO,KAAK,OAAO,MAAM,kDAAkD,CAAC;AAC5E,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AACnC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,YAAY,KAAK,MAAM,MAAM,QAAQ,CAAC"}
package/esm/deps.js CHANGED
@@ -1,5 +1,5 @@
1
- export * as path from "./deps/deno.land/std@0.219.1/path/mod.js";
2
- export * as html from "./deps/deno.land/std@0.219.1/html/mod.js";
1
+ export * as path from "./deps/deno.land/std@0.221.0/path/mod.js";
2
+ export * as html from "./deps/deno.land/std@0.221.0/html/mod.js";
3
3
  export * as astring from "./deps/deno.land/x/astring@v1.8.6/src/astring.js";
4
4
  export * as meriyah from "meriyah";
5
5
  export * as walker from "estree-walker";
package/esm/mod.d.ts CHANGED
@@ -8,3 +8,4 @@ export interface Options {
8
8
  autoescape?: boolean;
9
9
  }
10
10
  export default function (options?: Options): Environment;
11
+ //# sourceMappingURL=mod.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../src/mod.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAc,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAerD,MAAM,WAAW,OAAO;IACtB,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3B,kBAAkB;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,CAAC,OAAO,WAAW,OAAO,GAAE,OAAY,eA4B7C"}
@@ -6,3 +6,4 @@ export type AutoTrimOptions = {
6
6
  };
7
7
  export default function (options?: AutoTrimOptions): (env: Environment) => void;
8
8
  export declare function autoTrim(tokens: Token[], options: AutoTrimOptions): void;
9
+ //# sourceMappingURL=auto_trim.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auto_trim.d.ts","sourceRoot":"","sources":["../../src/plugins/auto_trim.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEzD,eAAO,MAAM,WAAW,UAgBvB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAAE,IAAI,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC;AAEjD,MAAM,CAAC,OAAO,WAAW,OAAO,GAAE,eAAuC,SAC1D,WAAW,UAGzB;AAED,wBAAgB,QAAQ,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,eAAe,QAgBjE"}
@@ -1,2 +1,3 @@
1
1
  import type { Environment } from "../src/environment.js";
2
2
  export default function (): (env: Environment) => void;
3
+ //# sourceMappingURL=echo.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"echo.d.ts","sourceRoot":"","sources":["../../src/plugins/echo.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEzD,MAAM,CAAC,OAAO,oBACC,WAAW,UAGzB"}
@@ -1,2 +1,3 @@
1
1
  import type { Environment } from "../src/environment.js";
2
2
  export default function (): (env: Environment) => void;
3
+ //# sourceMappingURL=escape.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"escape.d.ts","sourceRoot":"","sources":["../../src/plugins/escape.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEzD,MAAM,CAAC,OAAO,oBACC,WAAW,UAKzB"}
@@ -1,2 +1,3 @@
1
1
  import type { Environment } from "../src/environment.js";
2
2
  export default function (): (env: Environment) => void;
3
+ //# sourceMappingURL=export.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"export.d.ts","sourceRoot":"","sources":["../../src/plugins/export.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEzD,MAAM,CAAC,OAAO,oBACC,WAAW,UAGzB"}
@@ -1,2 +1,3 @@
1
1
  import type { Environment } from "../src/environment.js";
2
2
  export default function (): (env: Environment) => void;
3
+ //# sourceMappingURL=for.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"for.d.ts","sourceRoot":"","sources":["../../src/plugins/for.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEzD,MAAM,CAAC,OAAO,oBACC,WAAW,UAIzB"}
@@ -1,2 +1,3 @@
1
1
  import type { Environment } from "../src/environment.js";
2
2
  export default function (): (env: Environment) => void;
3
+ //# sourceMappingURL=function.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"function.d.ts","sourceRoot":"","sources":["../../src/plugins/function.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEzD,MAAM,CAAC,OAAO,oBACC,WAAW,UAGzB"}
@@ -1,2 +1,3 @@
1
1
  import type { Environment } from "../src/environment.js";
2
2
  export default function (): (env: Environment) => void;
3
+ //# sourceMappingURL=if.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"if.d.ts","sourceRoot":"","sources":["../../src/plugins/if.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEzD,MAAM,CAAC,OAAO,oBACC,WAAW,UAIzB"}
@@ -1,2 +1,3 @@
1
1
  import type { Environment } from "../src/environment.js";
2
2
  export default function (): (env: Environment) => void;
3
+ //# sourceMappingURL=import.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"import.d.ts","sourceRoot":"","sources":["../../src/plugins/import.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEzD,MAAM,CAAC,OAAO,oBACC,WAAW,UAGzB"}
@@ -1,2 +1,3 @@
1
1
  import type { Environment } from "../src/environment.js";
2
2
  export default function (): (env: Environment) => void;
3
+ //# sourceMappingURL=include.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"include.d.ts","sourceRoot":"","sources":["../../src/plugins/include.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEzD,MAAM,CAAC,OAAO,oBACC,WAAW,UAGzB"}
@@ -1,3 +1,4 @@
1
+ import analyze from "../src/js.js";
1
2
  export default function () {
2
3
  return (env) => {
3
4
  env.tags.push(includeTag);
@@ -7,15 +8,22 @@ function includeTag(env, code, output, tokens) {
7
8
  if (!code.startsWith("include ")) {
8
9
  return;
9
10
  }
10
- const match = code?.match(/^include\s+([^{]+|`[^`]+`)+(?:\{([\s|\S]*)\})?$/);
11
- if (!match) {
12
- throw new Error(`Invalid include: ${code}`);
13
- }
14
- const [_, file, data] = match;
11
+ const tagCode = code.substring(7).trim();
12
+ let index = undefined;
13
+ analyze(tagCode, (type, i) => {
14
+ if (type === "open-bracket") {
15
+ index = i - 1;
16
+ return false;
17
+ }
18
+ });
19
+ const file = index === undefined
20
+ ? tagCode.trim()
21
+ : tagCode.slice(0, index).trim();
22
+ const data = index === undefined ? "" : tagCode.slice(index).trim();
15
23
  const { dataVarname } = env.options;
16
24
  return `{
17
25
  const __tmp = await __env.run(${file},
18
- {...${dataVarname}${data ? `, ${data}` : ""}},
26
+ {...${dataVarname}${data ? `, ...${data}` : ""}},
19
27
  __file
20
28
  );
21
29
  ${output} += ${env.compileFilters(tokens, "__tmp.content")};
@@ -1,2 +1,3 @@
1
1
  import type { Environment } from "../src/environment.js";
2
2
  export default function (): (env: Environment) => void;
3
+ //# sourceMappingURL=js.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"js.d.ts","sourceRoot":"","sources":["../../src/plugins/js.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEzD,MAAM,CAAC,OAAO,oBACC,WAAW,UAGzB"}
@@ -1,2 +1,3 @@
1
1
  import type { Environment } from "../src/environment.js";
2
2
  export default function (): (env: Environment) => void;
3
+ //# sourceMappingURL=layout.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../src/plugins/layout.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEzD,MAAM,CAAC,OAAO,oBACC,WAAW,UAGzB"}
@@ -1,2 +1,3 @@
1
1
  import type { Environment } from "../src/environment.js";
2
2
  export default function (): (env: Environment) => void;
3
+ //# sourceMappingURL=set.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"set.d.ts","sourceRoot":"","sources":["../../src/plugins/set.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEzD,MAAM,CAAC,OAAO,oBACC,WAAW,UAGzB"}
@@ -2,3 +2,4 @@ import type { Token } from "../src/tokenizer.js";
2
2
  import type { Environment } from "../src/environment.js";
3
3
  export default function (): (env: Environment) => void;
4
4
  export declare function trim(_: Environment, tokens: Token[]): void;
5
+ //# sourceMappingURL=trim.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trim.d.ts","sourceRoot":"","sources":["../../src/plugins/trim.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEzD,MAAM,CAAC,OAAO,oBACC,WAAW,UAGzB;AAED,wBAAgB,IAAI,CAAC,CAAC,EAAE,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,QA0BnD"}
@@ -1,2 +1,3 @@
1
1
  import type { Environment } from "../src/environment.js";
2
2
  export default function (): (env: Environment) => void;
3
+ //# sourceMappingURL=unescape.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unescape.d.ts","sourceRoot":"","sources":["../../src/plugins/unescape.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEzD,MAAM,CAAC,OAAO,oBACC,WAAW,UAKzB"}
@@ -0,0 +1,55 @@
1
+ import { Token } from "./tokenizer.js";
2
+ import type { Loader } from "./loader.js";
3
+ export interface TemplateResult {
4
+ content: string;
5
+ [key: string]: unknown;
6
+ }
7
+ export interface Template {
8
+ (data?: Record<string, unknown>): Promise<TemplateResult>;
9
+ source: string;
10
+ code: string;
11
+ file?: string;
12
+ }
13
+ export interface TemplateSync {
14
+ (data?: Record<string, unknown>): TemplateResult;
15
+ source: string;
16
+ code: string;
17
+ file?: string;
18
+ }
19
+ export type TokenPreprocessor = (env: Environment, tokens: Token[], path?: string) => Token[] | void;
20
+ export type Tag = (env: Environment, code: string, output: string, tokens: Token[]) => string | undefined;
21
+ export type FilterThis = {
22
+ data: Record<string, unknown>;
23
+ env: Environment;
24
+ };
25
+ export type Filter = (this: FilterThis, ...args: any[]) => any;
26
+ export type Plugin = (env: Environment) => void;
27
+ export interface Options {
28
+ loader: Loader;
29
+ dataVarname: string;
30
+ autoescape: boolean;
31
+ useWith: boolean;
32
+ }
33
+ export declare class Environment {
34
+ cache: Map<string, Template>;
35
+ options: Options;
36
+ tags: Tag[];
37
+ tokenPreprocessors: TokenPreprocessor[];
38
+ filters: Record<string, Filter>;
39
+ utils: Record<string, unknown>;
40
+ constructor(options: Options);
41
+ use(plugin: Plugin): void;
42
+ run(file: string, data: Record<string, unknown>, from?: string): Promise<TemplateResult>;
43
+ runString(source: string, data?: Record<string, unknown>, file?: string): Promise<TemplateResult>;
44
+ runStringSync(source: string, data?: Record<string, unknown>): TemplateResult;
45
+ compile(source: string, path?: string, defaults?: Record<string, unknown>, sync?: false): Template;
46
+ compile(source: string, path?: string, defaults?: Record<string, unknown>, sync?: true): TemplateSync;
47
+ tokenize(source: string, path?: string): Token[];
48
+ load(file: string, from?: string): Promise<Template>;
49
+ compileTokens(tokens: Token[], outputVar?: string, stopAt?: string[]): string[];
50
+ compileFilters(tokens: Token[], output: string, autoescape?: boolean): string;
51
+ createError(path: string, source: string, position: number, cause: Error): Error;
52
+ }
53
+ /** Returns the number and code of the errored line */
54
+ export declare function errorLine(source: string, pos: number): [number, number, string];
55
+ //# sourceMappingURL=environment.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"environment.d.ts","sourceRoot":"","sources":["../../src/src/environment.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,200 @@
1
+ import * as dntShim from "../_dnt.shims.js";
2
+ import tokenize from "./tokenizer.js";
3
+ import { transformTemplateCode } from "./transformer.js";
4
+ export class Environment {
5
+ cache = new Map();
6
+ options;
7
+ tags = [];
8
+ tokenPreprocessors = [];
9
+ filters = {};
10
+ utils = {};
11
+ constructor(options) {
12
+ this.options = options;
13
+ }
14
+ use(plugin) {
15
+ plugin(this);
16
+ }
17
+ async run(file, data, from) {
18
+ const template = await this.load(file, from);
19
+ return await template(data);
20
+ }
21
+ async runString(source, data, file) {
22
+ if (file) {
23
+ const cached = this.cache.get(file);
24
+ if (cached) {
25
+ return await cached(data);
26
+ }
27
+ const template = this.compile(source, file);
28
+ this.cache.set(file, template);
29
+ return await template(data);
30
+ }
31
+ const template = this.compile(source, file);
32
+ return await template(data);
33
+ }
34
+ runStringSync(source, data) {
35
+ const template = this.compile(source, "", {}, true);
36
+ return template(data);
37
+ }
38
+ compile(source, path, defaults, sync = false) {
39
+ const tokens = this.tokenize(source, path);
40
+ let code = this.compileTokens(tokens).join("\n");
41
+ const { dataVarname, useWith } = this.options;
42
+ if (useWith) {
43
+ code = transformTemplateCode(code, dataVarname);
44
+ }
45
+ const constructor = new Function("__file", "__env", "__defaults", `return${sync ? "" : " async"} function (${dataVarname}) {
46
+ let __pos = 0;
47
+ try {
48
+ ${dataVarname} = Object.assign({}, __defaults, ${dataVarname});
49
+ const __exports = { content: "" };
50
+ ${code}
51
+ return __exports;
52
+ } catch (cause) {
53
+ const template = __env.cache.get(__file);
54
+ throw __env.createError(__file, template?.source || "", __pos, cause);
55
+ }
56
+ }
57
+ `);
58
+ const template = constructor(path, this, defaults);
59
+ template.file = path;
60
+ template.code = code;
61
+ template.source = source;
62
+ return template;
63
+ }
64
+ tokenize(source, path) {
65
+ const result = tokenize(source);
66
+ let { tokens } = result;
67
+ const { position, error } = result;
68
+ if (error) {
69
+ throw this.createError(path || "unknown", source, position, error);
70
+ }
71
+ for (const tokenPreprocessor of this.tokenPreprocessors) {
72
+ const result = tokenPreprocessor(this, tokens, path);
73
+ if (result !== undefined) {
74
+ tokens = result;
75
+ }
76
+ }
77
+ return tokens;
78
+ }
79
+ async load(file, from) {
80
+ const path = from ? this.options.loader.resolve(from, file) : file;
81
+ if (!this.cache.has(path)) {
82
+ // Remove query and hash params from path before loading
83
+ const cleanPath = path
84
+ .split("?")[0]
85
+ .split("#")[0];
86
+ const { source, data } = await this.options.loader.load(cleanPath);
87
+ const template = this.compile(source, path, data);
88
+ this.cache.set(path, template);
89
+ }
90
+ return this.cache.get(path);
91
+ }
92
+ compileTokens(tokens, outputVar = "__exports.content", stopAt) {
93
+ const compiled = [];
94
+ tokens: while (tokens.length > 0) {
95
+ if (stopAt && tokens[0][0] === "tag" && stopAt.includes(tokens[0][1])) {
96
+ break;
97
+ }
98
+ const [type, code, pos] = tokens.shift();
99
+ if (type === "comment") {
100
+ continue;
101
+ }
102
+ if (type === "string") {
103
+ if (code !== "") {
104
+ compiled.push(`${outputVar} += ${JSON.stringify(code)};`);
105
+ }
106
+ continue;
107
+ }
108
+ if (type === "tag") {
109
+ compiled.push(`__pos = ${pos};`);
110
+ for (const tag of this.tags) {
111
+ const compiledTag = tag(this, code, outputVar, tokens);
112
+ if (typeof compiledTag === "string") {
113
+ compiled.push(compiledTag);
114
+ continue tokens;
115
+ }
116
+ }
117
+ // Unknown tag, just print it
118
+ const expression = this.compileFilters(tokens, code, this.options.autoescape);
119
+ compiled.push(`${outputVar} += (${expression}) ?? "";`);
120
+ continue;
121
+ }
122
+ throw new Error(`Unknown token type "${type}"`);
123
+ }
124
+ return compiled;
125
+ }
126
+ compileFilters(tokens, output, autoescape = false) {
127
+ let unescaped = false;
128
+ while (tokens.length > 0 && tokens[0][0] === "filter") {
129
+ const [, code] = tokens.shift();
130
+ const match = code.match(/^(await\s+)?([\w.]+)(?:\((.*)\))?$/);
131
+ if (!match) {
132
+ throw new Error(`Invalid filter: ${code}`);
133
+ }
134
+ const [_, isAsync, name, args] = match;
135
+ if (!this.filters[name]) {
136
+ if (name === "safe") {
137
+ unescaped = true;
138
+ }
139
+ else if (isGlobal(name)) {
140
+ // If a global function
141
+ output = `${isAsync ? "await " : ""}${name}(${output}${args ? `, ${args}` : ""})`;
142
+ }
143
+ else {
144
+ // It's a prototype's method (e.g. `String.toUpperCase()`)
145
+ output = `${isAsync ? "await " : ""}(${output})?.${name}?.(${args ? args : ""})`;
146
+ }
147
+ }
148
+ else {
149
+ // It's a filter (e.g. filters.upper())
150
+ const { dataVarname } = this.options;
151
+ output = `${(isAsync || checkAsync(this.filters[name])) ? "await " : ""}__env.filters.${name}.call({data:${dataVarname},env:__env}, ${output}${args ? `, ${args}` : ""})`;
152
+ }
153
+ }
154
+ // Escape by default
155
+ if (autoescape && !unescaped) {
156
+ output = `__env.filters.escape(${output})`;
157
+ }
158
+ return output;
159
+ }
160
+ createError(path, source, position, cause) {
161
+ if (!source) {
162
+ return cause;
163
+ }
164
+ const [line, column, code] = errorLine(source, position);
165
+ return new Error(`Error in the template ${path}:${line}:${column}\n\n${code.trim()}\n\n> ${cause.message}\n`, { cause });
166
+ }
167
+ }
168
+ function isGlobal(name) {
169
+ // @ts-ignore TS doesn't know about globalThis
170
+ if (dntShim.dntGlobalThis[name]) {
171
+ return true;
172
+ }
173
+ if (name.includes(".")) {
174
+ const [obj, prop] = name.split(".");
175
+ // @ts-ignore TS doesn't know about globalThis
176
+ return typeof dntShim.dntGlobalThis[obj]?.[prop] === "function";
177
+ }
178
+ }
179
+ /** Returns the number and code of the errored line */
180
+ export function errorLine(source, pos) {
181
+ let line = 1;
182
+ let column = 1;
183
+ for (let index = 0; index < pos; index++) {
184
+ if (source[index] === "\n" ||
185
+ (source[index] === "\r" && source[index + 1] === "\n")) {
186
+ line++;
187
+ column = 1;
188
+ if (source[index] === "\r") {
189
+ index++;
190
+ }
191
+ }
192
+ else {
193
+ column++;
194
+ }
195
+ }
196
+ return [line, column, source.split("\n")[line - 1]];
197
+ }
198
+ function checkAsync(fn) {
199
+ return fn.constructor?.name === "AsyncFunction";
200
+ }
@@ -0,0 +1,5 @@
1
+ type breakpoints = "new-filter" | "open-bracket" | "close" | "unclosed";
2
+ type Visitor = (type: breakpoints, index: number) => false | void;
3
+ export default function analyze(source: string, visitor: Visitor): void;
4
+ export {};
5
+ //# sourceMappingURL=js.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"js.d.ts","sourceRoot":"","sources":["../../src/src/js.ts"],"names":[],"mappings":"AAAA,KAAK,WAAW,GACZ,YAAY,GACZ,cAAc,GACd,OAAO,GACP,UAAU,CAAC;AAWf,KAAK,OAAO,GAAG,CAAC,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,KAAK,KAAK,GAAG,IAAI,CAAC;AAElE,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,QAuK/D"}
package/esm/src/js.js ADDED
@@ -0,0 +1,150 @@
1
+ export default function analyze(source, visitor) {
2
+ const length = source.length;
3
+ const statuses = [];
4
+ let index = 0;
5
+ while (index < length) {
6
+ const char = source.charAt(index++);
7
+ switch (char) {
8
+ // Detect start brackets
9
+ case "{": {
10
+ const status = statuses[0];
11
+ if (status === "literal" && source.charAt(index - 2) === "$") {
12
+ statuses.unshift("bracket");
13
+ }
14
+ else if (status !== "comment" && status !== "single-quote" &&
15
+ status !== "double-quote" && status !== "literal" &&
16
+ status !== "regex" && status !== "line-comment") {
17
+ if (statuses.length === 0 && visitor("open-bracket", index) === false) {
18
+ return;
19
+ }
20
+ statuses.unshift("bracket");
21
+ }
22
+ break;
23
+ }
24
+ // Detect end brackets
25
+ case "}": {
26
+ const status = statuses[0];
27
+ if (status === "bracket") {
28
+ statuses.shift();
29
+ if (statuses.length === 0 && visitor("close", index) === false) {
30
+ return;
31
+ }
32
+ }
33
+ break;
34
+ }
35
+ // Detect double quotes
36
+ case '"': {
37
+ const status = statuses[0];
38
+ if (status === "double-quote") {
39
+ statuses.shift();
40
+ }
41
+ else if (status !== "comment" &&
42
+ status !== "single-quote" &&
43
+ status !== "literal" &&
44
+ status !== "regex" &&
45
+ status !== "line-comment") {
46
+ statuses.unshift("double-quote");
47
+ }
48
+ break;
49
+ }
50
+ // Detect single quotes
51
+ case "'": {
52
+ const status = statuses[0];
53
+ if (status === "single-quote") {
54
+ statuses.shift();
55
+ }
56
+ else if (status !== "comment" &&
57
+ status !== "double-quote" &&
58
+ status !== "literal" &&
59
+ status !== "regex" &&
60
+ status !== "line-comment") {
61
+ statuses.unshift("single-quote");
62
+ }
63
+ break;
64
+ }
65
+ // Detect literals
66
+ case "`": {
67
+ const status = statuses[0];
68
+ if (status === "literal") {
69
+ statuses.shift();
70
+ }
71
+ else if (status !== "comment" &&
72
+ status !== "double-quote" &&
73
+ status !== "single-quote" &&
74
+ status !== "regex" &&
75
+ status !== "line-comment") {
76
+ statuses.unshift("literal");
77
+ }
78
+ break;
79
+ }
80
+ // Detect comments and regex
81
+ case "/": {
82
+ const status = statuses[0];
83
+ if (status === "single-quote" || status === "double-quote" ||
84
+ status === "literal" || status === "line-comment") {
85
+ break;
86
+ }
87
+ // We are in a comment: close or ignore
88
+ if (status === "comment") {
89
+ if (source.charAt(index - 2) === "*") {
90
+ statuses.shift();
91
+ }
92
+ break;
93
+ }
94
+ // We are in a regex: close or ignore
95
+ if (status === "regex") {
96
+ if (source.charAt(index - 2) !== "\\") {
97
+ statuses.shift();
98
+ }
99
+ break;
100
+ }
101
+ // Start a new comment
102
+ if (source.charAt(index) === "*") {
103
+ statuses.unshift("comment");
104
+ break;
105
+ }
106
+ // Start a new line comment
107
+ if (source.charAt(index - 2) === "/") {
108
+ statuses.unshift("line-comment");
109
+ break;
110
+ }
111
+ // Start a new regex
112
+ const prev = prevChar(source, index - 1);
113
+ if (prev === "(" || prev === "=" || prev === ":" || prev === ",") {
114
+ statuses.unshift("regex");
115
+ }
116
+ break;
117
+ }
118
+ // Detect end of line comments
119
+ case "\n": {
120
+ const status = statuses[0];
121
+ if (status === "line-comment") {
122
+ statuses.shift();
123
+ }
124
+ break;
125
+ }
126
+ // Detect filters
127
+ case "|": {
128
+ const status = statuses[0];
129
+ if (status === "bracket" && source.charAt(index) === ">" &&
130
+ visitor("new-filter", index + 1) === false) {
131
+ return;
132
+ }
133
+ break;
134
+ }
135
+ }
136
+ }
137
+ if (statuses.length > 0) {
138
+ visitor("unclosed", index);
139
+ }
140
+ }
141
+ // Get the previous character in a string ignoring spaces, line breaks and tabs
142
+ function prevChar(source, index) {
143
+ while (index > 0) {
144
+ const char = source.charAt(--index);
145
+ if (char !== " " && char !== "\n" && char !== "\r" && char !== "\t") {
146
+ return char;
147
+ }
148
+ }
149
+ return "";
150
+ }
@@ -0,0 +1,15 @@
1
+ export interface TemplateSource {
2
+ source: string;
3
+ data?: Record<string, unknown>;
4
+ }
5
+ export interface Loader {
6
+ load(file: string): TemplateSource | Promise<TemplateSource>;
7
+ resolve(from: string, file: string): string;
8
+ }
9
+ export declare class FileLoader implements Loader {
10
+ #private;
11
+ constructor(root: string);
12
+ load(file: string): Promise<TemplateSource>;
13
+ resolve(from: string, file: string): string;
14
+ }
15
+ //# sourceMappingURL=loader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../src/src/loader.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAChC;AAED,MAAM,WAAW,MAAM;IACrB,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;IAC7D,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;CAC7C;AAED,qBAAa,UAAW,YAAW,MAAM;;gBAG3B,IAAI,EAAE,MAAM;IAIlB,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;IAMjD,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM;CAO5C"}