@evolu/common 8.5.0 → 8.6.0

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 (328) hide show
  1. package/dist/src/Array.d.ts +170 -97
  2. package/dist/src/Array.d.ts.map +1 -1
  3. package/dist/src/Array.js +67 -42
  4. package/dist/src/Assert.d.ts +233 -30
  5. package/dist/src/Assert.d.ts.map +1 -1
  6. package/dist/src/Assert.js +150 -30
  7. package/dist/src/BigInt.d.ts +3 -3
  8. package/dist/src/BigInt.js +3 -3
  9. package/dist/src/Brand.d.ts +7 -7
  10. package/dist/src/Buffer.d.ts +12 -4
  11. package/dist/src/Buffer.d.ts.map +1 -1
  12. package/dist/src/Cache.d.ts +8 -3
  13. package/dist/src/Cache.d.ts.map +1 -1
  14. package/dist/src/Cache.js +8 -3
  15. package/dist/src/Callbacks.d.ts +8 -4
  16. package/dist/src/Callbacks.d.ts.map +1 -1
  17. package/dist/src/Console.d.ts +45 -30
  18. package/dist/src/Console.d.ts.map +1 -1
  19. package/dist/src/Console.js +32 -21
  20. package/dist/src/Crypto.d.ts +13 -8
  21. package/dist/src/Crypto.d.ts.map +1 -1
  22. package/dist/src/Crypto.js +6 -3
  23. package/dist/src/Eq.d.ts +107 -58
  24. package/dist/src/Eq.d.ts.map +1 -1
  25. package/dist/src/Eq.js +308 -112
  26. package/dist/src/Function.d.ts +54 -24
  27. package/dist/src/Function.d.ts.map +1 -1
  28. package/dist/src/Function.js +34 -17
  29. package/dist/src/Http.d.ts +52 -19
  30. package/dist/src/Http.d.ts.map +1 -1
  31. package/dist/src/Identicon.d.ts +9 -4
  32. package/dist/src/Identicon.d.ts.map +1 -1
  33. package/dist/src/Identicon.js +9 -4
  34. package/dist/src/LockManager.d.ts +12 -10
  35. package/dist/src/LockManager.d.ts.map +1 -1
  36. package/dist/src/Lookup.d.ts +4 -2
  37. package/dist/src/Lookup.d.ts.map +1 -1
  38. package/dist/src/Lookup.js +4 -2
  39. package/dist/src/Number.d.ts +28 -24
  40. package/dist/src/Number.d.ts.map +1 -1
  41. package/dist/src/Number.js +16 -17
  42. package/dist/src/Object.d.ts +89 -47
  43. package/dist/src/Object.d.ts.map +1 -1
  44. package/dist/src/Object.js +88 -41
  45. package/dist/src/Option.d.ts +14 -5
  46. package/dist/src/Option.d.ts.map +1 -1
  47. package/dist/src/Option.js +14 -5
  48. package/dist/src/Order.d.ts +12 -12
  49. package/dist/src/Order.js +12 -12
  50. package/dist/src/Platform.d.ts +2 -2
  51. package/dist/src/Random.d.ts +7 -4
  52. package/dist/src/Random.d.ts.map +1 -1
  53. package/dist/src/Redacted.d.ts +13 -6
  54. package/dist/src/Redacted.d.ts.map +1 -1
  55. package/dist/src/Redacted.js +4 -2
  56. package/dist/src/Ref.d.ts +4 -4
  57. package/dist/src/Relation.d.ts +5 -7
  58. package/dist/src/Relation.d.ts.map +1 -1
  59. package/dist/src/Resource.d.ts +27 -12
  60. package/dist/src/Resource.d.ts.map +1 -1
  61. package/dist/src/Result.d.ts +258 -114
  62. package/dist/src/Result.d.ts.map +1 -1
  63. package/dist/src/Result.js +71 -34
  64. package/dist/src/Schedule.d.ts +233 -116
  65. package/dist/src/Schedule.d.ts.map +1 -1
  66. package/dist/src/Schedule.js +204 -110
  67. package/dist/src/Set.d.ts +43 -24
  68. package/dist/src/Set.d.ts.map +1 -1
  69. package/dist/src/Set.js +25 -13
  70. package/dist/src/Sqlite.d.ts +4 -4
  71. package/dist/src/Sqlite.d.ts.map +1 -1
  72. package/dist/src/Sqlite.js +9 -8
  73. package/dist/src/Task.d.ts +441 -212
  74. package/dist/src/Task.d.ts.map +1 -1
  75. package/dist/src/Task.js +238 -115
  76. package/dist/src/Test.d.ts +10 -4
  77. package/dist/src/Test.d.ts.map +1 -1
  78. package/dist/src/Test.js +10 -4
  79. package/dist/src/Time.d.ts +27 -17
  80. package/dist/src/Time.d.ts.map +1 -1
  81. package/dist/src/Time.js +16 -6
  82. package/dist/src/Type.d.ts +1096 -387
  83. package/dist/src/Type.d.ts.map +1 -1
  84. package/dist/src/Type.js +1046 -372
  85. package/dist/src/Types.d.ts +95 -40
  86. package/dist/src/Types.d.ts.map +1 -1
  87. package/dist/src/Types.js +13 -4
  88. package/dist/src/WebSocket.d.ts +14 -6
  89. package/dist/src/WebSocket.d.ts.map +1 -1
  90. package/dist/src/Worker.d.ts +10 -6
  91. package/dist/src/Worker.d.ts.map +1 -1
  92. package/dist/src/intl/_en.d.ts +3 -1
  93. package/dist/src/intl/_en.d.ts.map +1 -1
  94. package/dist/src/intl/_en.js +17 -3
  95. package/dist/src/intl/ar.d.ts +3 -1
  96. package/dist/src/intl/ar.d.ts.map +1 -1
  97. package/dist/src/intl/ar.js +15 -2
  98. package/dist/src/intl/bn.d.ts +3 -1
  99. package/dist/src/intl/bn.d.ts.map +1 -1
  100. package/dist/src/intl/bn.js +16 -3
  101. package/dist/src/intl/ca.d.ts +3 -1
  102. package/dist/src/intl/ca.d.ts.map +1 -1
  103. package/dist/src/intl/ca.js +16 -3
  104. package/dist/src/intl/cs.d.ts +3 -1
  105. package/dist/src/intl/cs.d.ts.map +1 -1
  106. package/dist/src/intl/cs.js +16 -3
  107. package/dist/src/intl/da.d.ts +3 -1
  108. package/dist/src/intl/da.d.ts.map +1 -1
  109. package/dist/src/intl/da.js +16 -3
  110. package/dist/src/intl/de.d.ts +3 -1
  111. package/dist/src/intl/de.d.ts.map +1 -1
  112. package/dist/src/intl/de.js +16 -3
  113. package/dist/src/intl/el.d.ts +3 -1
  114. package/dist/src/intl/el.d.ts.map +1 -1
  115. package/dist/src/intl/el.js +16 -3
  116. package/dist/src/intl/es.d.ts +3 -1
  117. package/dist/src/intl/es.d.ts.map +1 -1
  118. package/dist/src/intl/es.js +16 -3
  119. package/dist/src/intl/fa.d.ts +3 -1
  120. package/dist/src/intl/fa.d.ts.map +1 -1
  121. package/dist/src/intl/fa.js +16 -3
  122. package/dist/src/intl/fi.d.ts +3 -1
  123. package/dist/src/intl/fi.d.ts.map +1 -1
  124. package/dist/src/intl/fi.js +16 -3
  125. package/dist/src/intl/fil.d.ts +3 -1
  126. package/dist/src/intl/fil.d.ts.map +1 -1
  127. package/dist/src/intl/fil.js +16 -3
  128. package/dist/src/intl/fr.d.ts +3 -1
  129. package/dist/src/intl/fr.d.ts.map +1 -1
  130. package/dist/src/intl/fr.js +16 -3
  131. package/dist/src/intl/he.d.ts +3 -1
  132. package/dist/src/intl/he.d.ts.map +1 -1
  133. package/dist/src/intl/he.js +16 -3
  134. package/dist/src/intl/hi.d.ts +3 -1
  135. package/dist/src/intl/hi.d.ts.map +1 -1
  136. package/dist/src/intl/hi.js +16 -3
  137. package/dist/src/intl/hr.d.ts +3 -1
  138. package/dist/src/intl/hr.d.ts.map +1 -1
  139. package/dist/src/intl/hr.js +16 -3
  140. package/dist/src/intl/hu.d.ts +2 -1
  141. package/dist/src/intl/hu.d.ts.map +1 -1
  142. package/dist/src/intl/hu.js +15 -3
  143. package/dist/src/intl/id.d.ts +3 -1
  144. package/dist/src/intl/id.d.ts.map +1 -1
  145. package/dist/src/intl/id.js +16 -3
  146. package/dist/src/intl/it.d.ts +3 -1
  147. package/dist/src/intl/it.d.ts.map +1 -1
  148. package/dist/src/intl/it.js +16 -3
  149. package/dist/src/intl/ja.d.ts +3 -1
  150. package/dist/src/intl/ja.d.ts.map +1 -1
  151. package/dist/src/intl/ja.js +16 -3
  152. package/dist/src/intl/ko.d.ts +3 -1
  153. package/dist/src/intl/ko.d.ts.map +1 -1
  154. package/dist/src/intl/ko.js +16 -3
  155. package/dist/src/intl/ml.d.ts +3 -1
  156. package/dist/src/intl/ml.d.ts.map +1 -1
  157. package/dist/src/intl/ml.js +16 -3
  158. package/dist/src/intl/mr.d.ts +3 -1
  159. package/dist/src/intl/mr.d.ts.map +1 -1
  160. package/dist/src/intl/mr.js +16 -3
  161. package/dist/src/intl/ms.d.ts +3 -1
  162. package/dist/src/intl/ms.d.ts.map +1 -1
  163. package/dist/src/intl/ms.js +15 -2
  164. package/dist/src/intl/nb.d.ts +2 -1
  165. package/dist/src/intl/nb.d.ts.map +1 -1
  166. package/dist/src/intl/nb.js +14 -2
  167. package/dist/src/intl/nl.d.ts +3 -1
  168. package/dist/src/intl/nl.d.ts.map +1 -1
  169. package/dist/src/intl/nl.js +16 -3
  170. package/dist/src/intl/pa.d.ts +3 -1
  171. package/dist/src/intl/pa.d.ts.map +1 -1
  172. package/dist/src/intl/pa.js +16 -3
  173. package/dist/src/intl/pl.d.ts +2 -0
  174. package/dist/src/intl/pl.d.ts.map +1 -1
  175. package/dist/src/intl/pl.js +15 -2
  176. package/dist/src/intl/pt-BR.d.ts +3 -1
  177. package/dist/src/intl/pt-BR.d.ts.map +1 -1
  178. package/dist/src/intl/pt-BR.js +16 -3
  179. package/dist/src/intl/pt.d.ts +3 -1
  180. package/dist/src/intl/pt.d.ts.map +1 -1
  181. package/dist/src/intl/pt.js +15 -2
  182. package/dist/src/intl/ro.d.ts +3 -1
  183. package/dist/src/intl/ro.d.ts.map +1 -1
  184. package/dist/src/intl/ro.js +16 -3
  185. package/dist/src/intl/sk.d.ts +3 -1
  186. package/dist/src/intl/sk.d.ts.map +1 -1
  187. package/dist/src/intl/sk.js +15 -2
  188. package/dist/src/intl/sl.d.ts +3 -1
  189. package/dist/src/intl/sl.d.ts.map +1 -1
  190. package/dist/src/intl/sl.js +16 -3
  191. package/dist/src/intl/sv.d.ts +3 -1
  192. package/dist/src/intl/sv.d.ts.map +1 -1
  193. package/dist/src/intl/sv.js +16 -3
  194. package/dist/src/intl/sw.d.ts +1 -0
  195. package/dist/src/intl/sw.d.ts.map +1 -1
  196. package/dist/src/intl/sw.js +14 -2
  197. package/dist/src/intl/ta.d.ts +3 -1
  198. package/dist/src/intl/ta.d.ts.map +1 -1
  199. package/dist/src/intl/ta.js +16 -3
  200. package/dist/src/intl/te.d.ts +3 -1
  201. package/dist/src/intl/te.d.ts.map +1 -1
  202. package/dist/src/intl/te.js +16 -3
  203. package/dist/src/intl/th.d.ts +3 -1
  204. package/dist/src/intl/th.d.ts.map +1 -1
  205. package/dist/src/intl/th.js +16 -3
  206. package/dist/src/intl/tr.d.ts +3 -1
  207. package/dist/src/intl/tr.d.ts.map +1 -1
  208. package/dist/src/intl/tr.js +16 -3
  209. package/dist/src/intl/uk.d.ts +3 -1
  210. package/dist/src/intl/uk.d.ts.map +1 -1
  211. package/dist/src/intl/uk.js +16 -3
  212. package/dist/src/intl/ur.d.ts +3 -1
  213. package/dist/src/intl/ur.d.ts.map +1 -1
  214. package/dist/src/intl/ur.js +15 -2
  215. package/dist/src/intl/vi.d.ts +3 -1
  216. package/dist/src/intl/vi.d.ts.map +1 -1
  217. package/dist/src/intl/vi.js +16 -3
  218. package/dist/src/intl/zh-CN.d.ts +3 -1
  219. package/dist/src/intl/zh-CN.d.ts.map +1 -1
  220. package/dist/src/intl/zh-CN.js +16 -3
  221. package/dist/src/intl/zh-TW.d.ts +3 -1
  222. package/dist/src/intl/zh-TW.d.ts.map +1 -1
  223. package/dist/src/intl/zh-TW.js +16 -3
  224. package/dist/src/local-first/Evolu.d.ts +47 -24
  225. package/dist/src/local-first/Evolu.d.ts.map +1 -1
  226. package/dist/src/local-first/Owner.d.ts +10 -7
  227. package/dist/src/local-first/Owner.d.ts.map +1 -1
  228. package/dist/src/local-first/Owner.js +10 -7
  229. package/dist/src/local-first/Protocol.d.ts +5 -5
  230. package/dist/src/local-first/Protocol.js +5 -5
  231. package/dist/src/local-first/Query.d.ts +34 -21
  232. package/dist/src/local-first/Query.d.ts.map +1 -1
  233. package/dist/src/local-first/Query.js +25 -13
  234. package/dist/src/local-first/Relay.d.ts +12 -5
  235. package/dist/src/local-first/Relay.d.ts.map +1 -1
  236. package/dist/src/local-first/Schema.d.ts +19 -11
  237. package/dist/src/local-first/Schema.d.ts.map +1 -1
  238. package/dist/src/local-first/Schema.js +11 -6
  239. package/dist/src/local-first/Storage.d.ts +4 -2
  240. package/dist/src/local-first/Storage.d.ts.map +1 -1
  241. package/package.json +3 -4
  242. package/src/Array.ts +170 -97
  243. package/src/Assert.ts +336 -31
  244. package/src/BigInt.ts +3 -3
  245. package/src/Brand.ts +7 -7
  246. package/src/Buffer.ts +12 -4
  247. package/src/Cache.ts +8 -3
  248. package/src/Callbacks.ts +8 -4
  249. package/src/Console.ts +45 -30
  250. package/src/Crypto.ts +13 -8
  251. package/src/Eq.ts +450 -122
  252. package/src/Function.ts +54 -24
  253. package/src/Http.ts +52 -19
  254. package/src/Identicon.ts +9 -4
  255. package/src/LockManager.ts +12 -10
  256. package/src/Lookup.ts +4 -2
  257. package/src/Number.ts +28 -24
  258. package/src/Object.ts +115 -49
  259. package/src/Option.ts +14 -5
  260. package/src/Order.ts +12 -12
  261. package/src/Platform.ts +2 -2
  262. package/src/Random.ts +7 -4
  263. package/src/Redacted.ts +13 -6
  264. package/src/Ref.ts +4 -4
  265. package/src/Relation.ts +5 -7
  266. package/src/Resource.ts +27 -12
  267. package/src/Result.ts +258 -114
  268. package/src/Schedule.ts +233 -116
  269. package/src/Set.ts +43 -24
  270. package/src/Sqlite.ts +9 -8
  271. package/src/Task.ts +441 -212
  272. package/src/Test.ts +10 -4
  273. package/src/Time.ts +27 -17
  274. package/src/Type.ts +2077 -620
  275. package/src/Types.ts +108 -40
  276. package/src/WebSocket.ts +14 -6
  277. package/src/Worker.ts +10 -6
  278. package/src/intl/_en.ts +20 -4
  279. package/src/intl/ar.ts +17 -2
  280. package/src/intl/bn.ts +19 -4
  281. package/src/intl/ca.ts +19 -4
  282. package/src/intl/cs.ts +19 -4
  283. package/src/intl/da.ts +19 -4
  284. package/src/intl/de.ts +19 -4
  285. package/src/intl/el.ts +19 -4
  286. package/src/intl/es.ts +19 -4
  287. package/src/intl/fa.ts +19 -4
  288. package/src/intl/fi.ts +19 -4
  289. package/src/intl/fil.ts +19 -4
  290. package/src/intl/fr.ts +19 -4
  291. package/src/intl/he.ts +19 -4
  292. package/src/intl/hi.ts +19 -4
  293. package/src/intl/hr.ts +19 -4
  294. package/src/intl/hu.ts +18 -4
  295. package/src/intl/id.ts +19 -4
  296. package/src/intl/it.ts +19 -4
  297. package/src/intl/ja.ts +19 -4
  298. package/src/intl/ko.ts +19 -4
  299. package/src/intl/ml.ts +19 -4
  300. package/src/intl/mr.ts +19 -4
  301. package/src/intl/ms.ts +17 -2
  302. package/src/intl/nb.ts +16 -2
  303. package/src/intl/nl.ts +19 -4
  304. package/src/intl/pa.ts +19 -4
  305. package/src/intl/pl.ts +18 -2
  306. package/src/intl/pt-BR.ts +19 -4
  307. package/src/intl/pt.ts +17 -2
  308. package/src/intl/ro.ts +19 -4
  309. package/src/intl/sk.ts +17 -2
  310. package/src/intl/sl.ts +19 -4
  311. package/src/intl/sv.ts +19 -4
  312. package/src/intl/sw.ts +15 -2
  313. package/src/intl/ta.ts +19 -4
  314. package/src/intl/te.ts +19 -4
  315. package/src/intl/th.ts +19 -4
  316. package/src/intl/tr.ts +19 -4
  317. package/src/intl/uk.ts +19 -4
  318. package/src/intl/ur.ts +17 -2
  319. package/src/intl/vi.ts +19 -3
  320. package/src/intl/zh-CN.ts +19 -4
  321. package/src/intl/zh-TW.ts +19 -4
  322. package/src/local-first/Evolu.ts +47 -24
  323. package/src/local-first/Owner.ts +10 -7
  324. package/src/local-first/Protocol.ts +5 -5
  325. package/src/local-first/Query.ts +34 -21
  326. package/src/local-first/Relay.ts +12 -5
  327. package/src/local-first/Schema.ts +19 -11
  328. package/src/local-first/Storage.ts +4 -2
