@effectionx/worker 0.1.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 (226) hide show
  1. package/README.md +149 -0
  2. package/esm/_dnt.shims.d.ts +2 -0
  3. package/esm/_dnt.shims.d.ts.map +1 -0
  4. package/esm/_dnt.shims.js +57 -0
  5. package/esm/deps/jsr.io/@std/assert/1.0.12/almost_equals.d.ts +29 -0
  6. package/esm/deps/jsr.io/@std/assert/1.0.12/almost_equals.d.ts.map +1 -0
  7. package/esm/deps/jsr.io/@std/assert/1.0.12/almost_equals.js +46 -0
  8. package/esm/deps/jsr.io/@std/assert/1.0.12/array_includes.d.ts +24 -0
  9. package/esm/deps/jsr.io/@std/assert/1.0.12/array_includes.d.ts.map +1 -0
  10. package/esm/deps/jsr.io/@std/assert/1.0.12/array_includes.js +46 -0
  11. package/esm/deps/jsr.io/@std/assert/1.0.12/assert.d.ts +16 -0
  12. package/esm/deps/jsr.io/@std/assert/1.0.12/assert.d.ts.map +1 -0
  13. package/esm/deps/jsr.io/@std/assert/1.0.12/assert.js +22 -0
  14. package/esm/deps/jsr.io/@std/assert/1.0.12/assertion_error.d.ts +26 -0
  15. package/esm/deps/jsr.io/@std/assert/1.0.12/assertion_error.d.ts.map +1 -0
  16. package/esm/deps/jsr.io/@std/assert/1.0.12/assertion_error.js +30 -0
  17. package/esm/deps/jsr.io/@std/assert/1.0.12/equal.d.ts +17 -0
  18. package/esm/deps/jsr.io/@std/assert/1.0.12/equal.d.ts.map +1 -0
  19. package/esm/deps/jsr.io/@std/assert/1.0.12/equal.js +183 -0
  20. package/esm/deps/jsr.io/@std/assert/1.0.12/equals.d.ts +35 -0
  21. package/esm/deps/jsr.io/@std/assert/1.0.12/equals.d.ts.map +1 -0
  22. package/esm/deps/jsr.io/@std/assert/1.0.12/equals.js +58 -0
  23. package/esm/deps/jsr.io/@std/assert/1.0.12/exists.d.ts +18 -0
  24. package/esm/deps/jsr.io/@std/assert/1.0.12/exists.d.ts.map +1 -0
  25. package/esm/deps/jsr.io/@std/assert/1.0.12/exists.js +27 -0
  26. package/esm/deps/jsr.io/@std/assert/1.0.12/fail.d.ts +15 -0
  27. package/esm/deps/jsr.io/@std/assert/1.0.12/fail.d.ts.map +1 -0
  28. package/esm/deps/jsr.io/@std/assert/1.0.12/fail.js +20 -0
  29. package/esm/deps/jsr.io/@std/assert/1.0.12/false.d.ts +18 -0
  30. package/esm/deps/jsr.io/@std/assert/1.0.12/false.d.ts.map +1 -0
  31. package/esm/deps/jsr.io/@std/assert/1.0.12/false.js +22 -0
  32. package/esm/deps/jsr.io/@std/assert/1.0.12/greater.d.ts +20 -0
  33. package/esm/deps/jsr.io/@std/assert/1.0.12/greater.d.ts.map +1 -0
  34. package/esm/deps/jsr.io/@std/assert/1.0.12/greater.js +29 -0
  35. package/esm/deps/jsr.io/@std/assert/1.0.12/greater_or_equal.d.ts +20 -0
  36. package/esm/deps/jsr.io/@std/assert/1.0.12/greater_or_equal.d.ts.map +1 -0
  37. package/esm/deps/jsr.io/@std/assert/1.0.12/greater_or_equal.js +29 -0
  38. package/esm/deps/jsr.io/@std/assert/1.0.12/instance_of.d.ts +23 -0
  39. package/esm/deps/jsr.io/@std/assert/1.0.12/instance_of.d.ts.map +1 -0
  40. package/esm/deps/jsr.io/@std/assert/1.0.12/instance_of.js +52 -0
  41. package/esm/deps/jsr.io/@std/assert/1.0.12/is_error.d.ts +25 -0
  42. package/esm/deps/jsr.io/@std/assert/1.0.12/is_error.d.ts.map +1 -0
  43. package/esm/deps/jsr.io/@std/assert/1.0.12/is_error.js +53 -0
  44. package/esm/deps/jsr.io/@std/assert/1.0.12/less.d.ts +19 -0
  45. package/esm/deps/jsr.io/@std/assert/1.0.12/less.d.ts.map +1 -0
  46. package/esm/deps/jsr.io/@std/assert/1.0.12/less.js +28 -0
  47. package/esm/deps/jsr.io/@std/assert/1.0.12/less_or_equal.d.ts +20 -0
  48. package/esm/deps/jsr.io/@std/assert/1.0.12/less_or_equal.d.ts.map +1 -0
  49. package/esm/deps/jsr.io/@std/assert/1.0.12/less_or_equal.js +29 -0
  50. package/esm/deps/jsr.io/@std/assert/1.0.12/match.d.ts +18 -0
  51. package/esm/deps/jsr.io/@std/assert/1.0.12/match.d.ts.map +1 -0
  52. package/esm/deps/jsr.io/@std/assert/1.0.12/match.js +26 -0
  53. package/esm/deps/jsr.io/@std/assert/1.0.12/mod.d.ts +44 -0
  54. package/esm/deps/jsr.io/@std/assert/1.0.12/mod.d.ts.map +1 -0
  55. package/esm/deps/jsr.io/@std/assert/1.0.12/mod.js +45 -0
  56. package/esm/deps/jsr.io/@std/assert/1.0.12/not_equals.d.ts +21 -0
  57. package/esm/deps/jsr.io/@std/assert/1.0.12/not_equals.d.ts.map +1 -0
  58. package/esm/deps/jsr.io/@std/assert/1.0.12/not_equals.js +33 -0
  59. package/esm/deps/jsr.io/@std/assert/1.0.12/not_instance_of.d.ts +20 -0
  60. package/esm/deps/jsr.io/@std/assert/1.0.12/not_instance_of.d.ts.map +1 -0
  61. package/esm/deps/jsr.io/@std/assert/1.0.12/not_instance_of.js +29 -0
  62. package/esm/deps/jsr.io/@std/assert/1.0.12/not_match.d.ts +18 -0
  63. package/esm/deps/jsr.io/@std/assert/1.0.12/not_match.d.ts.map +1 -0
  64. package/esm/deps/jsr.io/@std/assert/1.0.12/not_match.js +26 -0
  65. package/esm/deps/jsr.io/@std/assert/1.0.12/not_strict_equals.d.ts +23 -0
  66. package/esm/deps/jsr.io/@std/assert/1.0.12/not_strict_equals.d.ts.map +1 -0
  67. package/esm/deps/jsr.io/@std/assert/1.0.12/not_strict_equals.js +32 -0
  68. package/esm/deps/jsr.io/@std/assert/1.0.12/object_match.d.ts +29 -0
  69. package/esm/deps/jsr.io/@std/assert/1.0.12/object_match.d.ts.map +1 -0
  70. package/esm/deps/jsr.io/@std/assert/1.0.12/object_match.js +167 -0
  71. package/esm/deps/jsr.io/@std/assert/1.0.12/rejects.d.ts +42 -0
  72. package/esm/deps/jsr.io/@std/assert/1.0.12/rejects.d.ts.map +1 -0
  73. package/esm/deps/jsr.io/@std/assert/1.0.12/rejects.js +53 -0
  74. package/esm/deps/jsr.io/@std/assert/1.0.12/strict_equals.d.ts +24 -0
  75. package/esm/deps/jsr.io/@std/assert/1.0.12/strict_equals.d.ts.map +1 -0
  76. package/esm/deps/jsr.io/@std/assert/1.0.12/strict_equals.js +57 -0
  77. package/esm/deps/jsr.io/@std/assert/1.0.12/string_includes.d.ts +18 -0
  78. package/esm/deps/jsr.io/@std/assert/1.0.12/string_includes.d.ts.map +1 -0
  79. package/esm/deps/jsr.io/@std/assert/1.0.12/string_includes.js +26 -0
  80. package/esm/deps/jsr.io/@std/assert/1.0.12/throws.d.ts +45 -0
  81. package/esm/deps/jsr.io/@std/assert/1.0.12/throws.d.ts.map +1 -0
  82. package/esm/deps/jsr.io/@std/assert/1.0.12/throws.js +44 -0
  83. package/esm/deps/jsr.io/@std/assert/1.0.12/unimplemented.d.ts +15 -0
  84. package/esm/deps/jsr.io/@std/assert/1.0.12/unimplemented.d.ts.map +1 -0
  85. package/esm/deps/jsr.io/@std/assert/1.0.12/unimplemented.js +20 -0
  86. package/esm/deps/jsr.io/@std/assert/1.0.12/unreachable.d.ts +15 -0
  87. package/esm/deps/jsr.io/@std/assert/1.0.12/unreachable.d.ts.map +1 -0
  88. package/esm/deps/jsr.io/@std/assert/1.0.12/unreachable.js +20 -0
  89. package/esm/deps/jsr.io/@std/internal/1.0.6/build_message.d.ts +82 -0
  90. package/esm/deps/jsr.io/@std/internal/1.0.6/build_message.d.ts.map +1 -0
  91. package/esm/deps/jsr.io/@std/internal/1.0.6/build_message.js +110 -0
  92. package/esm/deps/jsr.io/@std/internal/1.0.6/diff.d.ts +140 -0
  93. package/esm/deps/jsr.io/@std/internal/1.0.6/diff.d.ts.map +1 -0
  94. package/esm/deps/jsr.io/@std/internal/1.0.6/diff.js +276 -0
  95. package/esm/deps/jsr.io/@std/internal/1.0.6/diff_str.d.ts +99 -0
  96. package/esm/deps/jsr.io/@std/internal/1.0.6/diff_str.d.ts.map +1 -0
  97. package/esm/deps/jsr.io/@std/internal/1.0.6/diff_str.js +182 -0
  98. package/esm/deps/jsr.io/@std/internal/1.0.6/format.d.ts +2 -0
  99. package/esm/deps/jsr.io/@std/internal/1.0.6/format.d.ts.map +1 -0
  100. package/esm/deps/jsr.io/@std/internal/1.0.6/format.js +37 -0
  101. package/esm/deps/jsr.io/@std/internal/1.0.6/styles.d.ts +159 -0
  102. package/esm/deps/jsr.io/@std/internal/1.0.6/styles.d.ts.map +1 -0
  103. package/esm/deps/jsr.io/@std/internal/1.0.6/styles.js +207 -0
  104. package/esm/deps/jsr.io/@std/internal/1.0.6/types.d.ts +16 -0
  105. package/esm/deps/jsr.io/@std/internal/1.0.6/types.d.ts.map +1 -0
  106. package/esm/deps/jsr.io/@std/internal/1.0.6/types.js +3 -0
  107. package/esm/mod.d.ts +2 -0
  108. package/esm/mod.d.ts.map +1 -0
  109. package/esm/mod.js +1 -0
  110. package/esm/package.json +3 -0
  111. package/esm/worker.d.ts +135 -0
  112. package/esm/worker.d.ts.map +1 -0
  113. package/esm/worker.js +237 -0
  114. package/package.json +29 -0
  115. package/script/_dnt.shims.d.ts +2 -0
  116. package/script/_dnt.shims.d.ts.map +1 -0
  117. package/script/_dnt.shims.js +60 -0
  118. package/script/deps/jsr.io/@std/assert/1.0.12/almost_equals.d.ts +29 -0
  119. package/script/deps/jsr.io/@std/assert/1.0.12/almost_equals.d.ts.map +1 -0
  120. package/script/deps/jsr.io/@std/assert/1.0.12/almost_equals.js +49 -0
  121. package/script/deps/jsr.io/@std/assert/1.0.12/array_includes.d.ts +24 -0
  122. package/script/deps/jsr.io/@std/assert/1.0.12/array_includes.d.ts.map +1 -0
  123. package/script/deps/jsr.io/@std/assert/1.0.12/array_includes.js +49 -0
  124. package/script/deps/jsr.io/@std/assert/1.0.12/assert.d.ts +16 -0
  125. package/script/deps/jsr.io/@std/assert/1.0.12/assert.d.ts.map +1 -0
  126. package/script/deps/jsr.io/@std/assert/1.0.12/assert.js +25 -0
  127. package/script/deps/jsr.io/@std/assert/1.0.12/assertion_error.d.ts +26 -0
  128. package/script/deps/jsr.io/@std/assert/1.0.12/assertion_error.d.ts.map +1 -0
  129. package/script/deps/jsr.io/@std/assert/1.0.12/assertion_error.js +34 -0
  130. package/script/deps/jsr.io/@std/assert/1.0.12/equal.d.ts +17 -0
  131. package/script/deps/jsr.io/@std/assert/1.0.12/equal.d.ts.map +1 -0
  132. package/script/deps/jsr.io/@std/assert/1.0.12/equal.js +209 -0
  133. package/script/deps/jsr.io/@std/assert/1.0.12/equals.d.ts +35 -0
  134. package/script/deps/jsr.io/@std/assert/1.0.12/equals.d.ts.map +1 -0
  135. package/script/deps/jsr.io/@std/assert/1.0.12/equals.js +61 -0
  136. package/script/deps/jsr.io/@std/assert/1.0.12/exists.d.ts +18 -0
  137. package/script/deps/jsr.io/@std/assert/1.0.12/exists.d.ts.map +1 -0
  138. package/script/deps/jsr.io/@std/assert/1.0.12/exists.js +30 -0
  139. package/script/deps/jsr.io/@std/assert/1.0.12/fail.d.ts +15 -0
  140. package/script/deps/jsr.io/@std/assert/1.0.12/fail.d.ts.map +1 -0
  141. package/script/deps/jsr.io/@std/assert/1.0.12/fail.js +23 -0
  142. package/script/deps/jsr.io/@std/assert/1.0.12/false.d.ts +18 -0
  143. package/script/deps/jsr.io/@std/assert/1.0.12/false.d.ts.map +1 -0
  144. package/script/deps/jsr.io/@std/assert/1.0.12/false.js +25 -0
  145. package/script/deps/jsr.io/@std/assert/1.0.12/greater.d.ts +20 -0
  146. package/script/deps/jsr.io/@std/assert/1.0.12/greater.d.ts.map +1 -0
  147. package/script/deps/jsr.io/@std/assert/1.0.12/greater.js +32 -0
  148. package/script/deps/jsr.io/@std/assert/1.0.12/greater_or_equal.d.ts +20 -0
  149. package/script/deps/jsr.io/@std/assert/1.0.12/greater_or_equal.d.ts.map +1 -0
  150. package/script/deps/jsr.io/@std/assert/1.0.12/greater_or_equal.js +32 -0
  151. package/script/deps/jsr.io/@std/assert/1.0.12/instance_of.d.ts +23 -0
  152. package/script/deps/jsr.io/@std/assert/1.0.12/instance_of.d.ts.map +1 -0
  153. package/script/deps/jsr.io/@std/assert/1.0.12/instance_of.js +55 -0
  154. package/script/deps/jsr.io/@std/assert/1.0.12/is_error.d.ts +25 -0
  155. package/script/deps/jsr.io/@std/assert/1.0.12/is_error.d.ts.map +1 -0
  156. package/script/deps/jsr.io/@std/assert/1.0.12/is_error.js +56 -0
  157. package/script/deps/jsr.io/@std/assert/1.0.12/less.d.ts +19 -0
  158. package/script/deps/jsr.io/@std/assert/1.0.12/less.d.ts.map +1 -0
  159. package/script/deps/jsr.io/@std/assert/1.0.12/less.js +31 -0
  160. package/script/deps/jsr.io/@std/assert/1.0.12/less_or_equal.d.ts +20 -0
  161. package/script/deps/jsr.io/@std/assert/1.0.12/less_or_equal.d.ts.map +1 -0
  162. package/script/deps/jsr.io/@std/assert/1.0.12/less_or_equal.js +32 -0
  163. package/script/deps/jsr.io/@std/assert/1.0.12/match.d.ts +18 -0
  164. package/script/deps/jsr.io/@std/assert/1.0.12/match.d.ts.map +1 -0
  165. package/script/deps/jsr.io/@std/assert/1.0.12/match.js +29 -0
  166. package/script/deps/jsr.io/@std/assert/1.0.12/mod.d.ts +44 -0
  167. package/script/deps/jsr.io/@std/assert/1.0.12/mod.d.ts.map +1 -0
  168. package/script/deps/jsr.io/@std/assert/1.0.12/mod.js +61 -0
  169. package/script/deps/jsr.io/@std/assert/1.0.12/not_equals.d.ts +21 -0
  170. package/script/deps/jsr.io/@std/assert/1.0.12/not_equals.d.ts.map +1 -0
  171. package/script/deps/jsr.io/@std/assert/1.0.12/not_equals.js +36 -0
  172. package/script/deps/jsr.io/@std/assert/1.0.12/not_instance_of.d.ts +20 -0
  173. package/script/deps/jsr.io/@std/assert/1.0.12/not_instance_of.d.ts.map +1 -0
  174. package/script/deps/jsr.io/@std/assert/1.0.12/not_instance_of.js +32 -0
  175. package/script/deps/jsr.io/@std/assert/1.0.12/not_match.d.ts +18 -0
  176. package/script/deps/jsr.io/@std/assert/1.0.12/not_match.d.ts.map +1 -0
  177. package/script/deps/jsr.io/@std/assert/1.0.12/not_match.js +29 -0
  178. package/script/deps/jsr.io/@std/assert/1.0.12/not_strict_equals.d.ts +23 -0
  179. package/script/deps/jsr.io/@std/assert/1.0.12/not_strict_equals.d.ts.map +1 -0
  180. package/script/deps/jsr.io/@std/assert/1.0.12/not_strict_equals.js +35 -0
  181. package/script/deps/jsr.io/@std/assert/1.0.12/object_match.d.ts +29 -0
  182. package/script/deps/jsr.io/@std/assert/1.0.12/object_match.d.ts.map +1 -0
  183. package/script/deps/jsr.io/@std/assert/1.0.12/object_match.js +170 -0
  184. package/script/deps/jsr.io/@std/assert/1.0.12/rejects.d.ts +42 -0
  185. package/script/deps/jsr.io/@std/assert/1.0.12/rejects.d.ts.map +1 -0
  186. package/script/deps/jsr.io/@std/assert/1.0.12/rejects.js +56 -0
  187. package/script/deps/jsr.io/@std/assert/1.0.12/strict_equals.d.ts +24 -0
  188. package/script/deps/jsr.io/@std/assert/1.0.12/strict_equals.d.ts.map +1 -0
  189. package/script/deps/jsr.io/@std/assert/1.0.12/strict_equals.js +60 -0
  190. package/script/deps/jsr.io/@std/assert/1.0.12/string_includes.d.ts +18 -0
  191. package/script/deps/jsr.io/@std/assert/1.0.12/string_includes.d.ts.map +1 -0
  192. package/script/deps/jsr.io/@std/assert/1.0.12/string_includes.js +29 -0
  193. package/script/deps/jsr.io/@std/assert/1.0.12/throws.d.ts +45 -0
  194. package/script/deps/jsr.io/@std/assert/1.0.12/throws.d.ts.map +1 -0
  195. package/script/deps/jsr.io/@std/assert/1.0.12/throws.js +47 -0
  196. package/script/deps/jsr.io/@std/assert/1.0.12/unimplemented.d.ts +15 -0
  197. package/script/deps/jsr.io/@std/assert/1.0.12/unimplemented.d.ts.map +1 -0
  198. package/script/deps/jsr.io/@std/assert/1.0.12/unimplemented.js +23 -0
  199. package/script/deps/jsr.io/@std/assert/1.0.12/unreachable.d.ts +15 -0
  200. package/script/deps/jsr.io/@std/assert/1.0.12/unreachable.d.ts.map +1 -0
  201. package/script/deps/jsr.io/@std/assert/1.0.12/unreachable.js +23 -0
  202. package/script/deps/jsr.io/@std/internal/1.0.6/build_message.d.ts +82 -0
  203. package/script/deps/jsr.io/@std/internal/1.0.6/build_message.d.ts.map +1 -0
  204. package/script/deps/jsr.io/@std/internal/1.0.6/build_message.js +115 -0
  205. package/script/deps/jsr.io/@std/internal/1.0.6/diff.d.ts +140 -0
  206. package/script/deps/jsr.io/@std/internal/1.0.6/diff.d.ts.map +1 -0
  207. package/script/deps/jsr.io/@std/internal/1.0.6/diff.js +283 -0
  208. package/script/deps/jsr.io/@std/internal/1.0.6/diff_str.d.ts +99 -0
  209. package/script/deps/jsr.io/@std/internal/1.0.6/diff_str.d.ts.map +1 -0
  210. package/script/deps/jsr.io/@std/internal/1.0.6/diff_str.js +188 -0
  211. package/script/deps/jsr.io/@std/internal/1.0.6/format.d.ts +2 -0
  212. package/script/deps/jsr.io/@std/internal/1.0.6/format.d.ts.map +1 -0
  213. package/script/deps/jsr.io/@std/internal/1.0.6/format.js +63 -0
  214. package/script/deps/jsr.io/@std/internal/1.0.6/styles.d.ts +159 -0
  215. package/script/deps/jsr.io/@std/internal/1.0.6/styles.d.ts.map +1 -0
  216. package/script/deps/jsr.io/@std/internal/1.0.6/styles.js +242 -0
  217. package/script/deps/jsr.io/@std/internal/1.0.6/types.d.ts +16 -0
  218. package/script/deps/jsr.io/@std/internal/1.0.6/types.d.ts.map +1 -0
  219. package/script/deps/jsr.io/@std/internal/1.0.6/types.js +4 -0
  220. package/script/mod.d.ts +2 -0
  221. package/script/mod.d.ts.map +1 -0
  222. package/script/mod.js +17 -0
  223. package/script/package.json +3 -0
  224. package/script/worker.d.ts +135 -0
  225. package/script/worker.d.ts.map +1 -0
  226. package/script/worker.js +241 -0
