@augment-vir/common 29.3.0 → 30.0.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 (296) hide show
  1. package/LICENSE-CC0 +121 -0
  2. package/LICENSE-MIT +21 -0
  3. package/README.md +7 -3
  4. package/dist/augments/array/array-map.d.ts +34 -0
  5. package/dist/augments/array/array-map.js +32 -0
  6. package/dist/augments/array/array-to-object.d.ts +53 -0
  7. package/dist/augments/array/array-to-object.js +67 -0
  8. package/dist/augments/array/awaited/awaited-filter.d.ts +36 -0
  9. package/dist/augments/array/awaited/awaited-filter.js +36 -0
  10. package/dist/augments/array/awaited/awaited-for-each.d.ts +31 -0
  11. package/dist/augments/array/awaited/awaited-for-each.js +34 -0
  12. package/dist/augments/array/awaited/awaited-map.d.ts +33 -0
  13. package/dist/augments/array/awaited/awaited-map.js +40 -0
  14. package/dist/augments/array/filter.d.ts +32 -0
  15. package/dist/augments/array/filter.js +74 -0
  16. package/dist/augments/array/remove-duplicates.d.ts +60 -0
  17. package/dist/augments/array/remove-duplicates.js +72 -0
  18. package/dist/augments/array/repeat-array.d.ts +23 -0
  19. package/dist/augments/array/repeat-array.js +25 -0
  20. package/dist/augments/array/shuffle-array.d.ts +9 -0
  21. package/dist/augments/array/shuffle-array.js +17 -0
  22. package/dist/augments/array/string-array.d.ts +9 -0
  23. package/dist/augments/array/string-array.js +11 -0
  24. package/dist/augments/core-exports.d.ts +1 -0
  25. package/dist/augments/core-exports.js +1 -0
  26. package/dist/augments/enum/enum-value-check.d.ts +32 -0
  27. package/dist/augments/enum/enum-value-check.js +34 -0
  28. package/dist/augments/error/combine-errors.d.ts +24 -0
  29. package/dist/augments/error/combine-errors.js +34 -0
  30. package/dist/augments/function/call-asynchronously.d.ts +25 -0
  31. package/dist/augments/function/call-asynchronously.js +26 -0
  32. package/dist/augments/function/call-with-retries.d.ts +24 -0
  33. package/dist/augments/function/call-with-retries.js +50 -0
  34. package/dist/augments/function/debounce.d.ts +89 -0
  35. package/dist/augments/function/debounce.js +112 -0
  36. package/dist/augments/function/execution-duration.d.ts +20 -0
  37. package/dist/augments/function/execution-duration.js +39 -0
  38. package/dist/augments/function/if-truthy.d.ts +28 -0
  39. package/dist/augments/function/if-truthy.js +35 -0
  40. package/dist/{types/augments → augments/function}/wrap-in-try.d.ts +14 -7
  41. package/dist/augments/function/wrap-in-try.js +98 -0
  42. package/dist/augments/json/append-json.d.ts +5 -0
  43. package/dist/augments/json/append-json.js +59 -0
  44. package/dist/augments/json/copy-through-json.d.ts +34 -0
  45. package/dist/augments/json/copy-through-json.js +42 -0
  46. package/dist/augments/json/json-compatible.d.ts +50 -0
  47. package/dist/augments/json/jsonify.d.ts +31 -0
  48. package/dist/augments/json/jsonify.js +33 -0
  49. package/dist/augments/log/log-colors.d.ts +64 -0
  50. package/dist/augments/log/log-colors.js +157 -0
  51. package/dist/augments/log/log-string.d.ts +35 -0
  52. package/dist/augments/log/log-string.js +73 -0
  53. package/dist/augments/log/log-writer.d.ts +30 -0
  54. package/dist/augments/log/log.d.ts +56 -0
  55. package/dist/augments/log/log.js +85 -0
  56. package/dist/augments/log/logger.d.ts +60 -0
  57. package/dist/augments/log/logger.js +59 -0
  58. package/dist/augments/number/clamp.d.ts +18 -0
  59. package/dist/augments/number/clamp.js +19 -0
  60. package/dist/augments/number/coords.d.ts +23 -0
  61. package/dist/augments/number/digit.d.ts +8 -0
  62. package/dist/augments/number/dimensions.d.ts +23 -0
  63. package/dist/augments/number/min-max.d.ts +18 -0
  64. package/dist/augments/number/min-max.js +16 -0
  65. package/dist/augments/number/number-conversion.d.ts +29 -0
  66. package/dist/augments/number/number-conversion.js +56 -0
  67. package/dist/augments/number/round.d.ts +22 -0
  68. package/dist/augments/number/round.js +24 -0
  69. package/dist/augments/number/scientific.d.ts +18 -0
  70. package/dist/augments/number/scientific.js +20 -0
  71. package/dist/augments/number/truncate-number.d.ts +40 -0
  72. package/dist/{esm/augments → augments/number}/truncate-number.js +39 -17
  73. package/dist/augments/number/wrap-number.d.ts +19 -0
  74. package/dist/augments/number/wrap-number.js +28 -0
  75. package/dist/augments/object/diff.d.ts +51 -0
  76. package/dist/augments/object/diff.js +149 -0
  77. package/dist/augments/object/empty.d.ts +9 -0
  78. package/dist/augments/object/get-or-set.d.ts +10 -0
  79. package/dist/augments/object/get-or-set.js +100 -0
  80. package/dist/augments/object/key-count.d.ts +21 -0
  81. package/dist/augments/object/map-entries.d.ts +13 -0
  82. package/dist/augments/object/map-entries.js +80 -0
  83. package/dist/augments/object/map-enum.d.ts +11 -0
  84. package/dist/augments/object/map-enum.js +45 -0
  85. package/dist/augments/object/map-values.d.ts +35 -0
  86. package/dist/augments/object/map-values.js +65 -0
  87. package/dist/{types/augments → augments}/object/merge-deep.d.ts +4 -0
  88. package/dist/{esm/augments → augments}/object/merge-deep.js +9 -6
  89. package/dist/augments/object/merge-defined-properties.d.ts +19 -0
  90. package/dist/augments/object/merge-defined-properties.js +32 -0
  91. package/dist/augments/object/merge-property-arrays.d.ts +29 -0
  92. package/dist/augments/object/merge-property-arrays.js +39 -0
  93. package/dist/augments/object/object-entries.d.ts +31 -0
  94. package/dist/augments/object/object-entries.js +40 -0
  95. package/dist/augments/object/object-filter.d.ts +22 -0
  96. package/dist/augments/object/object-filter.js +27 -0
  97. package/dist/augments/object/object-keys.d.ts +34 -0
  98. package/dist/augments/object/object-keys.js +43 -0
  99. package/dist/augments/object/object-values.d.ts +11 -0
  100. package/dist/augments/object/object-values.js +13 -0
  101. package/dist/augments/path/esm-path.d.ts +26 -0
  102. package/dist/augments/path/esm-path.js +31 -0
  103. package/dist/augments/prisma/prisma-models.d.ts +143 -0
  104. package/dist/augments/prisma/prisma-models.js +1 -0
  105. package/dist/augments/promise/timed-promise.d.ts +22 -0
  106. package/dist/augments/promise/timed-promise.js +51 -0
  107. package/dist/augments/random/random-boolean.d.ts +24 -0
  108. package/dist/augments/random/random-boolean.js +32 -0
  109. package/dist/augments/random/random-integer.d.ts +14 -0
  110. package/dist/augments/random/random-integer.js +34 -0
  111. package/dist/augments/random/random-string.d.ts +18 -0
  112. package/dist/augments/random/random-string.js +67 -0
  113. package/dist/augments/regexp/match.d.ts +10 -0
  114. package/dist/augments/regexp/match.js +13 -0
  115. package/dist/augments/regexp/regexp-flags.d.ts +56 -0
  116. package/dist/augments/regexp/regexp-flags.js +75 -0
  117. package/dist/augments/regexp/regexp-string.d.ts +9 -0
  118. package/dist/augments/regexp/regexp-string.js +11 -0
  119. package/dist/augments/selection-set/select-collapsed.d.ts +54 -0
  120. package/dist/augments/selection-set/select-collapsed.js +63 -0
  121. package/dist/augments/selection-set/select-from.d.ts +48 -0
  122. package/dist/augments/selection-set/select-from.js +72 -0
  123. package/dist/augments/selection-set/selection-set.d.ts +37 -0
  124. package/dist/augments/selection-set/selection-set.js +1 -0
  125. package/dist/augments/string/casing/capitalization.d.ts +17 -0
  126. package/dist/augments/string/casing/capitalization.js +25 -0
  127. package/dist/augments/string/casing/casing.d.ts +73 -0
  128. package/dist/augments/string/casing/casing.js +65 -0
  129. package/dist/augments/string/casing/kebab-and-camel.d.ts +17 -0
  130. package/dist/augments/string/casing/kebab-and-camel.js +57 -0
  131. package/dist/augments/string/comma.d.ts +26 -0
  132. package/dist/augments/string/comma.js +48 -0
  133. package/dist/augments/string/join.d.ts +21 -0
  134. package/dist/augments/string/join.js +34 -0
  135. package/dist/augments/string/prefix.d.ts +30 -0
  136. package/dist/augments/string/prefix.js +30 -0
  137. package/dist/augments/string/remove-duplicate-characters.d.ts +17 -0
  138. package/dist/augments/string/remove-duplicate-characters.js +22 -0
  139. package/dist/augments/string/replace.d.ts +18 -0
  140. package/dist/augments/string/replace.js +22 -0
  141. package/dist/augments/string/split.d.ts +31 -0
  142. package/dist/augments/string/split.js +53 -0
  143. package/dist/augments/string/substring-index.d.ts +19 -0
  144. package/dist/augments/string/substring-index.js +47 -0
  145. package/dist/augments/string/suffix.d.ts +96 -0
  146. package/dist/augments/string/suffix.js +89 -0
  147. package/dist/augments/string/white-space.d.ts +12 -0
  148. package/dist/augments/string/white-space.js +19 -0
  149. package/dist/augments/string/wrap-string.d.ts +19 -0
  150. package/dist/augments/string/wrap-string.js +20 -0
  151. package/dist/augments/type/ensure-type.d.ts +12 -0
  152. package/dist/augments/type/ensure-type.js +14 -0
  153. package/dist/augments/type/readonly.d.ts +9 -0
  154. package/dist/augments/type/readonly.js +10 -0
  155. package/dist/augments/type/type-recursion.d.ts +253 -0
  156. package/dist/augments/type/type-recursion.js +1 -0
  157. package/dist/augments/type/union.d.ts +1 -0
  158. package/dist/augments/type/union.js +1 -0
  159. package/dist/augments/type/void-type.d.ts +9 -0
  160. package/dist/augments/type/void-type.js +1 -0
  161. package/dist/augments/type/writable.d.ts +10 -0
  162. package/dist/augments/type/writable.js +10 -0
  163. package/dist/index.d.ts +83 -0
  164. package/dist/index.js +83 -0
  165. package/package.json +43 -15
  166. package/dist/cjs/augments/ansi.js +0 -27
  167. package/dist/cjs/augments/array/array.js +0 -68
  168. package/dist/cjs/augments/array/remove-duplicates.js +0 -16
  169. package/dist/cjs/augments/async.js +0 -28
  170. package/dist/cjs/augments/boolean.js +0 -19
  171. package/dist/cjs/augments/common-number.js +0 -112
  172. package/dist/cjs/augments/common-string.js +0 -245
  173. package/dist/cjs/augments/debounce.js +0 -38
  174. package/dist/cjs/augments/environment.js +0 -6
  175. package/dist/cjs/augments/error.js +0 -52
  176. package/dist/cjs/augments/esm-path.js +0 -11
  177. package/dist/cjs/augments/function.js +0 -2
  178. package/dist/cjs/augments/json-compatible.js +0 -2
  179. package/dist/cjs/augments/json.js +0 -28
  180. package/dist/cjs/augments/object/any-object.js +0 -2
  181. package/dist/cjs/augments/object/enum.js +0 -48
  182. package/dist/cjs/augments/object/filter-object.js +0 -26
  183. package/dist/cjs/augments/object/get-or-set.js +0 -40
  184. package/dist/cjs/augments/object/has-key.js +0 -6
  185. package/dist/cjs/augments/object/jsonify.js +0 -6
  186. package/dist/cjs/augments/object/key-count.js +0 -2
  187. package/dist/cjs/augments/object/map-object.js +0 -61
  188. package/dist/cjs/augments/object/merge-deep.js +0 -52
  189. package/dist/cjs/augments/object/merge-property-arrays.js +0 -14
  190. package/dist/cjs/augments/object/object-entries.js +0 -40
  191. package/dist/cjs/augments/object/object.js +0 -18
  192. package/dist/cjs/augments/object/pick-deep.js +0 -2
  193. package/dist/cjs/augments/object/selection-set.js +0 -56
  194. package/dist/cjs/augments/object/typed-has-property.js +0 -29
  195. package/dist/cjs/augments/promise/deferred-promise.js +0 -31
  196. package/dist/cjs/augments/promise/promise.js +0 -79
  197. package/dist/cjs/augments/promise/wait.js +0 -66
  198. package/dist/cjs/augments/random.js +0 -118
  199. package/dist/cjs/augments/regexp.js +0 -19
  200. package/dist/cjs/augments/string/prefixes.js +0 -20
  201. package/dist/cjs/augments/string/suffixes.js +0 -40
  202. package/dist/cjs/augments/string/uuid.js +0 -13
  203. package/dist/cjs/augments/time.js +0 -35
  204. package/dist/cjs/augments/truncate-number.js +0 -153
  205. package/dist/cjs/augments/tuple.js +0 -20
  206. package/dist/cjs/augments/type-recursion.js +0 -2
  207. package/dist/cjs/augments/type.js +0 -36
  208. package/dist/cjs/augments/union.js +0 -2
  209. package/dist/cjs/augments/wrap-in-try.js +0 -37
  210. package/dist/cjs/index.js +0 -60
  211. package/dist/esm/augments/ansi.js +0 -24
  212. package/dist/esm/augments/array/array.js +0 -57
  213. package/dist/esm/augments/array/remove-duplicates.js +0 -13
  214. package/dist/esm/augments/async.js +0 -23
  215. package/dist/esm/augments/boolean.js +0 -14
  216. package/dist/esm/augments/common-number.js +0 -100
  217. package/dist/esm/augments/common-string.js +0 -227
  218. package/dist/esm/augments/debounce.js +0 -34
  219. package/dist/esm/augments/environment.js +0 -3
  220. package/dist/esm/augments/error.js +0 -45
  221. package/dist/esm/augments/esm-path.js +0 -8
  222. package/dist/esm/augments/json.js +0 -24
  223. package/dist/esm/augments/object/enum.js +0 -41
  224. package/dist/esm/augments/object/filter-object.js +0 -21
  225. package/dist/esm/augments/object/get-or-set.js +0 -36
  226. package/dist/esm/augments/object/has-key.js +0 -3
  227. package/dist/esm/augments/object/jsonify.js +0 -3
  228. package/dist/esm/augments/object/map-object.js +0 -57
  229. package/dist/esm/augments/object/merge-property-arrays.js +0 -11
  230. package/dist/esm/augments/object/object-entries.js +0 -32
  231. package/dist/esm/augments/object/object.js +0 -14
  232. package/dist/esm/augments/object/selection-set.js +0 -52
  233. package/dist/esm/augments/object/typed-has-property.js +0 -25
  234. package/dist/esm/augments/promise/deferred-promise.js +0 -28
  235. package/dist/esm/augments/promise/promise.js +0 -71
  236. package/dist/esm/augments/promise/wait.js +0 -60
  237. package/dist/esm/augments/random.js +0 -113
  238. package/dist/esm/augments/regexp.js +0 -14
  239. package/dist/esm/augments/string/prefixes.js +0 -16
  240. package/dist/esm/augments/string/suffixes.js +0 -31
  241. package/dist/esm/augments/string/uuid.js +0 -9
  242. package/dist/esm/augments/time.js +0 -31
  243. package/dist/esm/augments/tuple.js +0 -16
  244. package/dist/esm/augments/type.js +0 -30
  245. package/dist/esm/augments/wrap-in-try.js +0 -34
  246. package/dist/esm/index.js +0 -44
  247. package/dist/types/augments/ansi.d.ts +0 -1
  248. package/dist/types/augments/array/array.d.ts +0 -26
  249. package/dist/types/augments/array/remove-duplicates.d.ts +0 -1
  250. package/dist/types/augments/async.d.ts +0 -14
  251. package/dist/types/augments/boolean.d.ts +0 -6
  252. package/dist/types/augments/common-number.d.ts +0 -52
  253. package/dist/types/augments/common-string.d.ts +0 -74
  254. package/dist/types/augments/debounce.d.ts +0 -15
  255. package/dist/types/augments/environment.d.ts +0 -1
  256. package/dist/types/augments/error.d.ts +0 -9
  257. package/dist/types/augments/esm-path.d.ts +0 -4
  258. package/dist/types/augments/function.d.ts +0 -25
  259. package/dist/types/augments/json-compatible.d.ts +0 -22
  260. package/dist/types/augments/json.d.ts +0 -9
  261. package/dist/types/augments/object/any-object.d.ts +0 -2
  262. package/dist/types/augments/object/enum.d.ts +0 -8
  263. package/dist/types/augments/object/filter-object.d.ts +0 -4
  264. package/dist/types/augments/object/get-or-set.d.ts +0 -26
  265. package/dist/types/augments/object/has-key.d.ts +0 -1
  266. package/dist/types/augments/object/jsonify.d.ts +0 -2
  267. package/dist/types/augments/object/key-count.d.ts +0 -13
  268. package/dist/types/augments/object/map-object.d.ts +0 -20
  269. package/dist/types/augments/object/merge-property-arrays.d.ts +0 -1
  270. package/dist/types/augments/object/object-entries.d.ts +0 -8
  271. package/dist/types/augments/object/object.d.ts +0 -21
  272. package/dist/types/augments/object/pick-deep.d.ts +0 -14
  273. package/dist/types/augments/object/selection-set.d.ts +0 -27
  274. package/dist/types/augments/object/typed-has-property.d.ts +0 -7
  275. package/dist/types/augments/promise/deferred-promise.d.ts +0 -8
  276. package/dist/types/augments/promise/promise.d.ts +0 -15
  277. package/dist/types/augments/promise/wait.d.ts +0 -18
  278. package/dist/types/augments/random.d.ts +0 -37
  279. package/dist/types/augments/regexp.d.ts +0 -3
  280. package/dist/types/augments/string/prefixes.d.ts +0 -9
  281. package/dist/types/augments/string/suffixes.d.ts +0 -17
  282. package/dist/types/augments/string/uuid.d.ts +0 -5
  283. package/dist/types/augments/time.d.ts +0 -14
  284. package/dist/types/augments/truncate-number.d.ts +0 -19
  285. package/dist/types/augments/tuple.d.ts +0 -17
  286. package/dist/types/augments/type-recursion.d.ts +0 -161
  287. package/dist/types/augments/type.d.ts +0 -69
  288. package/dist/types/augments/union.d.ts +0 -5
  289. package/dist/types/index.d.ts +0 -44
  290. /package/dist/{esm/augments → augments/json}/json-compatible.js +0 -0
  291. /package/dist/{esm/augments/function.js → augments/log/log-writer.js} +0 -0
  292. /package/dist/{esm/augments/object/any-object.js → augments/number/coords.js} +0 -0
  293. /package/dist/{esm/augments/object/key-count.js → augments/number/digit.js} +0 -0
  294. /package/dist/{esm/augments/object/pick-deep.js → augments/number/dimensions.js} +0 -0
  295. /package/dist/{esm/augments/type-recursion.js → augments/object/empty.js} +0 -0
  296. /package/dist/{esm/augments/union.js → augments/object/key-count.js} +0 -0