package/dist/src/Array.js CHANGED
@@ -16,13 +16,16 @@
16
16
  * to track:
17
17
  *
18
18
  * ```ts
19
- * const sortScores = (arr: number[]) => arr.sort((a, b) => a - b);
19
+ * import { assertEqual, assertSame } from "@evolu/common";
20
+ *
21
+ * // oxlint-disable-next-line unicorn/no-array-sort -- This example intentionally demonstrates mutating Array.sort.
22
+ * const sortScores = (arr: Array<number>) => arr.sort((a, b) => a - b);
20
23
  *
21
24
  * const scores = [3, 1, 2];
22
25
  * const leaderboard = sortScores(scores);
23
- * expect(leaderboard).toEqual([1, 2, 3]);
24
- * expect(scores).toEqual([1, 2, 3]);
25
- * expect(leaderboard).toBe(scores);
26
+ * assertEqual(leaderboard, [1, 2, 3]);
27
+ * assertEqual(scores, [1, 2, 3]);
28
+ * assertSame(leaderboard, scores);
26
29
  * ```
27
30
  *
28
31
  * Imagine every method doing that.
@@ -31,30 +34,35 @@
31
34
  * instead:
32
35
  *
33
36
  * ```ts
34
- * import { sortArray } from "@evolu/common";
37
+ * import { assertEqual, assertTrue, sortArray } from "@evolu/common";
35
38
  *
36
39
  * const sortScores = (arr: ReadonlyArray<number>) =>
37
40
  * sortArray(arr, (a, b) => a - b);
38
41
  *
39
42
  * const scores: ReadonlyArray<number> = [3, 1, 2];
40
43
  * const leaderboard = sortScores(scores);
41
- * expect(leaderboard).toEqual([1, 2, 3]);
42
- * expect(scores).toEqual([3, 1, 2]);
43
- * expect(leaderboard).not.toBe(scores);
44
+ * assertEqual(leaderboard, [1, 2, 3]);
45
+ * assertEqual(scores, [3, 1, 2]);
46
+ * assertTrue(leaderboard !== scores);
44
47
  * ```
