@evolu/common 8.0.0-next.5 → 8.0.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 (236) hide show
  1. package/dist/src/Array.d.ts +279 -173
  2. package/dist/src/Array.d.ts.map +1 -1
  3. package/dist/src/Array.js +105 -101
  4. package/dist/src/Assert.d.ts +39 -44
  5. package/dist/src/Assert.d.ts.map +1 -1
  6. package/dist/src/Assert.js +38 -31
  7. package/dist/src/BigInt.d.ts +6 -3
  8. package/dist/src/BigInt.d.ts.map +1 -1
  9. package/dist/src/BigInt.js +5 -2
  10. package/dist/src/Brand.d.ts +27 -40
  11. package/dist/src/Brand.d.ts.map +1 -1
  12. package/dist/src/Buffer.d.ts +27 -11
  13. package/dist/src/Buffer.d.ts.map +1 -1
  14. package/dist/src/Cache.d.ts +9 -4
  15. package/dist/src/Cache.d.ts.map +1 -1
  16. package/dist/src/Cache.js +8 -3
  17. package/dist/src/Callbacks.d.ts +30 -19
  18. package/dist/src/Callbacks.d.ts.map +1 -1
  19. package/dist/src/Console.d.ts +145 -66
  20. package/dist/src/Console.d.ts.map +1 -1
  21. package/dist/src/Console.js +91 -43
  22. package/dist/src/Crypto.d.ts +85 -42
  23. package/dist/src/Crypto.d.ts.map +1 -1
  24. package/dist/src/Crypto.js +44 -20
  25. package/dist/src/Eq.d.ts +87 -21
  26. package/dist/src/Eq.d.ts.map +1 -1
  27. package/dist/src/Eq.js +67 -19
  28. package/dist/src/Error.d.ts +3 -3
  29. package/dist/src/Error.d.ts.map +1 -1
  30. package/dist/src/Function.d.ts +119 -58
  31. package/dist/src/Function.d.ts.map +1 -1
  32. package/dist/src/Function.js +86 -43
  33. package/dist/src/Http.d.ts +394 -0
  34. package/dist/src/Http.d.ts.map +1 -0
  35. package/dist/src/Http.js +102 -0
  36. package/dist/src/Identicon.d.ts +16 -7
  37. package/dist/src/Identicon.d.ts.map +1 -1
  38. package/dist/src/Identicon.js +14 -5
  39. package/dist/src/LeakDetector.d.ts +88 -0
  40. package/dist/src/LeakDetector.d.ts.map +1 -0
  41. package/dist/src/LeakDetector.js +86 -0
  42. package/dist/src/LockManager.d.ts +18 -9
  43. package/dist/src/LockManager.d.ts.map +1 -1
  44. package/dist/src/LockManager.js +7 -8
  45. package/dist/src/Lookup.d.ts +43 -13
  46. package/dist/src/Lookup.d.ts.map +1 -1
  47. package/dist/src/Lookup.js +28 -8
  48. package/dist/src/Microtask.d.ts +1 -1
  49. package/dist/src/Microtask.d.ts.map +1 -1
  50. package/dist/src/Microtask.js +3 -7
  51. package/dist/src/Number.d.ts +49 -13
  52. package/dist/src/Number.d.ts.map +1 -1
  53. package/dist/src/Number.js +34 -5
  54. package/dist/src/Object.d.ts +160 -40
  55. package/dist/src/Object.d.ts.map +1 -1
  56. package/dist/src/Object.js +92 -46
  57. package/dist/src/Option.d.ts +10 -7
  58. package/dist/src/Option.d.ts.map +1 -1
  59. package/dist/src/Option.js +9 -6
  60. package/dist/src/Order.d.ts +21 -21
  61. package/dist/src/Order.d.ts.map +1 -1
  62. package/dist/src/Order.js +18 -21
  63. package/dist/src/Platform.d.ts +31 -0
  64. package/dist/src/Platform.d.ts.map +1 -1
  65. package/dist/src/Platform.js +98 -0
  66. package/dist/src/Random.d.ts +32 -17
  67. package/dist/src/Random.d.ts.map +1 -1
  68. package/dist/src/Random.js +12 -8
  69. package/dist/src/Redacted.d.ts +43 -29
  70. package/dist/src/Redacted.d.ts.map +1 -1
  71. package/dist/src/Redacted.js +14 -3
  72. package/dist/src/Ref.d.ts +11 -3
  73. package/dist/src/Ref.d.ts.map +1 -1
  74. package/dist/src/Ref.js +2 -2
  75. package/dist/src/RefCount.d.ts +2 -6
  76. package/dist/src/RefCount.d.ts.map +1 -1
  77. package/dist/src/RefCount.js +33 -90
  78. package/dist/src/Relation.d.ts +70 -5
  79. package/dist/src/Relation.d.ts.map +1 -1
  80. package/dist/src/Relation.js +77 -2
  81. package/dist/src/Resource.d.ts +590 -155
  82. package/dist/src/Resource.d.ts.map +1 -1
  83. package/dist/src/Resource.js +592 -343
  84. package/dist/src/Result.d.ts +838 -191
  85. package/dist/src/Result.d.ts.map +1 -1
  86. package/dist/src/Result.js +163 -102
  87. package/dist/src/Schedule.d.ts +684 -231
  88. package/dist/src/Schedule.d.ts.map +1 -1
  89. package/dist/src/Schedule.js +766 -295
  90. package/dist/src/Set.d.ts +89 -40
  91. package/dist/src/Set.d.ts.map +1 -1
  92. package/dist/src/Set.js +50 -29
  93. package/dist/src/Sqlite.d.ts +29 -72
  94. package/dist/src/Sqlite.d.ts.map +1 -1
  95. package/dist/src/Sqlite.js +39 -45
  96. package/dist/src/StackTrace.d.ts +40 -0
  97. package/dist/src/StackTrace.d.ts.map +1 -0
  98. package/dist/src/StackTrace.js +140 -0
  99. package/dist/src/Store.d.ts +5 -4
  100. package/dist/src/Store.d.ts.map +1 -1
  101. package/dist/src/Store.js +5 -4
  102. package/dist/src/String.d.ts +7 -1
  103. package/dist/src/String.d.ts.map +1 -1
  104. package/dist/src/String.js +20 -7
  105. package/dist/src/Task.d.ts +3428 -1629
  106. package/dist/src/Task.d.ts.map +1 -1
  107. package/dist/src/Task.js +1876 -1279
  108. package/dist/src/Test.d.ts +17 -124
  109. package/dist/src/Test.d.ts.map +1 -1
  110. package/dist/src/Test.js +17 -68
  111. package/dist/src/Time.d.ts +108 -49
  112. package/dist/src/Time.d.ts.map +1 -1
  113. package/dist/src/Time.js +172 -73
  114. package/dist/src/Type.d.ts +3542 -1926
  115. package/dist/src/Type.d.ts.map +1 -1
  116. package/dist/src/Type.js +3070 -1784
  117. package/dist/src/Types.d.ts +200 -100
  118. package/dist/src/Types.d.ts.map +1 -1
  119. package/dist/src/Types.js +39 -8
  120. package/dist/src/WebSocket.d.ts +48 -23
  121. package/dist/src/WebSocket.d.ts.map +1 -1
  122. package/dist/src/WebSocket.js +15 -6
  123. package/dist/src/Worker.d.ts +94 -36
  124. package/dist/src/Worker.d.ts.map +1 -1
  125. package/dist/src/Worker.js +58 -24
  126. package/dist/src/index.d.ts +55 -52
  127. package/dist/src/index.d.ts.map +1 -1
  128. package/dist/src/index.js +3 -1
  129. package/dist/src/intl/cs.d.ts +94 -0
  130. package/dist/src/intl/cs.d.ts.map +1 -0
  131. package/dist/src/intl/cs.js +220 -0
  132. package/dist/src/intl/index.d.ts +7 -0
  133. package/dist/src/intl/index.d.ts.map +1 -0
  134. package/dist/src/intl/index.js +6 -0
  135. package/dist/src/local-first/Db.d.ts +12 -8
  136. package/dist/src/local-first/Db.d.ts.map +1 -1
  137. package/dist/src/local-first/Db.js +107 -130
  138. package/dist/src/local-first/Error.d.ts +4 -4
  139. package/dist/src/local-first/Evolu.d.ts +338 -92
  140. package/dist/src/local-first/Evolu.d.ts.map +1 -1
  141. package/dist/src/local-first/Evolu.js +47 -55
  142. package/dist/src/local-first/LocalAuth.d.ts +4 -4
  143. package/dist/src/local-first/LocalAuth.d.ts.map +1 -1
  144. package/dist/src/local-first/Owner.d.ts +61 -24
  145. package/dist/src/local-first/Owner.d.ts.map +1 -1
  146. package/dist/src/local-first/Owner.js +45 -8
  147. package/dist/src/local-first/Protocol.d.ts +44 -31
  148. package/dist/src/local-first/Protocol.d.ts.map +1 -1
  149. package/dist/src/local-first/Protocol.js +36 -13
  150. package/dist/src/local-first/Query.d.ts +147 -62
  151. package/dist/src/local-first/Query.d.ts.map +1 -1
  152. package/dist/src/local-first/Query.js +112 -58
  153. package/dist/src/local-first/Relay.d.ts +44 -14
  154. package/dist/src/local-first/Relay.d.ts.map +1 -1
  155. package/dist/src/local-first/Schema.d.ts +92 -41
  156. package/dist/src/local-first/Schema.d.ts.map +1 -1
  157. package/dist/src/local-first/Schema.js +25 -8
  158. package/dist/src/local-first/Shared.d.ts +23 -21
  159. package/dist/src/local-first/Shared.d.ts.map +1 -1
  160. package/dist/src/local-first/Shared.js +85 -42
  161. package/dist/src/local-first/Storage.d.ts +53 -32
  162. package/dist/src/local-first/Storage.d.ts.map +1 -1
  163. package/dist/src/local-first/Storage.js +194 -234
  164. package/dist/src/local-first/Timestamp.d.ts +21 -21
  165. package/dist/src/local-first/Timestamp.d.ts.map +1 -1
  166. package/dist/src/local-first/Timestamp.js +2 -2
  167. package/dist/src/local-first/index.d.ts +11 -11
  168. package/package.json +14 -13
  169. package/src/Array.ts +306 -205
  170. package/src/Assert.ts +48 -68
  171. package/src/BigInt.ts +6 -3
  172. package/src/Brand.ts +27 -40
  173. package/src/Buffer.ts +28 -12
  174. package/src/Cache.ts +9 -4
  175. package/src/Callbacks.ts +30 -19
  176. package/src/Console.ts +156 -84
  177. package/src/Crypto.ts +83 -41
  178. package/src/Eq.ts +95 -22
  179. package/src/Error.ts +5 -2
  180. package/src/Function.ts +167 -59
  181. package/src/Http.ts +549 -0
  182. package/src/Identicon.ts +16 -7
  183. package/src/LeakDetector.ts +182 -0
  184. package/src/LockManager.ts +43 -39
  185. package/src/Lookup.ts +62 -28
  186. package/src/Microtask.ts +19 -23
  187. package/src/Number.ts +64 -12
  188. package/src/Object.ts +173 -49
  189. package/src/Option.ts +10 -7
  190. package/src/Order.ts +23 -21
  191. package/src/Platform.ts +136 -0
  192. package/src/Polyfills.ts +6 -12
  193. package/src/Random.ts +32 -19
  194. package/src/Redacted.ts +44 -30
  195. package/src/Ref.ts +14 -6
  196. package/src/RefCount.ts +38 -80
  197. package/src/Relation.ts +202 -10
  198. package/src/Resource.ts +1199 -591
  199. package/src/Result.ts +930 -271
  200. package/src/Schedule.ts +859 -343
  201. package/src/Set.ts +89 -40
  202. package/src/Sqlite.ts +142 -137
  203. package/src/StackTrace.ts +230 -0
  204. package/src/Store.ts +8 -7
  205. package/src/String.ts +22 -5
  206. package/src/Task.ts +5109 -2845
  207. package/src/Test.ts +20 -167
  208. package/src/Time.ts +293 -90
  209. package/src/Type.ts +10034 -4117
  210. package/src/Types.ts +227 -101
  211. package/src/WebSocket.ts +64 -36
  212. package/src/Worker.ts +180 -72
  213. package/src/index.ts +55 -52
  214. package/src/intl/cs.ts +388 -0
  215. package/src/intl/index.ts +7 -0
  216. package/src/local-first/Db.ts +161 -190
  217. package/src/local-first/Error.ts +4 -4
  218. package/src/local-first/Evolu.ts +495 -250
  219. package/src/local-first/LocalAuth.ts +6 -12
  220. package/src/local-first/Owner.ts +58 -21
  221. package/src/local-first/Protocol.ts +49 -31
  222. package/src/local-first/Query.ts +146 -61
  223. package/src/local-first/Relay.ts +51 -21
  224. package/src/local-first/Schema.ts +109 -51
  225. package/src/local-first/Shared.ts +253 -214
  226. package/src/local-first/Storage.ts +266 -264
  227. package/src/local-first/Timestamp.ts +25 -18
  228. package/src/local-first/index.ts +11 -11
  229. package/dist/src/Skiplist.d.ts +0 -28
  230. package/dist/src/Skiplist.d.ts.map +0 -1
  231. package/dist/src/Skiplist.js +0 -64
  232. package/dist/src/Tracer.d.ts +0 -48
  233. package/dist/src/Tracer.d.ts.map +0 -1
  234. package/dist/src/Tracer.js +0 -6
  235. package/src/Skiplist.ts +0 -108
  236. package/src/Tracer.ts +0 -54