package/dist/index.js ADDED
@@ -0,0 +1,83 @@
1
+ export * from './augments/array/array-map.js';
2
+ export * from './augments/array/array-to-object.js';
3
+ export * from './augments/array/awaited/awaited-filter.js';
4
+ export * from './augments/array/awaited/awaited-for-each.js';
5
+ export * from './augments/array/awaited/awaited-map.js';
6
+ export * from './augments/array/filter.js';
7
+ export * from './augments/array/remove-duplicates.js';
8
+ export * from './augments/array/repeat-array.js';
9
+ export * from './augments/array/shuffle-array.js';
10
+ export * from './augments/array/string-array.js';
11
+ export * from './augments/core-exports.js';
12
+ export * from './augments/enum/enum-value-check.js';
13
+ export * from './augments/error/combine-errors.js';
14
+ export * from './augments/function/call-asynchronously.js';
15
+ export * from './augments/function/call-with-retries.js';
16
+ export * from './augments/function/debounce.js';
17
+ export * from './augments/function/execution-duration.js';
18
+ export * from './augments/function/if-truthy.js';
19
+ export * from './augments/function/wrap-in-try.js';
20
+ export * from './augments/json/append-json.js';
21
+ export * from './augments/json/copy-through-json.js';
22
+ export * from './augments/json/json-compatible.js';
23
+ export * from './augments/json/jsonify.js';
24
+ export * from './augments/log/log-colors.js';
25
+ export * from './augments/log/log-string.js';
26
+ export * from './augments/log/log-writer.js';
27
+ export * from './augments/log/log.js';
28
+ export * from './augments/log/logger.js';
29
+ export * from './augments/number/clamp.js';
30
+ export * from './augments/number/coords.js';
31
+ export * from './augments/number/digit.js';
32
+ export * from './augments/number/dimensions.js';
33
+ export * from './augments/number/min-max.js';
34
+ export * from './augments/number/number-conversion.js';
35
+ export * from './augments/number/round.js';
36
+ export * from './augments/number/scientific.js';
37
+ export * from './augments/number/truncate-number.js';
38
+ export * from './augments/number/wrap-number.js';
39
+ export * from './augments/object/diff.js';
40
+ export * from './augments/object/empty.js';
41
+ export * from './augments/object/get-or-set.js';
42
+ export * from './augments/object/key-count.js';
43
+ export * from './augments/object/map-entries.js';
44
+ export * from './augments/object/map-enum.js';
45
+ export * from './augments/object/map-values.js';
46
+ export * from './augments/object/merge-deep.js';
47
+ export * from './augments/object/merge-defined-properties.js';
48
+ export * from './augments/object/merge-property-arrays.js';
49
+ export * from './augments/object/object-entries.js';
50
+ export * from './augments/object/object-filter.js';
51
+ export * from './augments/object/object-keys.js';
52
+ export * from './augments/object/object-values.js';
53
+ export * from './augments/path/esm-path.js';
54
+ export * from './augments/prisma/prisma-models.js';
55
+ export * from './augments/promise/timed-promise.js';
56
+ export * from './augments/random/random-boolean.js';
57
+ export * from './augments/random/random-integer.js';
58
+ export * from './augments/random/random-string.js';
59
+ export * from './augments/regexp/match.js';
60
+ export * from './augments/regexp/regexp-flags.js';
61
+ export * from './augments/regexp/regexp-string.js';
62
+ export * from './augments/selection-set/select-collapsed.js';
63
+ export * from './augments/selection-set/select-from.js';
64
+ export * from './augments/selection-set/selection-set.js';
65
+ export * from './augments/string/casing/capitalization.js';
66
+ export * from './augments/string/casing/casing.js';
67
+ export * from './augments/string/casing/kebab-and-camel.js';
68
+ export * from './augments/string/comma.js';
69
+ export * from './augments/string/join.js';
70
+ export * from './augments/string/prefix.js';
71
+ export * from './augments/string/remove-duplicate-characters.js';
72
+ export * from './augments/string/replace.js';
73
+ export * from './augments/string/split.js';
74
+ export * from './augments/string/substring-index.js';
75
+ export * from './augments/string/suffix.js';
76
+ export * from './augments/string/white-space.js';
77
+ export * from './augments/string/wrap-string.js';
78
+ export * from './augments/type/ensure-type.js';
79
+ export * from './augments/type/readonly.js';
80
+ export * from './augments/type/type-recursion.js';
81
+ export * from './augments/type/union.js';
82
+ export * from './augments/type/void-type.js';
83
+ export * from './augments/type/writable.js';
package/package.json CHANGED
@@ -1,35 +1,63 @@
1
1
  {
2
2
  "name": "@augment-vir/common",
3
- "version": "29.3.0",
4
- "homepage": "https://github.com/electrovir/augment-vir/tree/main/packages/common",
3
+ "version": "30.0.1",
4
+ "description": "A collection of augments, helpers types, functions, and classes for any JavaScript environment.",
5
+ "keywords": [
6
+ "augment",
7
+ "helper",
8
+ "util",
9
+ "node",
10
+ "browser",
11
+ "backend",
12
+ "frontend",
13
+ "vir",
14
+ "augment-vir"
15
+ ],
16
+ "homepage": "https://github.com/electrovir/augment-vir",
5
17
  "bugs": {
6
18
  "url": "https://github.com/electrovir/augment-vir/issues"
7
19
  },
8
20
  "repository": {
9
21
  "type": "git",
10
- "url": "https://github.com/electrovir/augment-vir"
22
+ "url": "git+https://github.com/electrovir/augment-vir.git"
11
23
  },
12
- "license": "MIT",
24
+ "license": "(MIT or CC0 1.0)",
13
25
  "author": {
14
26
  "name": "electrovir",
15
27
  "url": "https://github.com/electrovir"
16
28
  },
17
- "main": "dist/cjs/index.js",
18
- "module": "dist/esm/index.js",
19
- "types": "dist/types/index.d.ts",
29
+ "type": "module",
30
+ "main": "dist/index.js",
31
+ "module": "dist/index.js",
32
+ "types": "dist/index.d.ts",
20
33
  "scripts": {
21
- "compile": "rm -rf dist && tsc --project tsconfig.json && tsc --project tsconfig.cjs.json",
22
- "test": "echo \"use common-test to run tests\" && exit 0",
23
- "test:coverage": "npm test",
24
- "test:types": "tsc --noEmit"
34
+ "compile": "virmator compile",
35
+ "test": "concurrently --colors --kill-others-on-fail -c red,blue --names node,web \"npm run test:node\" \"npm run test:web\"",
36
+ "test:coverage": "virmator --no-deps test web coverage",
37
+ "test:node": "virmator --no-deps test node",
38
+ "test:update": "npm test",
39
+ "test:web": "virmator --no-deps test web"
25
40
  },
26
41
  "dependencies": {
27
- "browser-or-node": "^3.0.0",
28
- "run-time-assertions": "^1.5.1",
29
- "type-fest": "^4.21.0"
42
+ "@augment-vir/assert": "^30.0.1",
43
+ "@augment-vir/core": "^30.0.1",
44
+ "@date-vir/duration": "^6.0.0",
45
+ "ansi-styles": "^6.2.1",
46
+ "json5": "^2.2.3",
47
+ "type-fest": "^4.25.0"
30
48
  },
31
49
  "devDependencies": {
32
- "typescript": "5.5.2"
50
+ "@web/dev-server-esbuild": "^1.0.2",
51
+ "@web/test-runner": "^0.18.3",
52
+ "@web/test-runner-commands": "^0.9.0",
53
+ "@web/test-runner-playwright": "^0.11.0",
54
+ "@web/test-runner-visual-regression": "^0.9.0",
55
+ "concurrently": "^8.2.2",
56
+ "execute-in-browser": "^1.0.3",
57
+ "istanbul-smart-text-reporter": "^1.1.4"
58
+ },
59
+ "engines": {
60
+ "node": ">=22"
33
61
  },
34
62
  "publishConfig": {
35
63
  "access": "public"
@@ -1,27 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ansiRegex = void 0;
4
- // cspell:disable
5
- /*
6
- Copied from
7
- https://github.com/chalk/ansi-regex/blob/1b337add136eb520764634a328e2f6354398eee5/index.js
8
- because the published ansi-regex package exports this in a manner that Jest can't handle and the
9
- latest version of the package that doesn't do that has a security vulnerability. The package has
10
- the following license from
11
- https://github.com/chalk/ansi-regex/blob/1b337add136eb520764634a328e2f6354398eee5/license
12
-
13
- MIT License
14
- Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
15
-
16
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
17
-
18
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
19
-
20
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21
- */
22
- // cspell:enable
23
- const patterns = [
24
- '[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)',
25
- '(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))',
26
- ];
27
- exports.ansiRegex = new RegExp(patterns.join('|'), 'g');
@@ -1,68 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.filterOutIndexes = filterOutIndexes;
4
- exports.flatten2dArray = flatten2dArray;
5
- exports.trimArrayStrings = trimArrayStrings;
6
- exports.typedArrayIncludes = typedArrayIncludes;
7
- exports.typedMap = typedMap;
8
- exports.repeatArray = repeatArray;
9
- exports.groupArrayBy = groupArrayBy;
10
- exports.arrayToObject = arrayToObject;
11
- exports.filterMap = filterMap;
12
- const get_or_set_1 = require("../object/get-or-set");
13
- const object_entries_1 = require("../object/object-entries");
14
- function filterOutIndexes(array, indexes) {
15
- return array.filter((_, index) => !indexes.includes(index));
16
- }
17
- function flatten2dArray(array2d) {
18
- const flattened = array2d.reduce((accum, row) => accum.concat(row), []);
19
- return flattened;
20
- }
21
- function trimArrayStrings(input) {
22
- return input.map((line) => line.trim()).filter((line) => line !== '');
23
- }
24
- function typedArrayIncludes(array, input) {
25
- return array.includes(input);
26
- }
27
- /** Preserves tuple types. */
28
- function typedMap(arrayToMap, mapCallback) {
29
- return arrayToMap.map(mapCallback);
30
- }
31
- function repeatArray(repeatCount, array) {
32
- return Array.from({ length: repeatCount }, () => [...array]).flat();
33
- }
34
- /**
35
- * Polyfill for `Object.groupBy`:
36
- * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/groupBy
37
- */
38
- function groupArrayBy(inputArray, callback) {
39
- return inputArray.reduce((accum, entry, index, originalArray) => {
40
- const key = callback(entry, index, originalArray);
41
- const entryArray = (0, get_or_set_1.getOrSet)(accum, key, () => []);
42
- entryArray.push(entry);
43
- return accum;
44
- }, {});
45
- }
46
- /**
47
- * Like `groupArrayBy` but maps array entries to a single key. Meaning, the resulting object does
48
- * not have an array of elements (unless the original array itself contains arrays).
49
- */
50
- function arrayToObject(inputArray, callback) {
51
- return (0, object_entries_1.typedObjectFromEntries)(inputArray.map((entry, index, originalArray) => {
52
- const key = callback(entry, index, originalArray);
53
- return [
54
- key,
55
- entry,
56
- ];
57
- }));
58
- }
59
- function filterMap(inputArray, mapCallback, filterCallback) {
60
- return inputArray.reduce((accum, entry, index, originalArray) => {
61
- const mapOutput = mapCallback(entry, index, originalArray);
62
- const filterOutput = filterCallback(mapOutput, entry, index, originalArray);
63
- if (filterOutput) {
64
- accum.push(mapOutput);
65
- }
66
- return accum;
67
- }, []);
68
- }
@@ -1,16 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.removeDuplicates = removeDuplicates;
4
- function removeDuplicates(originalArray, calculateUniqueIdCallback) {
5
- const grouped = new Map();
6
- return originalArray.filter((entry) => {
7
- const uniqueId = calculateUniqueIdCallback(entry);
8
- if (grouped.get(uniqueId)) {
9
- return false;
10
- }
11
- else {
12
- grouped.set(uniqueId, entry);
13
- return true;
14
- }
15
- });
16
- }
@@ -1,28 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.awaitedForEach = awaitedForEach;
4
- exports.awaitedBlockingMap = awaitedBlockingMap;
5
- exports.awaitedFilter = awaitedFilter;
6
- /**
7
- * Acts like calling Array.prototype.forEach in that all elements are executed upon in order, and
8
- * each execution is blocking. Meaning, the callback won't be called on element 2 until the callback
9
- * has finished its call on element 1.
10
- */
11
- async function awaitedForEach(input, callback) {
12
- await awaitedBlockingMap(input, callback);
13
- }
14
- async function awaitedBlockingMap(input, callback) {
15
- const mappedValues = await input.reduce(async (accumPromise, currentElement, index, wholeArray) => {
16
- const accum = await accumPromise;
17
- const mappedValue = await callback(currentElement, index, wholeArray);
18
- accum.push(mappedValue);
19
- return accum;
20
- }, Promise.resolve([]));
21
- return mappedValues;
22
- }
23
- async function awaitedFilter(arrayInput, filterCallback, options) {
24
- const callbackResults = options?.blocking
25
- ? await awaitedBlockingMap(arrayInput, filterCallback)
26
- : await Promise.all(arrayInput.map(filterCallback));
27
- return arrayInput.filter((originalValue, index) => !!callbackResults[index]);
28
- }
@@ -1,19 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isTruthy = isTruthy;
4
- exports.isFalsy = isFalsy;
5
- exports.ifTruthy = ifTruthy;
6
- function isTruthy(input) {
7
- return !!input;
8
- }
9
- function isFalsy(input) {
10
- return !input;
11
- }
12
- function ifTruthy(checkThis, ifTruthyCallback, ifFalsyCallback) {
13
- if (isTruthy(checkThis)) {
14
- return ifTruthyCallback(checkThis);
15
- }
16
- else {
17
- return ifFalsyCallback(checkThis);
18
- }
19
- }
@@ -1,112 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.convertIntoNumber = exports.NaNString = void 0;
4
- exports.addCommasToNumber = addCommasToNumber;
5
- exports.doesRequireScientificNotation = doesRequireScientificNotation;
6
- exports.ensureMinAndMax = ensureMinAndMax;
7
- exports.toNumber = toNumber;
8
- exports.toEnsuredNumber = toEnsuredNumber;
9
- exports.toMaybeNumber = toMaybeNumber;
10
- exports.wrapNumber = wrapNumber;
11
- exports.round = round;
12
- exports.clamp = clamp;
13
- const common_string_1 = require("./common-string");
14
- const regexp_1 = require("./regexp");
15
- exports.NaNString = String(NaN);
16
- function addCommasToNumber(input) {
17
- if (typeof input === 'string' && isNaN(Number(input))) {
18
- return exports.NaNString;
19
- }
20
- const numericValue = Number(input);
21
- const isNegative = numericValue < 0;
22
- const stringValue = String(Math.abs(numericValue));
23
- const [digits, decimalValues,] = stringValue.split('.');
24
- const decimalString = decimalValues ? `.${decimalValues}` : '';
25
- const separated = (0, regexp_1.safeMatch)(digits.split('').reverse().join(''), /.{1,3}/g)
26
- .reverse()
27
- .map((entry) => entry.split('').reverse().join(''));
28
- const valueWithCommas = separated.join(',');
29
- const negativeMarker = isNegative ? '-' : '';
30
- return [
31
- negativeMarker,
32
- valueWithCommas,
33
- decimalString,
34
- ].join('');
35
- }
36
- function doesRequireScientificNotation(input) {
37
- return String(input).includes('e');
38
- }
39
- /**
40
- * Given a min and max, ensures that they are in correct order. Meaning, min is less than max. If
41
- * that is not the case, the returned value is the given min and max values swapped.
42
- */
43
- function ensureMinAndMax({ min, max }) {
44
- if (min > max) {
45
- return { min: max, max: min };
46
- }
47
- else {
48
- return { min, max };
49
- }
50
- }
51
- /**
52
- * Tries to convert the input into a number. Handles strings with commas. Note: this might return
53
- * `NaN`.
54
- */
55
- function toNumber(input) {
56
- if (typeof input === 'number') {
57
- return input;
58
- }
59
- else if (typeof input === 'string') {
60
- return Number((0, common_string_1.removeCommasFromNumberString)(input));
61
- }
62
- else {
63
- return Number(input);
64
- }
65
- }
66
- /** @deprecated Use {@link toNumber} instead. */
67
- exports.convertIntoNumber = toNumber;
68
- /** Tries to convert the input into a number and throws an error if `NaN` is created. */
69
- function toEnsuredNumber(input) {
70
- const numeric = toMaybeNumber(input);
71
- if (numeric == undefined) {
72
- throw new Error(`Cannot convert to a number: ${input}`);
73
- }
74
- else {
75
- return numeric;
76
- }
77
- }
78
- /** Tries to convert the input into a number and returns `undefined` if `NaN` is created. */
79
- function toMaybeNumber(input) {
80
- const numeric = toNumber(input);
81
- if (isNaN(numeric)) {
82
- return undefined;
83
- }
84
- else {
85
- return numeric;
86
- }
87
- }
88
- /**
89
- * If the given value is outside the given min/max bounds, instead of clamping the number (as the
90
- * `clamp` function does), this function wraps the value around to the next bound.
91
- *
92
- * @example
93
- * wrapNumber({min: 0, max: 100, value: 101}) == 0;
94
- */
95
- function wrapNumber({ max, min, value }) {
96
- if (value > max) {
97
- return min;
98
- }
99
- else if (value < min) {
100
- return max;
101
- }
102
- return value;
103
- }
104
- function round(inputs) {
105
- const digitFactor = Math.pow(10, inputs.digits);
106
- const multiplied = inputs.number * digitFactor;
107
- return Number((Math.round(multiplied) / digitFactor).toFixed(inputs.digits));
108
- }
109
- /** Clamp's the given value to within the min and max bounds, inclusive. */
110
- function clamp({ value, min, max }) {
111
- return Math.min(Math.max(value, min), max);
112
- }