45
48
  *
46
49
  * Even better, require a {@link NonEmptyReadonlyArray} — there's nothing to sort
47
50
  * if the array is empty anyway:
48
51
  *
49
52
  * ```ts
50
- * import { sortArray, type NonEmptyReadonlyArray } from "@evolu/common";
53
+ * import {
54
+ * assertEqual,
55
+ * assertType,
56
+ * sortArray,
57
+ * type NonEmptyReadonlyArray,
58
+ * } from "@evolu/common";
51
59
  *
52
60
  * const sortScores = (arr: NonEmptyReadonlyArray<number>) =>
53
61
  * sortArray(arr, (a, b) => a - b);
54
62
  *
55
63
  * const leaderboard = sortScores([3, 1, 2]);
56
- * expect(leaderboard).toEqual([1, 2, 3]);
57
- * expectTypeOf(leaderboard).toEqualTypeOf<NonEmptyReadonlyArray<number>>();
64
+ * assertEqual(leaderboard, [1, 2, 3]);
65
+ * assertType<NonEmptyReadonlyArray<number>, typeof leaderboard>();
58
66
  * ```
59
67
  *
60
68
  * Sorting an empty array isn't expensive, but functions can have side effects
@@ -68,13 +76,16 @@
68
76
  * readonly arrays without mutation — use them directly.
