@evolu/common 8.5.0 → 8.6.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 (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 +7 -7
  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 +7 -7
  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
@@ -1,8 +1,9 @@
1
1
  /**
2
- * Runtime assertions for invariant checking.
2
+ * Runtime assertions for invariants and value checks.
3
3
  *
4
4
  * @module
5
5
  */
6
+ import { eqData, eqStrict } from "./Eq.js";
6
7
  /**
7
8
  * Ensures a condition is true, throwing an error with the provided message if
8
9
  * not.
@@ -17,12 +18,13 @@
17
18
  * ### Example
18
19
  *
19
20
  * ```ts
20
- * import { assert as assertInvariant } from "@evolu/common";
21
+ * import { assert, assertEqual, assertErr, trySync } from "@evolu/common";
21
22
  *
22
- * expect(() => assertInvariant(true, "Expected true.")).not.toThrow();
23
- * expect(() => assertInvariant(false, "Expected true.")).toThrow(
24
- * "Expected true.",
25
- * );
23
+ * assert(true, "Expected true.");
24
+ * const result = trySync(() => assert(false, "Expected true."));
25
+ * assertErr(result);
26
+ * assert(result.error instanceof Error, "Expected an Error.");
27
+ * assertEqual(result.error.message, "Expected true.");
26
28
  * ```
27
29
  */
28
30
  export const assert = (condition, message) => {
@@ -31,6 +33,88 @@ export const assert = (condition, message) => {
31
33
  throw new Error(message);
32
34
  }
33
35
  };
36
+ /**
37
+ * Asserts that two values are the same according to {@link eqStrict}.
38
+ *
39
+ * `eqStrict` uses SameValue equality: it considers `NaN` the same as itself,
40
+ * distinguishes `0` from `-0`, and compares objects by reference identity.
41
+ *
42
+ * ### Example
43
+ *
44
+ * ```ts
45
+ * import { assertSame, assertType } from "@evolu/common";
46
+ *
47
+ * interface User {
48
+ * readonly name: string;
49
+ * }
50
+ *
51
+ * const user: User = { name: "Ada" };
52
+ * const value: unknown = user;
53
+ *
54
+ * assertSame(value, user);
55
+ * assertType<User, typeof value>();
56
+ * ```
57
+ */
58
+ export const assertSame = (actual, expected) => {
59
+ assert(eqStrict(actual, expected), "Expected values to be the same.");
60
+ };
61
+ /**
62
+ * Asserts that a value is exactly `true` and narrows it to `true`.
63
+ *
64
+ * Unlike {@link assert}, this checks an exact boolean value instead of
65
+ * truthiness and does not require a custom message.
66
+ *
67
+ * ### Example
68
+ *
69
+ * ```ts
70
+ * import { assertTrue, assertType } from "@evolu/common";
71
+ *
72
+ * const value: unknown = true;
73
+ * assertTrue(value);
74
+ * assertType<true, typeof value>();
75
+ * ```
76
+ */
77
+ export const assertTrue = (value) => {
78
+ assert(value === true, "Expected true.");
79
+ };
80
+ /**
81
+ * Asserts that a value is exactly `false` and narrows it to `false`.
82
+ *
83
+ * Unlike {@link assert}, this checks an exact boolean value instead of falsiness
84
+ * and does not require a custom message.
85
+ *
86
+ * ### Example
87
+ *
88
+ * ```ts
89
+ * import { assertFalse, assertType } from "@evolu/common";
90
+ *
91
+ * const value: unknown = false;
92
+ * assertFalse(value);
93
+ * assertType<false, typeof value>();
94
+ * ```
95
+ */
96
+ export const assertFalse = (value) => {
97
+ assert(value === false, "Expected false.");
98
+ };
99
+ export function assertEqual(actual, expected) {
100
+ assert(eqData(actual, expected), "Expected values to be equal.");
101
+ }
102
+ export function assertOk(result, ...comparison) {
103
+ assert(result.ok, "Expected an Ok result.");
104
+ if (comparison.length === 0)
105
+ return;
106
+ const expectedValue = comparison[0];
107
+ const eq = comparison[1] ?? eqData;
108
+ assert(eq(result.value, expectedValue), "Expected the value to equal the expected value.");
109
+ }
110
+ export function assertErr(result, ...comparison) {
111
+ assert(!result.ok, "Expected an Err result.");
112
+ if (comparison.length === 0)
113
+ return;
114
+ const expectedError = comparison[0];
115
+ const eq = comparison[1] ?? eqData;
116
+ assert(eq(result.error, expectedError), "Expected the error to equal the expected error.");
117
+ }
34
118
  /**
35
119
  * Asserts that a value is non-nullable.
36
120
  *
@@ -50,15 +134,23 @@ export const assertNonNullable = (value, message = "Expected value to be non-nul
50
134
  * ### Example
51
135
  *
52
136
  * ```ts
53
- * import { assertNotNull } from "@evolu/common";
137
+ * import {
138
+ * assert,
139
+ * assertEqual,
140
+ * assertErr,
141
+ * assertNotNull,
142
+ * assertType,
143
+ * trySync,
144
+ * } from "@evolu/common";
54
145
  *
55
146
  * const value = undefined as string | null | undefined;
56
147
  * assertNotNull(value);
57
- * expectTypeOf(value).toEqualTypeOf<string | undefined>();
58
- * expect(value).toBeUndefined();
59
- * expect(() => assertNotNull(null)).toThrow(
60
- * "Expected value not to be null.",
61
- * );
148
+ * assertType<string | undefined, typeof value>();
149
+ * assertEqual(value, undefined);
150
+ * const result = trySync(() => assertNotNull(null));
151
+ * assertErr(result);
152
+ * assert(result.error instanceof Error, "Expected an Error.");
153
+ * assertEqual(result.error.message, "Expected value not to be null.");
62
154
  * ```
63
155
  */
64
156
  export const assertNotNull = (value, message = "Expected value not to be null.") => {
@@ -73,15 +165,23 @@ export const assertNotNull = (value, message = "Expected value not to be null.")
73
165
  * ### Example
74
166
  *
75
167
  * ```ts
76
- * import { assertNotUndefined } from "@evolu/common";
168
+ * import {
169
+ * assert,
170
+ * assertEqual,
171
+ * assertErr,
172
+ * assertNotUndefined,
173
+ * assertType,
174
+ * trySync,
175
+ * } from "@evolu/common";
77
176
  *
78
177
  * const value = null as string | null | undefined;
79
178
  * assertNotUndefined(value);
80
- * expectTypeOf(value).toEqualTypeOf<string | null>();
81
- * expect(value).toBeNull();
82
- * expect(() => assertNotUndefined(undefined)).toThrow(
83
- * "Expected value not to be undefined.",
84
- * );
179
+ * assertType<string | null, typeof value>();
180
+ * assertEqual(value, null);
181
+ * const result = trySync(() => assertNotUndefined(undefined));
182
+ * assertErr(result);
183
+ * assert(result.error instanceof Error, "Expected an Error.");
184
+ * assertEqual(result.error.message, "Expected value not to be undefined.");
85
185
  * ```
86
186
  */
87
187
  export const assertNotUndefined = (value, message = "Expected value not to be undefined.") => {
@@ -96,13 +196,21 @@ export const assertNotUndefined = (value, message = "Expected value not to be un
96
196
  * ### Example
97
197
  *
98
198
  * ```ts
99
- * import { assertNonEmptyArray, type NonEmptyArray } from "@evolu/common";
199
+ * import {
200
+ * assertEqual,
201
+ * assertErr,
202
+ * assertNonEmptyArray,
203
+ * assertType,
204
+ * trySync,
205
+ * type NonEmptyArray,
206
+ * } from "@evolu/common";
100
207
  *
101
208
  * const values = [1, 2, 3];
102
209
  * assertNonEmptyArray(values);
103
- * expectTypeOf(values).toEqualTypeOf<NonEmptyArray<number>>();
104
- * expect(values[0]).toBe(1);
105
- * expect(() => assertNonEmptyArray([])).toThrow();
210
+ * assertType<NonEmptyArray<number>, typeof values>();
211
+ * assertEqual(values[0], 1);
212
+ * const result = trySync(() => assertNonEmptyArray([]));
213
+ * assertErr(result);
106
214
  * ```
107
215
  */
108
216
  export const assertNonEmptyArray = (arr, message = "Expected a non-empty array.") => {
@@ -118,15 +226,20 @@ export const assertNonEmptyArray = (arr, message = "Expected a non-empty array."
118
226
  *
119
227
  * ```ts
120
228
  * import {
229
+ * assertEqual,
230
+ * assertErr,
121
231
  * assertNonEmptyReadonlyArray,
232
+ * assertType,
233
+ * trySync,
122
234
  * type NonEmptyReadonlyArray,
123
235
  * } from "@evolu/common";
124
236
  *
125
237
  * const values: ReadonlyArray<number> = [1, 2, 3];
126
238
  * assertNonEmptyReadonlyArray(values);
127
- * expectTypeOf(values).toEqualTypeOf<NonEmptyReadonlyArray<number>>();
128
- * expect(values[0]).toBe(1);
129
- * expect(() => assertNonEmptyReadonlyArray([])).toThrow();
239
+ * assertType<NonEmptyReadonlyArray<number>, typeof values>();
240
+ * assertEqual(values[0], 1);
241
+ * const result = trySync(() => assertNonEmptyReadonlyArray([]));
242
+ * assertErr(result);
130
243
  * ```
131
244
  */
132
245
  export const assertNonEmptyReadonlyArray = (arr, message = "Expected a non-empty readonly array.") => {
@@ -140,14 +253,21 @@ export const assertNonEmptyReadonlyArray = (arr, message = "Expected a non-empty
140
253
  * ### Example
141
254
  *
142
255
  * ```ts
143
- * import { assertNotDisposed } from "@evolu/common";
256
+ * import {
257
+ * assert,
258
+ * assertEqual,
259
+ * assertErr,
260
+ * assertNotDisposed,
261
+ * trySync,
262
+ * } from "@evolu/common";
144
263
  *
145
264
  * await using disposer = new globalThis.AsyncDisposableStack();
146
- * expect(() => assertNotDisposed(disposer)).not.toThrow();
265
+ * assertNotDisposed(disposer);
147
266
  * await disposer.disposeAsync();
148
- * expect(() => assertNotDisposed(disposer)).toThrow(
149
- * "Cannot use a disposed object.",
150
- * );
267
+ * const result = trySync(() => assertNotDisposed(disposer));
268
+ * assertErr(result);
269
+ * assert(result.error instanceof Error, "Expected an Error.");
270
+ * assertEqual(result.error.message, "Cannot use a disposed object.");
151
271
  * ```
152
272
  *
153
273
  * This is the JavaScript equivalent of the .NET `ObjectDisposedException`
@@ -16,12 +16,12 @@ export declare const clampBigInt: (min: bigint, max: bigint) => (n: bigint) => b
16
16
  * ### Example
17
17
  *
18
18
  * ```ts
19
- * import { isBetweenBigInt } from "@evolu/common";
19
+ * import { assertFalse, assertTrue, isBetweenBigInt } from "@evolu/common";
20
20
  *
21
21
  * const isBetween10And20 = isBetweenBigInt(10n, 20n);
22
22
  *
23
- * expect(isBetween10And20(20n)).toBe(true);
24
- * expect(isBetween10And20(25n)).toBe(false);
23
+ * assertTrue(isBetween10And20(20n));
24
+ * assertFalse(isBetween10And20(25n));
25
25
  * ```
26
26
  */
27
27
  export declare const isBetweenBigInt: (min: bigint, max: bigint) => Predicate<bigint>;
@@ -15,12 +15,12 @@ export const clampBigInt = (min, max) => (n) => n < min ? min : n > max ? max :
15
15
  * ### Example
16
16
  *
17
17
  * ```ts
18
- * import { isBetweenBigInt } from "@evolu/common";
18
+ * import { assertFalse, assertTrue, isBetweenBigInt } from "@evolu/common";
19
19
  *
20
20
  * const isBetween10And20 = isBetweenBigInt(10n, 20n);
21
21
  *
22
- * expect(isBetween10And20(20n)).toBe(true);
23
- * expect(isBetween10And20(25n)).toBe(false);
22
+ * assertTrue(isBetween10And20(20n));
23
+ * assertFalse(isBetween10And20(25n));
24
24
  * ```
25
25
  */
26
26
  export const isBetweenBigInt = (min, max) => (value) => value >= min && value <= max;
@@ -17,7 +17,7 @@
17
17
  * ### Single brand
18
18
  *
19
19
  * ```ts
20
- * import type { Brand } from "@evolu/common";
20
+ * import { assertEqual, type Brand } from "@evolu/common";
21
21
  *
22
22
  * type UserId = number & Brand<"UserId">;
23
23
  *
@@ -26,7 +26,7 @@
26
26
  * const createUserId = (value: number): UserId => value as UserId;
27
27
  * const getUser = (id: UserId): number => id;
28
28
  * const userId = createUserId(123);
29
- * expect(getUser(userId)).toBe(123);
29
+ * assertEqual(getUser(userId), 123);
30
30
  * // @ts-expect-error A plain number is not a UserId.
31
31
  * getUser(123);
32
32
  * ```
@@ -34,7 +34,7 @@
34
34
  * ### Multiple brands
35
35
  *
36
36
  * ```ts
37
- * import type { Brand } from "@evolu/common";
37
+ * import { assertEqual, type Brand } from "@evolu/common";
38
38
  *
39
39
  * type Min1 = string & Brand<"Min1">;
40
40
  * type Max100 = string & Brand<"Max100">;
@@ -45,8 +45,8 @@
45
45
  *
46
46
  * const min1Max100Value: Min1Max100 = "typescript" as Min1Max100;
47
47
  *
48
- * expect(requiresMin1(min1Max100Value)).toBe("typescript");
49
- * expect(requiresMax100(min1Max100Value)).toBe("typescript");
48
+ * assertEqual(requiresMin1(min1Max100Value), "typescript");
49
+ * assertEqual(requiresMax100(min1Max100Value), "typescript");
50
50
  * ```
51
51
  *
52
52
  * ### Standalone brand
@@ -58,7 +58,7 @@
58
58
  * code platform-agnostic.
59
59
  *
60
60
  * ```ts
61
- * import type { Brand } from "@evolu/common";
61
+ * import { assertSame, type Brand } from "@evolu/common";
62
62
  *
63
63
  * type NativePort = Brand<"NativePort">;
64
64
  *
@@ -66,7 +66,7 @@
66
66
  *
67
67
  * const nativeValue: unknown = { id: 1 };
68
68
  * const port = nativeValue as NativePort;
69
- * expect(requiresNativePort(port)).toBe(nativeValue);
69
+ * assertSame(requiresNativePort(port), nativeValue);
70
70
  * // @ts-expect-error An unknown value is not a NativePort.
71
71
  * requiresNativePort(nativeValue);
72
72
  * ```
@@ -37,6 +37,9 @@ export declare class BufferError extends Error {
37
37
  *
38
38
  * ```ts
39
39
  * import {
40
+ * assert,
41
+ * assertEqual,
42
+ * assertErr,
40
43
  * createBuffer,
41
44
  * createIdFromString,
42
45
  * IdBytes,
@@ -44,6 +47,7 @@ export declare class BufferError extends Error {
44
47
  * idBytesTypeValueLength,
45
48
  * idToIdBytes,
46
49
  * NonNegativeInt,
50
+ * trySync,
47
51
  * } from "@evolu/common";
48
52
  * import {
49
53
  * decodeNonNegativeInt,
@@ -56,13 +60,17 @@ export declare class BufferError extends Error {
56
60
  * buffer.extend(idToIdBytes(id));
57
61
  *
58
62
  * const decoder = createBuffer(buffer.unwrap());
59
- * expect(decodeNonNegativeInt(decoder)).toBe(300);
63
+ * assertEqual(decodeNonNegativeInt(decoder), 300);
60
64
  * const decodedId = idBytesToId(
61
65
  * IdBytes.orThrow(decoder.shiftN(idBytesTypeValueLength)),
62
66
  * );
63
- * expect(decodedId).toBe(id);
64
- * expect(() => decodeNonNegativeInt(decoder)).toThrow(
65
- * "Buffer parse ended prematurely",
67
+ * assertEqual(decodedId, id);
68
+ * const result = trySync(() => decodeNonNegativeInt(decoder));
69
+ * assertErr(result);
70
+ * assert(
71
+ * result.error instanceof Error &&
72
+ * result.error.message === "Buffer parse ended prematurely",
73
+ * "Expected the premature-buffer-end error.",
66
74
  * );
67
75
  * ```
68
76
  *
@@ -1 +1 @@
1
- {"version":3,"file":"Buffer.d.ts","sourceRoot":"","sources":["../../src/Buffer.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,cAAc,EAAsB,MAAM,WAAW,CAAC;AAC/D,OAAO,EACL,UAAU,EACV,WAAW,EACX,WAAW,EACX,UAAU,EACV,WAAW,GACZ,MAAM,yBAAyB,CAAC;AAEjC;;;GAGG;AACH,qBAAa,WAAY,SAAQ,KAAK;IACpC,YAAY,OAAO,EAAE,MAAM,EAK1B;CACF;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwDG;AACH,MAAM,WAAW,MAAM;IACrB,kDAAkD;IAClD,WAAW,EAAE,MAAM,cAAc,CAAC;IAElC,gEAAgE;IAChE,SAAS,EAAE,MAAM,cAAc,CAAC;IAEhC;;;OAGG;IACH,MAAM,EAAE,CAAC,GAAG,EAAE,UAAU,GAAG,SAAS,CAAC,MAAM,CAAC,KAAK,IAAI,CAAC;IAEtD;;;OAGG;IACH,KAAK,EAAE,MAAM,cAAc,CAAC;IAE5B;;;OAGG;IACH,MAAM,EAAE,CAAC,CAAC,EAAE,cAAc,KAAK,UAAU,CAAC;IAE1C;;;OAGG;IACH,QAAQ,EAAE,CAAC,MAAM,EAAE,cAAc,KAAK,IAAI,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AAC,MAAM,CAAC,KACzC,MA4DF,CAAC"}
@@ -36,16 +36,21 @@ export interface Cache<K, V> {
36
36
  * ### Example
37
37
  *
38
38
  * ```ts
39
- * import { createLruCache, PositiveInt } from "@evolu/common";
39
+ * import {
40
+ * assertEqual,
41
+ * assertFalse,
42
+ * createLruCache,
43
+ * PositiveInt,
44
+ * } from "@evolu/common";
40
45
  *
41
46
  * const cache = createLruCache<string, number>(PositiveInt.orThrow(2));
42
47
  * cache.set("a", 1);
43
48
  * cache.set("b", 2);
44
49
  * // Reading "a" makes "b" the least recently used entry.
45
- * expect(cache.get("a")).toBe(1);
50
+ * assertEqual(cache.get("a"), 1);
46
51
  * cache.set("c", 3);
47
52
  *
48
- * expect(cache.has("b")).toBe(false);
53
+ * assertFalse(cache.has("b"));
49
54
  * ```
50
55
  */
51
56
  export declare const createLruCache: <K, V>(capacity: PositiveInt) => Cache<K, V>;
@@ -1 +1 @@
1
- {"version":3,"file":"Cache.d.ts","sourceRoot":"","sources":["../../src/Cache.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAExC;;;;;;;;;;GAUG;AACH,MAAM,WAAW,KAAK,CAAC,CAAC,EAAE,CAAC;IACzB,2CAA2C;IAC3C,GAAG,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,OAAO,CAAC;IAEzB,kEAAkE;IAClE,GAAG,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,GAAG,SAAS,CAAC;IAE/B,4CAA4C;IAC5C,GAAG,EAAE,CAAC,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,KAAK,IAAI,CAAC;IAE9B,oCAAoC;IACpC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,IAAI,CAAC;IAEzB,mDAAmD;IACnD,QAAQ,CAAC,GAAG,EAAE,WAAW,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;CACjC;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,cAAc,GAAI,CAAC,EAAE,CAAC,YAAY,WAAW,KAAG,KAAK,CAAC,CAAC,EAAE,CAAC,CAmCtE,CAAC"}
1
+ {"version":3,"file":"Cache.d.ts","sourceRoot":"","sources":["../../src/Cache.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAExC;;;;;;;;;;GAUG;AACH,MAAM,WAAW,KAAK,CAAC,CAAC,EAAE,CAAC;IACzB,2CAA2C;IAC3C,GAAG,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,OAAO,CAAC;IAEzB,kEAAkE;IAClE,GAAG,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,GAAG,SAAS,CAAC;IAE/B,4CAA4C;IAC5C,GAAG,EAAE,CAAC,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,KAAK,IAAI,CAAC;IAE9B,oCAAoC;IACpC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,IAAI,CAAC;IAEzB,mDAAmD;IACnD,QAAQ,CAAC,GAAG,EAAE,WAAW,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;CACjC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,cAAc,GAAI,CAAC,EAAE,CAAC,YAAY,WAAW,KAAG,KAAK,CAAC,CAAC,EAAE,CAAC,CAmCtE,CAAC"}
package/dist/src/Cache.js CHANGED
@@ -13,16 +13,21 @@ import { PositiveInt } from "./Type.js";
13
13
  * ### Example
14
14
  *
15
15
  * ```ts
16
- * import { createLruCache, PositiveInt } from "@evolu/common";
16
+ * import {
17
+ * assertEqual,
18
+ * assertFalse,
19
+ * createLruCache,
20
+ * PositiveInt,
21
+ * } from "@evolu/common";
17
22
  *
18
23
  * const cache = createLruCache<string, number>(PositiveInt.orThrow(2));
19
24
  * cache.set("a", 1);
20
25
  * cache.set("b", 2);
21
26
  * // Reading "a" makes "b" the least recently used entry.
22
- * expect(cache.get("a")).toBe(1);
27
+ * assertEqual(cache.get("a"), 1);
23
28
  * cache.set("c", 3);
24
29
  *
25
- * expect(cache.has("b")).toBe(false);
30
+ * assertFalse(cache.has("b"));
26
31
  * ```
27
32
  */
28
33
  export const createLruCache = (capacity) => {
@@ -22,7 +22,11 @@ import type { Callback } from "./Types.ts";
22
22
  * ### Correlating callback responses
23
23
  *
24
24
  * ```ts
25
- * import { createCallbacks, testCreateDeps } from "@evolu/common";
25
+ * import {
26
+ * assertEqual,
27
+ * createCallbacks,
28
+ * testCreateDeps,
29
+ * } from "@evolu/common";
26
30
  *
27
31
  * const deps = testCreateDeps();
28
32
  *
@@ -34,7 +38,7 @@ import type { Callback } from "./Types.ts";
34
38
  * });
35
39
  * callbacks.execute(noArgumentId);
36
40
  * callbacks.execute(noArgumentId);
37
- * expect(noArgumentCalls).toBe(1);
41
+ * assertEqual(noArgumentCalls, 1);
38
42
  *
39
43
  * // Typed callback
40
44
  * using stringCallbacks = createCallbacks<string>(deps);
@@ -43,14 +47,14 @@ import type { Callback } from "./Types.ts";
43
47
  * received = value;
44
48
  * });
45
49
  * stringCallbacks.execute(stringCallbackId, "hello");
46
- * expect(received).toBe("hello");
50
+ * assertEqual(received, "hello");
47
51
  *
48
52
  * // Promise.withResolvers
49
53
  * using promiseCallbacks = createCallbacks<string>(deps);
50
54
  * const { promise, resolve } = Promise.withResolvers<string>();
51
55
  * const promiseCallbackId = promiseCallbacks.register(resolve);
52
56
  * promiseCallbacks.execute(promiseCallbackId, "resolved value");
53
- * expect(await promise).toBe("resolved value");
57
+ * assertEqual(await promise, "resolved value");
54
58
  * ```
55
59
  *
56
60
  * @template T - The type of argument passed to callbacks (defaults to undefined
@@ -1 +1 @@
1
- {"version":3,"file":"Callbacks.d.ts","sourceRoot":"","sources":["../../src/Callbacks.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,cAAc,EA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