@@ -1 +1 @@
1
- {"version":3,"file":"Microtask.d.ts","sourceRoot":"","sources":["../../src/Microtask.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAiB,KAAK,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAGvE;;;;;GAKG;AACH,MAAM,WAAW,cAAc,CAAC,CAAC,CAAE,SAAQ,UAAU;IACnD,mEAAmE;IACnE,QAAQ,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,IAAI,CAAC;IAEjC,wCAAwC;IACxC,QAAQ,CAAC,QAAQ,EAAE,MAAM,IAAI,CAAC;CAC/B;AAED,sCAAsC;AACtC,eAAO,MAAM,oBAAoB,GAAI,CAAC,EACpC,SAAS,CAAC,KAAK,EAAE,qBAAqB,CAAC,CAAC,CAAC,KAAK,IAAI,KACjD,cAAc,CAAC,CAAC,CAqClB,CAAC"}
1
+ {"version":3,"file":"Microtask.d.ts","sourceRoot":"","sources":["../../src/Microtask.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAiB,KAAK,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAGvE;;;;;GAKG;AACH,MAAM,WAAW,cAAc,CAAC,CAAC,CAAE,SAAQ,UAAU;IACnD,mEAAmE;IACnE,QAAQ,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,IAAI,CAAC;IAEjC,wCAAwC;IACxC,QAAQ,CAAC,QAAQ,EAAE,MAAM,IAAI,CAAC;CAC/B;AAED,sCAAsC;AACtC,eAAO,MAAM,oBAAoB,GAAI,CAAC,WAC3B,CAAC,KAAK,EAAE,qBAAqB,CAAC,CAAC,CAAC,KAAK,IAAI,KACjD,cAAc,CAAC,CAAC,CAiClB,CAAC"}
@@ -56,7 +56,7 @@ var __disposeResources = (this && this.__disposeResources) || (function (Suppres
56
56
  return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
57
57
  });
58
58
  import { appendToArray } from "./Array.js";
59
- import { assertNotDisposed } from "./Assert.js";
59
+ import { disposable } from "./Function.js";
60
60
  /** Creates {@link MicrotaskBatch}. */
61
61
  export const createMicrotaskBatch = (onFlush) => {
62
62
  const env_1 = { stack: [], error: void 0, hasError: false };
@@ -66,7 +66,6 @@ export const createMicrotaskBatch = (onFlush) => {
66
66
  disposer.defer(() => {
67
67
  queue = null;
68
68
  });
69
- const disposables = disposer.move();
70
69
  const flushQueuedItems = () => {
71
70
  if (queue == null)
72
71
  return;
@@ -74,9 +73,8 @@ export const createMicrotaskBatch = (onFlush) => {
74
73
  queue = null;
75
74
  onFlush(queuedItems);
76
75
  };
77
- return {
76
+ return disposable({
78
77
  push: (item) => {
79
- assertNotDisposed(disposables);
80
78
  if (queue == null) {
81
79
  queue = [item];
82
80
  queueMicrotask(flushQueuedItems);
@@ -85,11 +83,9 @@ export const createMicrotaskBatch = (onFlush) => {
85
83
  queue = appendToArray(queue, item);
86
84
  },
87
85
  flushNow: () => {
88
- assertNotDisposed(disposables);
89
86
  flushQueuedItems();
90
87
  },
91
- [Symbol.dispose]: () => disposables.dispose(),
92
- };
88
+ }, disposer);
93
89
  }
94
90
  catch (e_1) {
95
91
  env_1.error = e_1;
@@ -3,12 +3,25 @@
3
3
  *
4
4
  * @module
5
5
  */
6
- import type { NonEmptyReadonlyArray } from "./Array.js";
7
- import type { IsBranded } from "./Brand.js";
8
- import type { Result } from "./Result.js";
9
- import { NonNegativeInt, PositiveInt } from "./Type.js";
10
- import type { Predicate, WidenLiteral } from "./Types.js";
6
+ import type { NonEmptyReadonlyArray } from "./Array.ts";
7
+ import type { IsBranded } from "./Brand.ts";
8
+ import type { Result } from "./Result.ts";
9
+ import { NonNegativeInt, PositiveInt, Ratio } from "./Type.ts";
10
+ import type { Digit, Digit1To9, Digit1To99, Predicate, WidenLiteral } from "./Types.ts";
11
+ /** Percentage represented as a readable literal or a validated ratio. */
12
+ export type Percentage = PercentageLiteral | Ratio;
13
+ /**
14
+ * Percentage literal from `"0%"` to `"100%"`.
15
+ *
16
+ * Decimal literals support one decimal place. Use {@link Ratio} for computed
17
+ * values or greater precision.
18
+ */
19
+ export type PercentageLiteral = "0%" | "100%" | `${Digit1To99}%` | `${Digit | Digit1To99}.${Digit1To9}%`;
20
+ /** Converts a {@link Percentage} to its numeric {@link Ratio}. */
21
+ export declare const percentageToRatio: (percentage: Percentage) => Ratio;
11
22
  export declare const increment: (n: number) => number;
23
+ /** Increments a positive integer, saturating at the maximum safe integer. */
24
+ export declare const incrementPositiveInt: (n: PositiveInt) => PositiveInt;
12
25
  export declare const decrement: (n: number) => number;
13
26
  /** Clamps a number within a given range. */
14
27
  export declare const clamp: (min: number, max: number) => (n: number) => number;
@@ -18,9 +31,12 @@ export declare const clamp: (min: number, max: number) => (n: number) => number;
18
31
  * ### Example
19
32
  *
20
33
  * ```ts
34
+ * import { isBetween } from "@evolu/common";
35
+ *
21
36
  * const isBetween10And20 = isBetween(10, 20);
22
- * console.log(isBetween10And20(15)); // true
23
- * console.log(isBetween10And20(25)); // false
37
+ *
38
+ * expect(isBetween10And20(20)).toBe(true);
39
+ * expect(isBetween10And20(25)).toBe(false);
24
40
  * ```
25
41
  */
26
42
  export declare const isBetween: (min: number, max: number) => Predicate<number>;
@@ -36,22 +52,42 @@ export declare const max: <T extends number>(...values: [T, ...ReadonlyArray<T>]
36
52
  * ### Example
37
53
  *
38
54
  * ```ts
39
- * computeBalancedBuckets(10, 3, 2); // Returns ok([4, 7, 10])
40
- * computeBalancedBuckets(5, 3, 2); // Returns err(6)
55
+ * import {
56
+ * computeBalancedBuckets,
57
+ * NonNegativeInt,
58
+ * PositiveInt,
59
+ * } from "@evolu/common";
60
+ *
61
+ * expectOk(
62
+ * computeBalancedBuckets(
63
+ * NonNegativeInt.orThrow(10),
64
+ * PositiveInt.orThrow(3),
65
+ * PositiveInt.orThrow(2),
66
+ * ),
67
+ * [4, 7, 10],
68
+ * );
69
+ * expectErr(
70
+ * computeBalancedBuckets(
71
+ * NonNegativeInt.orThrow(5),
72
+ * PositiveInt.orThrow(3),
73
+ * PositiveInt.orThrow(2),
74
+ * ),
75
+ * 6,
76
+ * );
41
77
  * ```
42
78
  */
43
79
  export declare const computeBalancedBuckets: (numberOfItems: NonNegativeInt,
44
80
  /** Default: 16 */
45
- numberOfBuckets?: number & import("./Brand.js").Brand<"Int"> & import("./Brand.js").Brand<"NonNegative"> & import("./Brand.js").Brand<"Positive">,
81
+ numberOfBuckets?: number & import("./Brand.ts").Brand<"NonNaN"> & import("./Brand.ts").Brand<"Finite"> & import("./Brand.ts").Brand<"Int"> & import("./Brand.ts").Brand<"NonNegative"> & import("./Brand.ts").Brand<"Positive">,
46
82
  /** Default: 2 */
47
- minNumberOfItemsPerBucket?: number & import("./Brand.js").Brand<"Int"> & import("./Brand.js").Brand<"NonNegative"> & import("./Brand.js").Brand<"Positive">) => Result<NonEmptyReadonlyArray<PositiveInt>, PositiveInt>;
83
+ minNumberOfItemsPerBucket?: number & import("./Brand.ts").Brand<"NonNaN"> & import("./Brand.ts").Brand<"Finite"> & import("./Brand.ts").Brand<"Int"> & import("./Brand.ts").Brand<"NonNegative"> & import("./Brand.ts").Brand<"Positive">) => Result<NonEmptyReadonlyArray<PositiveInt>, PositiveInt>;
48
84
  /**
49
85
  * Valid index for {@link fibonacciAt}, constrained to 1-78.
50
86
  *
51
87
  * Limited to 78 because F(79) exceeds JavaScript's `MAX_SAFE_INTEGER`.
52
88
  */
53
- export declare const FibonacciIndex: import("./Type.js").BrandType<import("./Type.js").BrandType<import("./Type.js").Type<"Brand", number & import("./Brand.js").Brand<"Int"> & import("./Brand.js").Brand<"NonNegative"> & import("./Brand.js").Brand<"Positive">, number, import("./Type.js").PositiveError, number & import("./Brand.js").Brand<"Int"> & import("./Brand.js").Brand<"NonNegative">, import("./Type.js").NumberError | import("./Type.js").NonNegativeError | import("./Type.js").IntError>, "LessThanOrEqualTo78", import("./Type.js").LessThanOrEqualToError<78>, import("./Type.js").NumberError | import("./Type.js").NonNegativeError | import("./Type.js").IntError | import("./Type.js").PositiveError>, "FibonacciIndex", import("./Type.js").BrandWithoutRefineError<"FibonacciIndex", import("./Type.js").NumberError | import("./Type.js").NonNegativeError | import("./Type.js").IntError | import("./Type.js").PositiveError | import("./Type.js").LessThanOrEqualToError<78>>, never>;
54
- export type FibonacciIndex = typeof FibonacciIndex.Type;
89
+ export declare const FibonacciIndex: import("./Type.ts").BrandType<import("./Type.ts").BrandType<import("./Type.ts").BrandType<import("./Type.ts").BrandType<import("./Type.ts").BrandType<import("./Type.ts").BrandType<import("./Type.ts").BrandType<import("./Type.ts").Type<"Number", number, number, import("./Type.ts").TypeOfError<"Number">, null, import("./Type.ts").TypeOfError<"Number">, never, number, true>, "NonNaN", import("./Type.ts").NonNaNError>, "Finite", import("./Type.ts").FiniteError>, "Int", import("./Type.ts").IntError>, "NonNegative", import("./Type.ts").NonNegativeError>, "Positive", import("./Type.ts").PositiveError>, "LessThanOrEqualTo78", import("./Type.ts").LessThanOrEqualToError<78>>, "FibonacciIndex", never>;
90
+ export type FibonacciIndex = typeof FibonacciIndex.Output;
55
91
  /** Returns the Fibonacci number at the given index (1-indexed: 1,1,2,3,5,8,...). */
56
92
  export declare const fibonacciAt: (index: FibonacciIndex) => PositiveInt;
57
93
  //# sourceMappingURL=Number.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Number.d.ts","sourceRoot":"","sources":["../../src/Number.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAExD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C,OAAO,EAIL,cAAc,EACd,WAAW,EACZ,MAAM,WAAW,CAAC;AACnB,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE1D,eAAO,MAAM,SAAS,GAAI,GAAG,MAAM,KAAG,MAAe,CAAC;AAEtD,eAAO,MAAM,SAAS,GAAI,GAAG,MAAM,KAAG,MAAe,CAAC;AAEtD,4CAA4C;AAC5C,eAAO,MAAM,KAAK,GACf,KAAK,MAAM,EAAE,KAAK,MAAM,MACxB,GAAG,MAAM,KAAG,MACoB,CAAC;AAEpC;;;;;;;;;;GAUG;AACH,eAAO,MAAM,SAAS,GACnB,KAAK,MAAM,EAAE,KAAK,MAAM,KAAG,SAAS,CAAC,MAAM,CAEd,CAAC;AAEjC,wEAAwE;AACxE,eAAO,MAAM,GAAG,GAAI,CAAC,SAAS,MAAM,EAClC,GAAG,QAAQ,CAAC,CAAC,EAAE,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC,KAClC,SAAS,CAAC,CAAC,CAAC,SAAS,IAAI,GAAG,CAAC,GAAG,YAAY,CAAC,CAAC,CACE,CAAC;AAEpD,wEAAwE;AACxE,eAAO,MAAM,GAAG,GAAI,CAAC,SAAS,MAAM,EAClC,GAAG,QAA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*/
6
6
  import { assertNonEmptyReadonlyArray } from "./Assert.js";
7
7
  import { err, ok } from "./Result.js";
8
- import { brand, lessThanOrEqualTo, onePositiveInt, NonNegativeInt, PositiveInt, } from "./Type.js";
8
+ import { brand, lessThanOrEqualTo, onePositiveInt, NonNegativeInt, PositiveInt, Ratio, } from "./Type.js";
9
+ /** Converts a {@link Percentage} to its numeric {@link Ratio}. */
10
+ export const percentageToRatio = (percentage) => typeof percentage === "number"
11
+ ? percentage
12
+ : Ratio.orThrow(globalThis.Number.parseFloat(percentage) / 100);
9
13
  export const increment = (n) => n + 1;
14
+ /** Increments a positive integer, saturating at the maximum safe integer. */
15
+ export const incrementPositiveInt = (n) => PositiveInt.orNull(increment(n)) ?? n;
10
16
  export const decrement = (n) => n - 1;
11
17
  /** Clamps a number within a given range. */
12
18
  export const clamp = (min, max) => (n) => Math.min(Math.max(n, min), max);
@@ -16,9 +22,12 @@ export const clamp = (min, max) => (n) => Math.min(Math.max(n, min), max);
16
22
  * ### Example
17
23
  *
18
24
  * ```ts
25
+ * import { isBetween } from "@evolu/common";
26
+ *
19
27
  * const isBetween10And20 = isBetween(10, 20);
20
- * console.log(isBetween10And20(15)); // true
21
- * console.log(isBetween10And20(25)); // false
28
+ *
29
+ * expect(isBetween10And20(20)).toBe(true);
30
+ * expect(isBetween10And20(25)).toBe(false);
22
31
  * ```
23
32
  */
24
33
  export const isBetween = (min, max) => (value) => value >= min && value <= max;
@@ -34,8 +43,28 @@ export const max = (...values) => values.reduce((a, b) => (a > b ? a : b));
34
43
  * ### Example
35
44
  *
36
45
  * ```ts
37
- * computeBalancedBuckets(10, 3, 2); // Returns ok([4, 7, 10])
38
- * computeBalancedBuckets(5, 3, 2); // Returns err(6)
46
+ * import {
47
+ * computeBalancedBuckets,
48
+ * NonNegativeInt,
49
+ * PositiveInt,
50
+ * } from "@evolu/common";
51
+ *
52
+ * expectOk(
53
+ * computeBalancedBuckets(
54
+ * NonNegativeInt.orThrow(10),
55
+ * PositiveInt.orThrow(3),
56
+ * PositiveInt.orThrow(2),
57
+ * ),
58
+ * [4, 7, 10],
59
+ * );
60
+ * expectErr(
61
+ * computeBalancedBuckets(
62
+ * NonNegativeInt.orThrow(5),
63
+ * PositiveInt.orThrow(3),
64
+ * PositiveInt.orThrow(2),
65
+ * ),
66
+ * 6,
67
+ * );
39
68
  * ```
40
69
  */
41
70
  export const computeBalancedBuckets = (numberOfItems,
@@ -20,15 +20,20 @@ export type ReadonlyRecord<K extends keyof any, V> = Readonly<Record<K, V>>;
20
20
  * Object.prototype` so it also works for plain objects coming from another
21
21
  * JavaScript realm.
22
22
  *
23
+ * TODO: deprecated Use `Object.is` from Type. Define a dedicated Type when
24
+ * another object domain is required.
25
+ *
23
26
  * ### Example
24
27
  *
25
28
  * ```ts
26
- * isPlainObject({}); // true
27
- * isPlainObject(Object.create(null)); // true
28
- * isPlainObject(new Date()); // false
29
- * isPlainObject(new (class Example {})()); // false
30
- * isPlainObject([]); // false
31
- * isPlainObject(null); // false
29
+ * import { isPlainObject } from "@evolu/common";
30
+ *
31
+ * expect(isPlainObject({})).toBe(true);
32
+ * expect(isPlainObject(Object.create(null))).toBe(true);
33
+ * expect(isPlainObject(new Date())).toBe(false);
34
+ * expect(isPlainObject(new (class Example {})())).toBe(false);
35
+ * expect(isPlainObject([])).toBe(false);
36
+ * expect(isPlainObject(null)).toBe(false);
32
37
  * ```
33
38
  */
34
39
  export declare const isPlainObject: (value: unknown) => value is Record<string, unknown>;
@@ -38,9 +43,11 @@ export declare const isPlainObject: (value: unknown) => value is Record<string,
38
43
  * ### Example
39
44
  *
40
45
  * ```ts
41
- * isFunction(() => {}); // true
42
- * isFunction(function () {}); // true
43
- * isFunction({}); // false
46
+ * import { isFunction } from "@evolu/common";
47
+ *
48
+ * expect(isFunction(() => {})).toBe(true);
49
+ * expect(isFunction(function () {})).toBe(true);
50
+ * expect(isFunction({})).toBe(false);
44
51
  * ```
45
52
  */
46
53
  export declare const isFunction: (value: unknown) => value is globalThis.Function;
@@ -50,9 +57,11 @@ export declare const isFunction: (value: unknown) => value is globalThis.Functio
50
57
  * ### Example
51
58
  *
52
59
  * ```ts
53
- * isIterable([1, 2, 3]); // true
54
- * isIterable("abc"); // true
55
- * isIterable({}); // false
60
+ * import { isIterable } from "@evolu/common";
61
+ *
62
+ * expect(isIterable([1, 2, 3])).toBe(true);
63
+ * expect(isIterable("abc")).toBe(true);
64
+ * expect(isIterable({})).toBe(false);
56
65
  * ```
57
66
  */
58
67
  export declare const isIterable: (value: unknown) => value is Iterable<unknown>;
@@ -62,9 +71,20 @@ export declare const isIterable: (value: unknown) => value is Iterable<unknown>;
62
71
  * ### Example
63
72
  *
64
73
  * ```ts
65
- * type UserId = string & { readonly __brand: "UserId" };
66
- * const users = createRecord<UserId, string>();
67
- * const entries = objectToEntries(users); // [UserId, string][]
74
+ * import {
75
+ * objectToEntries,
76
+ * type Brand,
77
+ * type ReadonlyRecord,
78
+ * } from "@evolu/common";
79
+ *
80
+ * type UserId = string & Brand<"UserId">;
81
+ *
82
+ * const userId = "u1" as UserId;
83
+ * const users: ReadonlyRecord<UserId, string> = { [userId]: "Alice" };
84
+ * const entries = objectToEntries(users);
85
+ *
86
+ * expectTypeOf(entries).toEqualTypeOf<ReadonlyArray<[UserId, string]>>();
87
+ * expect(entries).toEqual([[userId, "Alice"]]);
68
88
  * ```
69
89
  */
70
90
  export declare const objectToEntries: <T extends Record<string, any>>(record: T) => ReadonlyArray<[StringKeyOf<T>, T[StringKeyOf<T>]]>;
@@ -78,11 +98,20 @@ type StringKeyOf<T> = Extract<keyof T, string>;
78
98
  * ### Example
79
99
  *
80
100
  * ```ts
81
- * type UserId = string & { readonly __brand: "UserId" };
101
+ * import {
102
+ * objectFromEntries,
103
+ * type Brand,
104
+ * type ReadonlyRecord,
105
+ * } from "@evolu/common";
106
+ *
107
+ * type UserId = string & Brand<"UserId">;
82
108
  * const entries: ReadonlyArray<[UserId, string]> = [
83
109
  * ["u1" as UserId, "Alice"],
84
110
  * ];
85
- * const users = objectFromEntries(entries); // ReadonlyRecord<UserId, string>
111
+ * const users = objectFromEntries(entries);
112
+ *
113
+ * expectTypeOf(users).toEqualTypeOf<ReadonlyRecord<UserId, string>>();
114
+ * expect(users).toEqual({ u1: "Alice" });
86
115
  * ```
87
116
  */
88
117
  export declare const objectFromEntries: <K extends string, V>(entries: Iterable<readonly [K, V]>) => ReadonlyRecord<K, V>;
@@ -95,11 +124,20 @@ export declare const objectFromEntries: <K extends string, V>(entries: Iterable<
95
124
  * ### Example
96
125
  *
97
126
  * ```ts
98
- * objectFrom(["en", "fr", "de"], loadTranslations);
99
- * // { en: Translations, fr: Translations, de: Translations }
127
+ * import { objectFrom, type ReadonlyRecord } from "@evolu/common";
100
128
  *
101
- * objectFrom(["trace", "debug", "log"], (level) => createHandler(level));
102
- * // { trace: Handler, debug: Handler, log: Handler }
129
+ * const translations = objectFrom(
130
+ * ["en", "fr"] as const,
131
+ * (locale): string => `Hello in ${locale}`,
132
+ * );
133
+ *
134
+ * expectTypeOf(translations).toEqualTypeOf<
135
+ * ReadonlyRecord<"en" | "fr", string>
136
+ * >();
137
+ * expect(translations).toEqual({
138
+ * en: "Hello in en",
139
+ * fr: "Hello in fr",
140
+ * });
103
141
  * ```
104
142
  */
105
143
  export declare const objectFrom: <K extends string, V>(keys: ReadonlyArray<K>, getValue: (key: K) => V) => ReadonlyRecord<K, V>;
@@ -112,44 +150,123 @@ export declare const mapObject: <K extends string, V, U>(record: ReadonlyRecord<
112
150
  /** Conditionally excludes a property from an object. */
113
151
  export declare const excludeProp: <T extends object, K extends keyof T>(obj: T, prop: K, condition?: boolean) => typeof condition extends true ? T : Omit<T, K>;
114
152
  /**
115
- * Creates a prototype-less object typed as `Record<K, V>`.
153
+ * Creates a mutable Record.
154
+ *
155
+ * Use it to build a Record locally through mutation, avoiding repeated object
156
+ * spreads. Keep mutation scoped to the constructing function, and treat the
157
+ * completed Record as immutable after it leaves that scope. When a source is
158
+ * provided, its own enumerable properties are shallow-copied. Inherited and
159
+ * non-enumerable properties are not copied.
160
+ *
161
+ * The Record is created with `Object.create(null)`, so any string can be used
162
+ * as a key while it is being built. Missing keys such as `toString` and
163
+ * `constructor` do not resolve to inherited values, and assigning `__proto__`
164
+ * creates an own data property instead of changing the prototype.
165
+ *
166
+ * The null prototype makes dynamic construction safer, but it does not have to
167
+ * be preserved. Spreading the completed Record into an ordinary object is
168
+ * supported. Use {@link getOwnProp} when a lookup must read only own
169
+ * properties.
170
+ *
171
+ * For immutable empty application data, defaults, or placeholders, use
172
+ * {@link emptyRecord}.
173
+ *
174
+ * ### Example
175
+ *
176
+ * ```ts
177
+ * import { createMutableRecord } from "@evolu/common";
116
178
  *
117
- * Use this function when you need a plain record without a prototype chain
118
- * (e.g. when keys are controlled by external sources) to avoid prototype
119
- * pollution and accidental collisions with properties like `__proto__`.
179
+ * const createValuesByKey = (
180
+ * entries: ReadonlyArray<readonly [string, number]>,
181
+ * ): Readonly<Record<string, number>> => {
182
+ * const valuesByKey = createMutableRecord<string, number>();
120
183
  *
121
- * Example:
184
+ * for (const [key, value] of entries) {
185
+ * valuesByKey[key] = value;
186
+ * }
187
+ *
188
+ * return valuesByKey;
189
+ * };
190
+ *
191
+ * expect(
192
+ * createValuesByKey([
193
+ * ["a", 1],
194
+ * ["b", 2],
195
+ * ]),
196
+ * ).toEqual({ a: 1, b: 2 });
197
+ * ```
198
+ *
199
+ * Note that TypeScript does not model an object's runtime prototype. A plain
200
+ * TypeScript Record exposes `Object.prototype` members even when the runtime
201
+ * object has a `null` prototype:
202
+ *
203
+ * ```ts
204
+ * const values = Object.create(null) as Record<string, number>;
205
+ *
206
+ * // TypeScript accepts the call, but `toString` is undefined at runtime.
207
+ * expect(() => values.toString()).toThrow(TypeError);
208
+ * ```
209
+ *
210
+ * `createMutableRecord` uses the same TypeScript Record representation.
122
211
  *
123
212
  * ```ts
124
- * const values = createRecord<string, SqliteValue>();
125
- * values["__proto__"] = someValue; // safe, no prototype pollution
213
+ * import { createMutableRecord } from "@evolu/common";
214
+ *
215
+ * const values = createMutableRecord<string, number>();
216
+ *
217
+ * // TypeScript accepts the call, but `toString` is undefined at runtime.
218
+ * expect(() => values.toString()).toThrow(TypeError);
126
219
  * ```
220
+ *
221
+ * In other words, treat the returned object as string-keyed data rather than
222
+ * calling inherited object methods through it.
127
223
  */
128
- export declare const createRecord: <K extends string = string, V = unknown>() => Record<K, V>;
224
+ export declare function createMutableRecord<K extends string = string, V = unknown>(): Record<K, V>;
225
+ export declare function createMutableRecord<T extends object>(source: T): {
226
+ -readonly [K in keyof T]: T[K];
227
+ };
129
228
  /**
130
- * An empty readonly record.
229
+ * A shared frozen empty readonly Record.
131
230
  *
132
- * Use as a default or initial value to avoid allocating new empty records.
231
+ * Use it as an immutable empty value for defaults and placeholders instead of
232
+ * allocating a new empty object. Because the instance is shared, it is frozen
233
+ * to prevent accidental mutation.
234
+ *
235
+ * Use {@link createMutableRecord} to build a Record locally through mutation
236
+ * instead of repeated object spreads.
133
237
  *
134
238
  * @group Constants
135
239
  */
136
240
  export declare const emptyRecord: Readonly<Record<string, never>>;
137
241
  /**
138
- * Safely gets a property from a record, returning `undefined` if the key
139
- * doesn't exist.
242
+ * Gets an own property from a record, returning `undefined` if the key is
243
+ * missing or inherited.
140
244
  *
141
245
  * TypeScript's `Record<K, V>` type assumes all keys exist, but at runtime
142
- * accessing a non-existent key returns `undefined`. This helper provides proper
143
- * typing for that case without needing a type assertion.
246
+ * accessing a missing key returns `undefined`. This helper provides proper
247
+ * typing for that case without treating properties inherited from
248
+ * `Object.prototype` as record data.
144
249
  *
145
250
  * ### Example
146
251
  *
147
252
  * ```ts
148
- * const users: Record<string, User> = { alice: { name: "Alice" } };
149
- * const user = getProperty(users, "bob"); // User | undefined
253
+ * import { getOwnProp } from "@evolu/common";
254
+ *
255
+ * interface User {
256
+ * readonly name: string;
257
+ * }
258
+ *
259
+ * const users: Readonly<Record<string, User>> = {
260
+ * alice: { name: "Alice" },
261
+ * };
262
+ * const user = getOwnProp(users, "bob");
263
+ *
264
+ * expectTypeOf(user).toEqualTypeOf<User | undefined>();
265
+ * expect(user).toBeUndefined();
266
+ * expect(getOwnProp(users, "toString")).toBeUndefined();
150
267
  * ```
151
268
  */
152
- export declare const getProperty: <K extends string, V>(record: ReadonlyRecord<K, V>, key: K) => V | undefined;
269
+ export declare const getOwnProp: <K extends string, V>(record: ReadonlyRecord<K, V>, key: NoInfer<K>) => V | undefined;
153
270
  /**
154
271
  * A disposable wrapper around `URL.createObjectURL` that automatically revokes
155
272
  * the URL when disposed. Use with the `using` declaration for automatic
@@ -158,10 +275,13 @@ export declare const getProperty: <K extends string, V>(record: ReadonlyRecord<K
158
275
  * ### Example
159
276
  *
160
277
  * ```ts
278
+ * import { createObjectURL } from "@evolu/common";
279
+ *
161
280
  * const blob = new Blob(["hello"], { type: "text/plain" });
162
281
  * using objectUrl = createObjectURL(blob);
163
- * console.log(objectUrl.url); // blob:...
164
- * // URL.revokeObjectURL is automatically called when the scope ends
282
+ *
283
+ * expect(objectUrl.url).toMatch(/^blob:/);
284
+ * // URL.revokeObjectURL is automatically called when the scope ends.
165
285
  * ```
166
286
  *
167
287
  * This ensures the URL is always revoked when the scope ends, even if an error
@@ -1 +1 @@
1
- {"version":3,"file":"Object.d.ts","sourceRoot":"","sources":["../../src/Object.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;GAGG;AACH,MAAM,MAAM,cAAc,CAAC,CAAC,SAAS,MAAM,GAAG,EAAE,CAAC,IAAI,QAAQ,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AAE5E;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,aAAa,GACxB,OAAO,OAAO,KACb,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAOjC,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,UAAU,GAAI,OAAO,OAAO,KAAG,KAAK,IAAI,UAAU,CAAC,QACnC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