69
77
  *
70
78
  * ```ts
71
- * import { type NonEmptyReadonlyArray } from "@evolu/common";
79
+ * import { assertEqual, type NonEmptyReadonlyArray } from "@evolu/common";
72
80
  *
73
81
  * const valid: NonEmptyReadonlyArray<number> = [1, 2, 3];
74
82
  * // @ts-expect-error An empty array is not non-empty.
75
- * const invalid: NonEmptyReadonlyArray<number> = [];
83
+ * const _invalid: NonEmptyReadonlyArray<number> = [];
76
84
  *
77
- * expect(valid.find((value) => value === 2)).toBe(2);
85
+ * assertEqual(
86
+ * valid.find((value) => value === 2),
87
+ * 2,
88
+ * );
78
89
  * ```
79
90
  *
80
91
  * ## Composition
@@ -83,7 +94,7 @@
83
94
  * because it's natural for single operations:
84
95
  *
85
96
  * ```ts
86
- * import { mapArray } from "@evolu/common";
97
+ * import { assertEqual, mapArray } from "@evolu/common";
87
98
  *
88
99
  * interface Message {
89
100
  * readonly timestamp: number;
@@ -94,7 +105,7 @@
94
105
  * { timestamp: 20 },
95
106
  * ];
96
107
  * const timestamps = mapArray(messages, (m) => m.timestamp);
97
- * expect(timestamps).toEqual([10, 20]);
108
+ * assertEqual(timestamps, [10, 20]);
98
109
  * ```