@@ -0,0 +1,159 @@
1
+ /**
2
+ * Sets the style of text to be printed to bold.
3
+ *
4
+ * Disable by setting the `NO_COLOR` environmental variable.
5
+ *
6
+ * @param str Text to make bold
7
+ *
8
+ * @returns Bold text for printing
9
+ *
10
+ * @example Usage
11
+ * ```ts no-assert
12
+ * import { bold } from "@std/internal/styles";
13
+ *
14
+ * console.log(bold("Hello, world!")); // Prints "Hello, world!" in bold
15
+ * ```
16
+ */
17
+ export declare function bold(str: string): string;
18
+ /**
19
+ * Sets the color of text to be printed to red.
20
+ *
21
+ * Disable by setting the `NO_COLOR` environmental variable.
22
+ *
23
+ * @param str Text to make red
24
+ *
25
+ * @returns Red text for printing
26
+ *
27
+ * @example Usage
28
+ * ```ts no-assert
29
+ * import { red } from "@std/internal/styles";
30
+ *
31
+ * console.log(red("Hello, world!")); // Prints "Hello, world!" in red
32
+ * ```
33
+ */
34
+ export declare function red(str: string): string;
35
+ /**
36
+ * Sets the color of text to be printed to green.
37
+ *
38
+ * Disable by setting the `NO_COLOR` environmental variable.
39
+ *
40
+ * @param str Text to make green
41
+ *
42
+ * @returns Green text for print
43
+ *
44
+ * @example Usage
45
+ * ```ts no-assert
46
+ * import { green } from "@std/internal/styles";
47
+ *
48
+ * console.log(green("Hello, world!")); // Prints "Hello, world!" in green
49
+ * ```
50
+ */
51
+ export declare function green(str: string): string;
52
+ /**
53
+ * Sets the color of text to be printed to yellow.
54
+ *
55
+ * Disable by setting the `NO_COLOR` environmental variable.
56
+ *
57
+ * @param str Text to make yellow
58
+ *
59
+ * @returns Yellow text for print
60
+ *
61
+ * @example Usage
62
+ * ```ts no-assert
63
+ * import { yellow } from "@std/internal/styles";
64
+ *
65
+ * console.log(yellow("Hello, world!")); // Prints "Hello, world!" in yellow
66
+ * ```
67
+ */
68
+ export declare function yellow(str: string): string;
69
+ /**
70
+ * Sets the color of text to be printed to white.
71
+ *
72
+ * @param str Text to make white
73
+ *
74
+ * @returns White text for print
75
+ *
76
+ * @example Usage
77
+ * ```ts no-assert
78
+ * import { white } from "@std/internal/styles";
79
+ *
80
+ * console.log(white("Hello, world!")); // Prints "Hello, world!" in white
81
+ * ```
82
+ */
83
+ export declare function white(str: string): string;
84
+ /**
85
+ * Sets the color of text to be printed to gray.
86
+ *
87
+ * @param str Text to make gray
88
+ *
89
+ * @returns Gray text for print
90
+ *
91
+ * @example Usage
92
+ * ```ts no-assert
93
+ * import { gray } from "@std/internal/styles";
94
+ *
95
+ * console.log(gray("Hello, world!")); // Prints "Hello, world!" in gray
96
+ * ```
97
+ */
98
+ export declare function gray(str: string): string;
99
+ /**
100
+ * Sets the color of text to be printed to bright-black.
101
+ *
102
+ * @param str Text to make bright-black
103
+ *
104
+ * @returns Bright-black text for print
105
+ *
106
+ * @example Usage
107
+ * ```ts no-assert
108
+ * import { brightBlack } from "@std/internal/styles";
109
+ *
110
+ * console.log(brightBlack("Hello, world!")); // Prints "Hello, world!" in bright-black
111
+ * ```
112
+ */
113
+ export declare function brightBlack(str: string): string;
114
+ /**
115
+ * Sets the background color of text to be printed to red.
116
+ *
117
+ * @param str Text to make its background red
118
+ *
119
+ * @returns Red background text for print
120
+ *
121
+ * @example Usage
122
+ * ```ts no-assert
123
+ * import { bgRed } from "@std/internal/styles";
124
+ *
125
+ * console.log(bgRed("Hello, world!")); // Prints "Hello, world!" with red background
126
+ * ```
127
+ */
128
+ export declare function bgRed(str: string): string;
129
+ /**
130
+ * Sets the background color of text to be printed to green.
131
+ *
132
+ * @param str Text to make its background green
133
+ *
134
+ * @returns Green background text for print
135
+ *
136
+ * @example Usage
137
+ * ```ts no-assert
138
+ * import { bgGreen } from "@std/internal/styles";
139
+ *
140
+ * console.log(bgGreen("Hello, world!")); // Prints "Hello, world!" with green background
141
+ * ```
142
+ */
143
+ export declare function bgGreen(str: string): string;
144
+ /**
145
+ * Remove ANSI escape codes from the string.
146
+ *
147
+ * @param string Text to remove ANSI escape codes from
148
+ *
149
+ * @returns Text without ANSI escape codes
150
+ *
151
+ * @example Usage
152
+ * ```ts no-assert
153
+ * import { red, stripAnsiCode } from "@std/internal/styles";
154
+ *
155
+ * console.log(stripAnsiCode(red("Hello, world!"))); // Prints "Hello, world!"
156
+ * ```
157
+ */
158
+ export declare function stripAnsiCode(string: string): string;
159
+ //# sourceMappingURL=styles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/internal/1.0.6/styles.ts"],"names":[],"mappings":"AAqCA;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAExC;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEvC;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEzC;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE1C;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEzC;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAExC;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE/C;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEzC;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE3C;AAWD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAEpD"}
@@ -0,0 +1,207 @@
1
+ // Copyright 2018-2025 the Deno authors. MIT license.
2
+ // This module is browser compatible.
3
+ // A module to print ANSI terminal colors. Inspired by chalk, kleur, and colors
4
+ // on npm.
5
+ // This code is vendored from `fmt/colors.ts`.
6
+ // deno-lint-ignore no-explicit-any
7
+ import * as dntShim from "../../../../../_dnt.shims.js";
8
+ const { Deno } = dntShim.dntGlobalThis;
9
+ const noColor = typeof Deno?.noColor === "boolean"
10
+ ? Deno.noColor
11
+ : false;
12
+ const enabled = !noColor;
13
+ function code(open, close) {
14
+ return {
15
+ open: `\x1b[${open.join(";")}m`,
16
+ close: `\x1b[${close}m`,
17
+ regexp: new RegExp(`\\x1b\\[${close}m`, "g"),
18
+ };
19
+ }
20
+ function run(str, code) {
21
+ return enabled
22
+ ? `${code.open}${str.replace(code.regexp, code.open)}${code.close}`
23
+ : str;
24
+ }
25
+ /**
26
+ * Sets the style of text to be printed to bold.
27
+ *
28
+ * Disable by setting the `NO_COLOR` environmental variable.
29
+ *
30
+ * @param str Text to make bold
31
+ *
32
+ * @returns Bold text for printing
33
+ *
34
+ * @example Usage
35
+ * ```ts no-assert
36
+ * import { bold } from "@std/internal/styles";
37
+ *
38
+ * console.log(bold("Hello, world!")); // Prints "Hello, world!" in bold
39
+ * ```
40
+ */
41
+ export function bold(str) {
42
+ return run(str, code([1], 22));
43
+ }
44
+ /**
45
+ * Sets the color of text to be printed to red.
46
+ *
47
+ * Disable by setting the `NO_COLOR` environmental variable.
48
+ *
49
+ * @param str Text to make red
50
+ *
51
+ * @returns Red text for printing
52
+ *
53
+ * @example Usage
54
+ * ```ts no-assert
55
+ * import { red } from "@std/internal/styles";
56
+ *
57
+ * console.log(red("Hello, world!")); // Prints "Hello, world!" in red
58
+ * ```
59
+ */
60
+ export function red(str) {
61
+ return run(str, code([31], 39));
62
+ }
63
+ /**
64
+ * Sets the color of text to be printed to green.
65
+ *
66
+ * Disable by setting the `NO_COLOR` environmental variable.
67
+ *
68
+ * @param str Text to make green
69
+ *
70
+ * @returns Green text for print
71
+ *
72
+ * @example Usage
73
+ * ```ts no-assert
74
+ * import { green } from "@std/internal/styles";
75
+ *
76
+ * console.log(green("Hello, world!")); // Prints "Hello, world!" in green
77
+ * ```
78
+ */
79
+ export function green(str) {
80
+ return run(str, code([32], 39));
81
+ }
82
+ /**
83
+ * Sets the color of text to be printed to yellow.
84
+ *
85
+ * Disable by setting the `NO_COLOR` environmental variable.
86
+ *
87
+ * @param str Text to make yellow
88
+ *
89
+ * @returns Yellow text for print
90
+ *
91
+ * @example Usage
92
+ * ```ts no-assert
93
+ * import { yellow } from "@std/internal/styles";
94
+ *
95
+ * console.log(yellow("Hello, world!")); // Prints "Hello, world!" in yellow
96
+ * ```
97
+ */
98
+ export function yellow(str) {
99
+ return run(str, code([33], 39));
100
+ }
101
+ /**
102
+ * Sets the color of text to be printed to white.
103
+ *
104
+ * @param str Text to make white
105
+ *
106
+ * @returns White text for print
107
+ *
108
+ * @example Usage
109
+ * ```ts no-assert
110
+ * import { white } from "@std/internal/styles";
111
+ *
112
+ * console.log(white("Hello, world!")); // Prints "Hello, world!" in white
113
+ * ```
114
+ */
115
+ export function white(str) {
116
+ return run(str, code([37], 39));
117
+ }
118
+ /**
119
+ * Sets the color of text to be printed to gray.
120
+ *
121
+ * @param str Text to make gray
122
+ *
123
+ * @returns Gray text for print
124
+ *
125
+ * @example Usage
126
+ * ```ts no-assert
127
+ * import { gray } from "@std/internal/styles";
128
+ *
129
+ * console.log(gray("Hello, world!")); // Prints "Hello, world!" in gray
130
+ * ```
131
+ */
132
+ export function gray(str) {
133
+ return brightBlack(str);
134
+ }
135
+ /**
136
+ * Sets the color of text to be printed to bright-black.
137
+ *
138
+ * @param str Text to make bright-black
139
+ *
140
+ * @returns Bright-black text for print
141
+ *
142
+ * @example Usage
143
+ * ```ts no-assert
144
+ * import { brightBlack } from "@std/internal/styles";
145
+ *
146
+ * console.log(brightBlack("Hello, world!")); // Prints "Hello, world!" in bright-black
147
+ * ```
148
+ */
149
+ export function brightBlack(str) {
150
+ return run(str, code([90], 39));
151
+ }
152
+ /**
153
+ * Sets the background color of text to be printed to red.
154
+ *
155
+ * @param str Text to make its background red
156
+ *
157
+ * @returns Red background text for print
158
+ *
159
+ * @example Usage
160
+ * ```ts no-assert
161
+ * import { bgRed } from "@std/internal/styles";
162
+ *
163
+ * console.log(bgRed("Hello, world!")); // Prints "Hello, world!" with red background
164
+ * ```
165
+ */
166
+ export function bgRed(str) {
167
+ return run(str, code([41], 49));
168
+ }
169
+ /**
170
+ * Sets the background color of text to be printed to green.
171
+ *
172
+ * @param str Text to make its background green
173
+ *
174
+ * @returns Green background text for print
175
+ *
176
+ * @example Usage
177
+ * ```ts no-assert
178
+ * import { bgGreen } from "@std/internal/styles";
179
+ *
180
+ * console.log(bgGreen("Hello, world!")); // Prints "Hello, world!" with green background
181
+ * ```
182
+ */
183
+ export function bgGreen(str) {
184
+ return run(str, code([42], 49));
185
+ }
186
+ // https://github.com/chalk/ansi-regex/blob/02fa893d619d3da85411acc8fd4e2eea0e95a9d9/index.js
187
+ const ANSI_PATTERN = new RegExp([
188
+ "[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)",
189
+ "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TXZcf-nq-uy=><~]))",
190
+ ].join("|"), "g");
191
+ /**
192
+ * Remove ANSI escape codes from the string.
193
+ *
194
+ * @param string Text to remove ANSI escape codes from
195
+ *
196
+ * @returns Text without ANSI escape codes
197
+ *
198
+ * @example Usage
199
+ * ```ts no-assert
200
+ * import { red, stripAnsiCode } from "@std/internal/styles";
201
+ *
202
+ * console.log(stripAnsiCode(red("Hello, world!"))); // Prints "Hello, world!"
203
+ * ```
204
+ */
205
+ export function stripAnsiCode(string) {
206
+ return string.replace(ANSI_PATTERN, "");
207
+ }
@@ -0,0 +1,16 @@
1
+ /** Ways that lines in a diff can be different. */
2
+ export type DiffType = "removed" | "common" | "added";
3
+ /**
4
+ * Represents the result of a diff operation.
5
+ *
6
+ * @typeParam T The type of the value in the diff result.
7
+ */
8
+ export interface DiffResult<T> {
9
+ /** The type of the diff. */
10
+ type: DiffType;
11
+ /** The value of the diff. */
12
+ value: T;
13
+ /** The details of the diff. */
14
+ details?: DiffResult<T>[];
15
+ }
16
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/internal/1.0.6/types.ts"],"names":[],"mappings":"AAGA,kDAAkD;AAClD,MAAM,MAAM,QAAQ,GAAG,SAAS,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEtD;;;;GAIG;AACH,MAAM,WAAW,UAAU,CAAC,CAAC;IAC3B,4BAA4B;IAC5B,IAAI,EAAE,QAAQ,CAAC;IACf,6BAA6B;IAC7B,KAAK,EAAE,CAAC,CAAC;IACT,+BAA+B;IAC/B,OAAO,CAAC,EAAE,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC;CAC3B"}
@@ -0,0 +1,3 @@
1
+ // Copyright 2018-2025 the Deno authors. MIT license.
2
+ // This module is browser compatible.
3
+ export {};
package/esm/mod.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export * from "./worker.js";
2
+ //# sourceMappingURL=mod.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../src/mod.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC"}
package/esm/mod.js ADDED
@@ -0,0 +1 @@
1
+ export * from "./worker.js";
@@ -0,0 +1,3 @@
1
+ {
2
+ "type": "module"
3
+ }
@@ -0,0 +1,135 @@
1
+ import { type Operation } from "effection";
2
+ export interface WorkerResource<TSend, TRecv, TReturn> extends Operation<TReturn> {
3
+ send(data: TSend): Operation<TRecv>;
4
+ }
5
+ /**
6
+ * Object that represents messages the main thread
7
+ * sends to the worker. It provides function for
8
+ * handling messages.
9
+ *
10
+ * @template TSend - value main thread will send to the worker
11
+ * @template TRecv - value main thread will receive from the worker
12
+ */
13
+ export interface WorkerMessages<TSend, TRecv> {
14
+ forEach(fn: (message: TSend) => Operation<TRecv>): Operation<void>;
15
+ }
16
+ /**
17
+ * Argument received by workerMain function
18
+ *
19
+ * @template TSend - value main thread will send to the worker
20
+ * @template TRecv - value main thread will receive from the worker
21
+ * @template TData - data passed from the main thread to the worker during initialization
22
+ */
23
+ export interface WorkerMainOptions<TSend, TRecv, TData> {
24
+ /**
25
+ * Namespace that provides APIs for working with incoming messages
26
+ */
27
+ messages: WorkerMessages<TSend, TRecv>;
28
+ /**
29
+ * Initial data received by the worker from the main thread used for initialization.
30
+ */
31
+ data: TData;
32
+ }
33
+ /**
34
+ * Entrypoint used in the worker that estaliblishes communication
35
+ * with the main thread. It can be used to return a value,
36
+ * respond to messages or both.
37
+ *
38
+ * @example Returning a value
39
+ * ```ts
40
+ * import { workerMain } from "../worker.ts";
41
+ *
42
+ * await workerMain(function* ({ data }) {
43
+ * return data;
44
+ * });
45
+ * ```
46
+ *
47
+ * @example Responding to messages
48
+ * ```ts
49
+ * import { workerMain } from "../worker.ts";
50
+ *
51
+ * await workerMain(function* ({ messages }) {
52
+ * yield* messages.forEach(function* (message) {
53
+ * return message;
54
+ * });
55
+ * });
56
+ * ```
57
+ *
58
+ * @example Responding to messages and return a value
59
+ * ```ts
60
+ * import { workerMain } from "../worker.ts";
61
+ *
62
+ * await workerMain<number, number, number, number>(
63
+ * function* ({ messages, data: initial }) {
64
+ * let counter = initial;
65
+ *
66
+ * yield* messages.forEach(function* (message) {
67
+ * counter += message;
68
+ * return counter; // returns a value after each message
69
+ * });
70
+ *
71
+ * return counter; // returns the final value
72
+ * },
73
+ * );
74
+ * ```
75
+ *
76
+ * @template TSend - value main thread will send to the worker
77
+ * @template TRecv - value main thread will receive from the worker
78
+ * @template TReturn - worker operation return value
79
+ * @template TData - data passed from the main thread to the worker during initialization
80
+ * @param {(options: WorkerMainOptions<TSend, TRecv, TData>) => Operation<TReturn>} body
81
+ * @returns {Promise<void>}
82
+ */
83
+ export declare function workerMain<TSend, TRecv, TReturn, TData>(body: (options: WorkerMainOptions<TSend, TRecv, TData>) => Operation<TReturn>): Promise<void>;
84
+ /**
85
+ * Use on the main thread to create and exeecute a well behaved web worker.
86
+ *
87
+ * @example Compute a single value
88
+ * ```ts
89
+ * import { run } from "effection";
90
+ * import { useWorker } from "@effectionx/worker"
91
+ *
92
+ * await run(function*() {
93
+ * const worker = yield* useWorker("script.ts", { type: "module" });
94
+ *
95
+ * try {
96
+ * const result = yield* worker;
97
+ * } catch (e) {
98
+ * console.error(e);
99
+ * }
100
+ * });
101
+ * ```
102
+ *
103
+ * @example Compute multipe values
104
+ * ```ts
105
+ * import { run } from "effection";
106
+ * import { useWorker } from "@effectionx/worker"
107
+ *
108
+ * await run(function*() {
109
+ * const worker = yield* useWorker("script.ts", { type: "module" });
110
+ *
111
+ * try {
112
+ * const result1 = yield* worker.send("Tom");
113
+ * const result2 = yield* worker.send("Dick");
114
+ * const result2 = yield* worker.send("Harry");
115
+ *
116
+ * // get the last result
117
+ * const finalResult = yield* worker;
118
+ * } catch (e) {
119
+ * console.error(e);
120
+ * }
121
+ * });
122
+ * ```
123
+ *
124
+ * @param url URL or string of script
125
+ * @param options WorkerOptions
126
+ * @template TSend - value main thread will send to the worker
127
+ * @template TRecv - value main thread will receive from the worker
128
+ * @template TReturn - worker operation return value
129
+ * @template TData - data passed from the main thread to the worker during initialization
130
+ * @returns {Operation<WorkerResource<TSend, TRecv>>}
131
+ */
132
+ export declare function useWorker<TSend, TRecv, TReturn, TData>(url: string | URL, options?: WorkerOptions & {
133
+ data?: TData;
134
+ }): Operation<WorkerResource<TSend, TRecv, TReturn>>;
135
+ //# sourceMappingURL=worker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"worker.d.ts","sourceRoot":"","sources":["../src/worker.ts"],"names":[],"mappings":"AACA,OAAO,EAQL,KAAK,SAAS,EAMf,MAAM,WAAW,CAAC;AAEnB,MAAM,WAAW,cAAc,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,CACnD,SAAQ,SAAS,CAAC,OAAO,CAAC;IAC1B,IAAI,CAAC,IAAI,EAAE,KAAK,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC;CACrC;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,cAAc,CAAC,KAAK,EAAE,KAAK;IAC1C,OAAO,CAAC,EAAE,EAAE,CAAC,OAAO,EAAE,KAAK,KAAK,SAAS,CAAC,KAAK,CAAC,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;CACpE;AAED;;;;;;GAMG;AACH,MAAM,WAAW,iBAAiB,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK;IACpD;;OAEG;IACH,QAAQ,EAAE,cAAc,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IACvC;;OAEG;IACH,IAAI,EAAE,KAAK,CAAC;CACb;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AACH,wBAAsB,UAAU,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAC3D,IAAI,EAAE,CAAC,OAAO,EAAE,iBAAiB,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,SAAS,CAAC,OAAO,CAAC,GAC5E,OAAO,CAAC,IAAI,CAAC,CAsDf;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EACpD,GAAG,EAAE,MAAM,GAAG,GAAG,EACjB,OAAO,CAAC,EAAE,aAAa,GAAG;IAAE,IAAI,CAAC,EAAE,KAAK,CAAA;CAAE,GACzC,SAAS,CAAC,cAAc,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC,CAgElD"}