99
110
  *
100
111
  * Data-first style also reads well for a few operations, often fitting on a
@@ -102,6 +113,7 @@
102
113
  *
103
114
  * ```ts
104
115
  * import {
116
+ * assertEqual,
105
117
  * dedupeArray,
106
118
  * filterArray,
107
119
  * firstInArray,
@@ -113,11 +125,11 @@
113
125
  * } from "@evolu/common";
114
126
  *
115
127
  * const cheapest = firstInArray(sortArray([30, 10, 20], orderNumber));
116
- * expect(cheapest).toBe(10);
128
+ * assertEqual(cheapest, 10);
117
129
  *
118
130
  * const users = [{ name: "Ada" }, { name: "Linus" }, { name: "Ada" }];
119
131
  * const uniqueNames = dedupeArray(mapArray(users, (u) => u.name));
120
- * expect(uniqueNames).toEqual(["Ada", "Linus"]);
132
+ * assertEqual(uniqueNames, ["Ada", "Linus"]);
121
133
  *
122
134
  * const jobs = [
123
135
  * { id: 1, done: false },
@@ -127,7 +139,7 @@
127
139
  * if (!isNonEmptyArray(completedJobs)) throw new Error("Expected a job");
128
140
  * const latestDone = lastInArray(completedJobs);
129
141
  *
130
- * expect(latestDone).toEqual({ id: 2, done: true });
142
+ * assertEqual(latestDone, { id: 2, done: true });
131
143
  * ```
132
144
  *
133
145
  * For more operations, create a function like `getOldestActiveUser` or a
@@ -160,7 +172,11 @@ export const emptyArray = [];
160
172
  * ### Example
161
173
  *
162
174
  * ```ts
163
- * import { createMutableArray } from "@evolu/common";
175
+ * import {
176
+ * assertEqual,
177
+ * assertType,
178
+ * createMutableArray,
179
+ * } from "@evolu/common";
164
180
  *
165
181
  * const values = createMutableArray<number>(3);
166
182
  *
@@ -168,8 +184,8 @@ export const emptyArray = [];
168
184
  * values[index] = index * 10;
169
185
  * }
170
186
  *
171
- * expect(values).toEqual([0, 10, 20]);
172
- * expectTypeOf(values).toEqualTypeOf<Array<number>>();
187
+ * assertEqual(values, [0, 10, 20]);
188
+ * assertType<Array<number>, typeof values>();
173
189
  * ```
174
190
  *
175
191
  * @group Constructors
@@ -194,19 +210,24 @@ export function arrayFrom(iterableOrLength, map) {
194
210
  * ### Awaiting sync and async iterables
195
211
  *
196
212
  * ```ts
197
- * import { arrayFromAsync } from "@evolu/common";
213
+ * import { assertEqual, assertType, arrayFromAsync } from "@evolu/common";
198
214
  *
199
- * const fromIterable = await arrayFromAsync(new Set([1, 2, 3]));
200
- * expect(fromIterable).toEqual([1, 2, 3]);
215
+ * const fromIterable = await arrayFromAsync([
216
+ * Promise.resolve(1),
217
+ * Promise.resolve(2),
218
+ * Promise.resolve(3),
219
+ * ]);
220
+ * assertEqual(fromIterable, [1, 2, 3]);
201
221
  *
202
222
  * const fromAsyncIterable = await arrayFromAsync(
203
- * (async function* () {
204
- * yield Promise.resolve(1);
205
- * yield Promise.resolve(2);
223
+ * (async function* (): AsyncGenerator<number> {
224
+ * await Promise.resolve();
225
+ * yield 1;
226
+ * yield 2;
206
227
  * })(),
207
228
  * );
208
- * expect(fromAsyncIterable).toEqual([1, 2]);
209
- * expectTypeOf(fromAsyncIterable).toEqualTypeOf<ReadonlyArray<number>>();
229
+ * assertEqual(fromAsyncIterable, [1, 2]);
230
+ * assertType<ReadonlyArray<number>, typeof fromAsyncIterable>();
210
231
  * ```
211
232
  *
212
233
  * Unlike `Array.fromAsync`, there's no map parameter — map the result with
@@ -227,13 +248,15 @@ export function isNonEmptyArray(array) {
227
248
  *
228
249
  * ```ts
229
250
  * import {
251
+ * assertEqual,
252
+ * assertType,
230
253
  * appendToArray,
231
254
  * type NonEmptyReadonlyArray,
232
255
  * } from "@evolu/common";
233
256
  *
234
257
  * const values = appendToArray([1, 2, 3], 4);
235
- * expect(values).toEqual([1, 2, 3, 4]);
236
- * expectTypeOf(values).toEqualTypeOf<NonEmptyReadonlyArray<number>>();
258
+ * assertEqual(values, [1, 2, 3, 4]);
259
+ * assertType<NonEmptyReadonlyArray<number>, typeof values>();
237
260
  * ```
238
261
  *
239
262
  * @group Transformations
@@ -249,13 +272,15 @@ export const appendToArray = (array, item) =>
249
272
  *
250
273
  * ```ts
251
274
  * import {
275
+ * assertEqual,
276
+ * assertType,
252
277
  * prependToArray,
253
278
  * type NonEmptyReadonlyArray,
254
279
  * } from "@evolu/common";
255
280
  *
256
281
  * const values = prependToArray([2, 3], 1);
257
- * expect(values).toEqual([1, 2, 3]);
258
- * expectTypeOf(values).toEqualTypeOf<NonEmptyReadonlyArray<number>>();
282
+ * assertEqual(values, [1, 2, 3]);
283
+ * assertType<NonEmptyReadonlyArray<number>, typeof values>();
259
284
  * ```
260
285
  *
261
286
  * @group Transformations
@@ -313,12 +338,12 @@ export function reverseArray(array) {
313
338
  * ### Removing and replacing values
314
339
  *
315
340
  * ```ts
316
- * import { spliceArray } from "@evolu/common";
341
+ * import { assertEqual, spliceArray } from "@evolu/common";
317
342
  *
318
343
  * const values: ReadonlyArray<number> = [1, 2, 3, 4];
319
- * expect(spliceArray(values, 1, 2)).toEqual([1, 4]);
320
- * expect(spliceArray([1, 2, 3], 1, 1, 10, 11)).toEqual([1, 10, 11, 3]);
321
- * expect(values).toEqual([1, 2, 3, 4]);
344
+ * assertEqual(spliceArray(values, 1, 2), [1, 4]);
345
+ * assertEqual(spliceArray([1, 2, 3], 1, 1, 10, 11), [1, 10, 11, 3]);
346
+ * assertEqual(values, [1, 2, 3, 4]);
322
347
  * ```
323
348
  *
324
349
  * @group Transformations
@@ -340,9 +365,9 @@ export function zipArray(arrays) {
340
365
  * ### Reading the first value
341
366
  *
342
367
  * ```ts
343
- * import { firstInArray } from "@evolu/common";
368
+ * import { assertEqual, firstInArray } from "@evolu/common";
344
369
  *
345
- * expect(firstInArray(["a", "b", "c"])).toBe("a");
370
+ * assertEqual(firstInArray(["a", "b", "c"]), "a");
346
371
  * ```
347
372
  *
348
373
  * @group Accessors
@@ -354,9 +379,9 @@ export const firstInArray = (array) => array[0];
354
379
  * ### Reading the last value
355
380
  *
356
381
  * ```ts
357
- * import { lastInArray } from "@evolu/common";
382
+ * import { assertEqual, lastInArray } from "@evolu/common";
358
383
  *
359
- * expect(lastInArray(["a", "b", "c"])).toBe("c");
384
+ * assertEqual(lastInArray(["a", "b", "c"]), "c");
360
385
  * ```
361
386
  *
362
387
  * @group Accessors
@@ -1,9 +1,13 @@
1
1
  /**
2
- * Runtime assertions for invariant checking.
2
+ * Runtime assertions for invariants and value checks.
3
3
  *
4
4
  * @module
5
5
  */
6
6
  import type { NonEmptyArray, NonEmptyReadonlyArray } from "./Array.ts";
7
+ import { type Eq } from "./Eq.ts";
8
+ import type { Err, InferErr, InferOk, Ok, Result } from "./Result.ts";
9
+ import type { IsData } from "./Type.ts";
10
+ import type { CompileTimeError } from "./Types.ts";
7
11
  /**
8
12
  * Ensures a condition is true, throwing an error with the provided message if
9
13
  * not.
@@ -18,15 +22,177 @@ import type { NonEmptyArray, NonEmptyReadonlyArray } from "./Array.ts";
18
22
  * ### Example
19
23
  *
20
24
  * ```ts
21
- * import { assert as assertInvariant } from "@evolu/common";
25
+ * import { assert, assertEqual, assertErr, trySync } from "@evolu/common";
22
26
  *
23
- * expect(() => assertInvariant(true, "Expected true.")).not.toThrow();
24
- * expect(() => assertInvariant(false, "Expected true.")).toThrow(
25
- * "Expected true.",
26
- * );
27
+ * assert(true, "Expected true.");
28
+ * const result = trySync(() => assert(false, "Expected true."));
29
+ * assertErr(result);
30
+ * assert(result.error instanceof Error, "Expected an Error.");
31
+ * assertEqual(result.error.message, "Expected true.");
27
32
  * ```
28
33
  */
29
34
  export declare const assert: (condition: unknown, message: string) => asserts condition;
35
+ /**
36
+ * Asserts that two values are the same according to {@link eqStrict}.
37
+ *
38
+ * `eqStrict` uses SameValue equality: it considers `NaN` the same as itself,
39
+ * distinguishes `0` from `-0`, and compares objects by reference identity.
40
+ *
41
+ * ### Example
42
+ *
43
+ * ```ts
44
+ * import { assertSame, assertType } from "@evolu/common";
45
+ *
46
+ * interface User {
47
+ * readonly name: string;
48
+ * }
49
+ *
50
+ * const user: User = { name: "Ada" };
51
+ * const value: unknown = user;
52
+ *
53
+ * assertSame(value, user);
54
+ * assertType<User, typeof value>();
55
+ * ```
56
+ */
57
+ export declare const assertSame: <Expected>(actual: unknown, expected: Expected) => asserts actual is Expected;
58
+ /**
59
+ * Asserts that a value is exactly `true` and narrows it to `true`.
60
+ *
61
+ * Unlike {@link assert}, this checks an exact boolean value instead of
62
+ * truthiness and does not require a custom message.
63
+ *
64
+ * ### Example
65
+ *
66
+ * ```ts
67
+ * import { assertTrue, assertType } from "@evolu/common";
68
+ *
69
+ * const value: unknown = true;
70
+ * assertTrue(value);
71
+ * assertType<true, typeof value>();
72
+ * ```
73
+ */
74
+ export declare const assertTrue: (value: unknown) => asserts value is true;
75
+ /**
76
+ * Asserts that a value is exactly `false` and narrows it to `false`.
77
+ *
78
+ * Unlike {@link assert}, this checks an exact boolean value instead of falsiness
79
+ * and does not require a custom message.
80
+ *
81
+ * ### Example
82
+ *
83
+ * ```ts
84
+ * import { assertFalse, assertType } from "@evolu/common";
85
+ *
86
+ * const value: unknown = false;
87
+ * assertFalse(value);
88
+ * assertType<false, typeof value>();
89
+ * ```
90
+ */
91
+ export declare const assertFalse: (value: unknown) => asserts value is false;
92
+ /**
93
+ * Asserts that two {@link Data} values are equal according to {@link eqData}.
94
+ *
95
+ * Use this for concise value checks in platform-independent examples. Use
96
+ * {@link assert} with a descriptive message for application invariants.
97
+ *
98
+ * ### Example
99
+ *
100
+ * ```ts
101
+ * import { assertEqual } from "@evolu/common";
102
+ *
103
+ * const actual = new Map([["roles", new Set(["admin", "author"])]]);
104
+ * const expected = new Map([["roles", new Set(["author", "admin"])]]);
105
+ *
106
+ * assertEqual(actual, expected);
107
+ * ```
108
+ */
109
+ export declare function assertEqual<Actual, Expected>(actual: Actual, expected: Expected, ...dataError: AssertEqualError<Actual | Expected>): void;
110
+ type AssertEqualError<Value> = IsData<Value> extends true ? [] : [
111
+ error: CompileTimeError<"assertEqual", "Actual and expected values must consist only of Data.">
112
+ ];
113
+ /**
114
+ * Asserts that a {@link Result} is an {@link Ok}, optionally compares its value,
115
+ * and narrows the Result.
116
+ *
117
+ * With only a Result, this checks the variant without inspecting the value.
118
+ * When an expected value is provided, it uses {@link eqData}; its Data type is
119
+ * inferred independently, so an unbranded literal can compare a branded
120
+ * primitive or collection. Pass a custom {@link Eq} when either value is outside
121
+ * {@link Data} or needs domain-specific equality.
122
+ *
123
+ * ### Example
124
+ *
125
+ * ```ts
126
+ * import {
127
+ * assertEqual,
128
+ * assertOk,
129
+ * assertType,
130
+ * ok,
131
+ * type Ok,
132
+ * type Result,
133
+ * type Typed,
134
+ * } from "@evolu/common";
135
+ *
136
+ * interface User {
137
+ * readonly id: string;
138
+ * }
139
+ *
140
+ * interface UserNotFoundError extends Typed<"UserNotFound"> {}
141
+ *
142
+ * const result: Result<User, UserNotFoundError> = ok({ id: "user-1" });
143
+ *
144
+ * assertOk(result);
145
+ * assertType<Ok<User>, typeof result>();
146
+ * assertEqual(result.value.id, "user-1");
147
+ * ```
148
+ */
149
+ export declare function assertOk<R extends Result<unknown, unknown>>(result: R): asserts result is Extract<R, Ok<unknown>>;
150
+ export declare function assertOk<R extends Result<unknown, unknown>>(result: R, expectedValue: InferOk<R>, eq: Eq<InferOk<R>>): asserts result is Extract<R, Ok<unknown>>;
151
+ export declare function assertOk<R extends Result<unknown, unknown>, ExpectedValue>(result: R, ...comparison: [expectedValue: ExpectedValue] & (IsData<InferOk<R> | ExpectedValue> extends true ? unknown : {
152
+ readonly [Error in CompileTimeError<"assertOk", "Result value and expected value must consist only of Data when no custom Eq is provided.">]: never;
153
+ })): asserts result is Extract<R, Ok<unknown>>;
154
+ /**
155
+ * Asserts that a {@link Result} is an {@link Err}, optionally compares its error,
156
+ * and narrows the Result.
157
+ *
158
+ * With only a Result, this checks the variant without inspecting the error.
159
+ * When an expected error is provided, it uses {@link eqData}; its Data type is
160
+ * inferred independently, so an unbranded literal can compare a branded
161
+ * primitive or collection. Pass a custom {@link Eq} when either value is outside
162
+ * {@link Data} or needs domain-specific equality.
163
+ *
164
+ * ### Example
165
+ *
166
+ * ```ts
167
+ * import {
168
+ * assertEqual,
169
+ * assertErr,
170
+ * assertType,
171
+ * err,
172
+ * type Err,
173
+ * type Result,
174
+ * type Typed,
175
+ * } from "@evolu/common";
176
+ *
177
+ * interface UserNotFoundError extends Typed<"UserNotFound"> {
178
+ * readonly id: string;
179
+ * }
180
+ *
181
+ * const result: Result<string, UserNotFoundError> = err({
182
+ * type: "UserNotFound",
183
+ * id: "user-1",
184
+ * });
185
+ *
186
+ * assertErr(result);
187
+ * assertType<Err<UserNotFoundError>, typeof result>();
188
+ * assertEqual(result.error.id, "user-1");
189
+ * ```
190
+ */
191
+ export declare function assertErr<R extends Result<unknown, unknown>>(result: R): asserts result is Extract<R, Err<unknown>>;
192
+ export declare function assertErr<R extends Result<unknown, unknown>>(result: R, expectedError: InferErr<R>, eq: Eq<InferErr<R>>): asserts result is Extract<R, Err<unknown>>;
193
+ export declare function assertErr<R extends Result<unknown, unknown>, ExpectedError>(result: R, ...comparison: [expectedError: ExpectedError] & (IsData<InferErr<R> | ExpectedError> extends true ? unknown : {
194
+ readonly [Error in CompileTimeError<"assertErr", "Result error and expected error must consist only of Data when no custom Eq is provided.">]: never;
195
+ })): asserts result is Extract<R, Err<unknown>>;
30
196
  /**
31
197
  * Asserts that a value is non-nullable.
32
198
  *
@@ -44,15 +210,23 @@ export declare const assertNonNullable: <T>(value: T, message?: string) => asser
44
210
  * ### Example
45
211
  *
46
212
  * ```ts
47
- * import { assertNotNull } from "@evolu/common";
213
+ * import {
214
+ * assert,
215
+ * assertEqual,
216
+ * assertErr,
217
+ * assertNotNull,
218
+ * assertType,
219
+ * trySync,
220
+ * } from "@evolu/common";
48
221
  *
49
222
  * const value = undefined as string | null | undefined;
50
223
  * assertNotNull(value);
51
- * expectTypeOf(value).toEqualTypeOf<string | undefined>();
52
- * expect(value).toBeUndefined();
53
- * expect(() => assertNotNull(null)).toThrow(
54
- * "Expected value not to be null.",
55
- * );
224
+ * assertType<string | undefined, typeof value>();
225
+ * assertEqual(value, undefined);
226
+ * const result = trySync(() => assertNotNull(null));
227
+ * assertErr(result);
228
+ * assert(result.error instanceof Error, "Expected an Error.");
229
+ * assertEqual(result.error.message, "Expected value not to be null.");
56
230
  * ```
57
231
  */
58
232
  export declare const assertNotNull: <T>(value: T, message?: string) => asserts value is T & ({} | undefined);
@@ -65,15 +239,23 @@ export declare const assertNotNull: <T>(value: T, message?: string) => asserts v
65
239
  * ### Example
66
240
  *
67
241
  * ```ts
68
- * import { assertNotUndefined } from "@evolu/common";
242
+ * import {
243
+ * assert,
244
+ * assertEqual,
245
+ * assertErr,
246
+ * assertNotUndefined,
247
+ * assertType,
248
+ * trySync,
249
+ * } from "@evolu/common";
69
250
  *
70
251
  * const value = null as string | null | undefined;
71
252
  * assertNotUndefined(value);
72
- * expectTypeOf(value).toEqualTypeOf<string | null>();
73
- * expect(value).toBeNull();
74
- * expect(() => assertNotUndefined(undefined)).toThrow(
75
- * "Expected value not to be undefined.",
76
- * );
253
+ * assertType<string | null, typeof value>();
254
+ * assertEqual(value, null);
255
+ * const result = trySync(() => assertNotUndefined(undefined));
256
+ * assertErr(result);
257
+ * assert(result.error instanceof Error, "Expected an Error.");
258
+ * assertEqual(result.error.message, "Expected value not to be undefined.");
77
259
  * ```
78
260
  */
79
261
  export declare const assertNotUndefined: <T>(value: T, message?: string) => asserts value is T & ({} | null);
@@ -86,13 +268,21 @@ export declare const assertNotUndefined: <T>(value: T, message?: string) => asse
86
268
  * ### Example
87
269
  *
88
270
  * ```ts
89
- * import { assertNonEmptyArray, type NonEmptyArray } from "@evolu/common";
271
+ * import {
272
+ * assertEqual,
273
+ * assertErr,
274
+ * assertNonEmptyArray,
275
+ * assertType,
276
+ * trySync,
277
+ * type NonEmptyArray,
278
+ * } from "@evolu/common";
90
279
  *
91
280
  * const values = [1, 2, 3];
92
281
  * assertNonEmptyArray(values);
93
- * expectTypeOf(values).toEqualTypeOf<NonEmptyArray<number>>();
94
- * expect(values[0]).toBe(1);
95
- * expect(() => assertNonEmptyArray([])).toThrow();
282
+ * assertType<NonEmptyArray<number>, typeof values>();
283
+ * assertEqual(values[0], 1);
284
+ * const result = trySync(() => assertNonEmptyArray([]));
285
+ * assertErr(result);
96
286
  * ```
97
287
  */
98
288
  export declare const assertNonEmptyArray: <T>(arr: Array<T>, message?: string) => asserts arr is NonEmptyArray<T>;
@@ -106,15 +296,20 @@ export declare const assertNonEmptyArray: <T>(arr: Array<T>, message?: string) =
106
296
  *
107
297
  * ```ts
108
298
  * import {
299
+ * assertEqual,
300
+ * assertErr,
109
301
  * assertNonEmptyReadonlyArray,
302
+ * assertType,
303
+ * trySync,
110
304
  * type NonEmptyReadonlyArray,
111
305
  * } from "@evolu/common";
112
306
  *
113
307
  * const values: ReadonlyArray<number> = [1, 2, 3];
114
308
  * assertNonEmptyReadonlyArray(values);
115
- * expectTypeOf(values).toEqualTypeOf<NonEmptyReadonlyArray<number>>();
116
- * expect(values[0]).toBe(1);
117
- * expect(() => assertNonEmptyReadonlyArray([])).toThrow();
309
+ * assertType<NonEmptyReadonlyArray<number>, typeof values>();
310
+ * assertEqual(values[0], 1);
311
+ * const result = trySync(() => assertNonEmptyReadonlyArray([]));
312
+ * assertErr(result);
118
313
  * ```
119
314
  */
120
315
  export declare const assertNonEmptyReadonlyArray: <T>(arr: ReadonlyArray<T>, message?: string) => asserts arr is NonEmptyReadonlyArray<T>;
@@ -126,14 +321,21 @@ export declare const assertNonEmptyReadonlyArray: <T>(arr: ReadonlyArray<T>, mes
126
321
  * ### Example
127
322
  *
128
323
  * ```ts
129
- * import { assertNotDisposed } from "@evolu/common";
324
+ * import {
325
+ * assert,
326
+ * assertEqual,
327
+ * assertErr,
328
+ * assertNotDisposed,
329
+ * trySync,
330
+ * } from "@evolu/common";
130
331
  *
131
332
  * await using disposer = new globalThis.AsyncDisposableStack();
132
- * expect(() => assertNotDisposed(disposer)).not.toThrow();
333
+ * assertNotDisposed(disposer);
133
334
  * await disposer.disposeAsync();
134
- * expect(() => assertNotDisposed(disposer)).toThrow(
135
- * "Cannot use a disposed object.",
136
- * );
335
+ * const result = trySync(() => assertNotDisposed(disposer));
336
+ * assertErr(result);
337
+ * assert(result.error instanceof Error, "Expected an Error.");
338
+ * assertEqual(result.error.message, "Cannot use a disposed object.");
137
339
  * ```
138
340
  *
139
341
  * This is the JavaScript equivalent of the .NET `ObjectDisposedException`
@@ -144,4 +346,5 @@ export declare const assertNonEmptyReadonlyArray: <T>(arr: ReadonlyArray<T>, mes
144
346
  export declare const assertNotDisposed: (value: DisposableStack | AsyncDisposableStack | {
145
347
  readonly disposed: boolean;
146
348
  }) => void;
349
+ export {};
147
350
  //# sourceMappingURL=Assert.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Assert.d.ts","sourceRoot":"","sources":["../../src/Assert.ts"],"names":[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