tinybase 8.4.2 → 8.5.0-beta.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 (141) hide show
  1. package/@types/ui-react-dom/index.d.ts +10 -10
  2. package/@types/ui-react-dom/with-schemas/index.d.ts +10 -10
  3. package/@types/ui-react-dom-charts/index.d.ts +242 -0
  4. package/@types/ui-react-dom-charts/with-schemas/index.d.ts +296 -0
  5. package/@types/ui-react-inspector/index.d.ts +1 -1
  6. package/@types/ui-react-inspector/with-schemas/index.d.ts +1 -1
  7. package/@types/ui-solid-dom/index.d.ts +10 -10
  8. package/@types/ui-solid-dom/with-schemas/index.d.ts +10 -10
  9. package/@types/ui-solid-inspector/index.d.ts +1 -1
  10. package/@types/ui-solid-inspector/with-schemas/index.d.ts +1 -1
  11. package/@types/ui-svelte-dom/index.d.ts +10 -10
  12. package/@types/ui-svelte-dom/with-schemas/index.d.ts +10 -10
  13. package/@types/ui-svelte-inspector/index.d.ts +1 -1
  14. package/@types/ui-svelte-inspector/with-schemas/index.d.ts +1 -1
  15. package/common/index.js +3 -2
  16. package/common/with-schemas/index.js +3 -2
  17. package/index.js +5 -3
  18. package/mergeable-store/index.js +5 -3
  19. package/mergeable-store/with-schemas/index.js +5 -3
  20. package/metrics/index.js +1 -1
  21. package/metrics/with-schemas/index.js +1 -1
  22. package/min/common/index.js +1 -1
  23. package/min/common/index.js.gz +0 -0
  24. package/min/common/with-schemas/index.js +1 -1
  25. package/min/common/with-schemas/index.js.gz +0 -0
  26. package/min/index.js +1 -1
  27. package/min/index.js.gz +0 -0
  28. package/min/mergeable-store/index.js +1 -1
  29. package/min/mergeable-store/index.js.gz +0 -0
  30. package/min/mergeable-store/with-schemas/index.js +1 -1
  31. package/min/mergeable-store/with-schemas/index.js.gz +0 -0
  32. package/min/omni/index.js +1 -1
  33. package/min/omni/index.js.gz +0 -0
  34. package/min/omni/with-schemas/index.js +1 -1
  35. package/min/omni/with-schemas/index.js.gz +0 -0
  36. package/min/persisters/persister-durable-object-sql-storage/index.js +1 -1
  37. package/min/persisters/persister-durable-object-sql-storage/index.js.gz +0 -0
  38. package/min/persisters/persister-durable-object-sql-storage/with-schemas/index.js +1 -1
  39. package/min/persisters/persister-durable-object-sql-storage/with-schemas/index.js.gz +0 -0
  40. package/min/persisters/persister-partykit-server/index.js +1 -1
  41. package/min/persisters/persister-partykit-server/index.js.gz +0 -0
  42. package/min/persisters/persister-partykit-server/with-schemas/index.js +1 -1
  43. package/min/persisters/persister-partykit-server/with-schemas/index.js.gz +0 -0
  44. package/min/queries/index.js +1 -1
  45. package/min/queries/index.js.gz +0 -0
  46. package/min/queries/with-schemas/index.js +1 -1
  47. package/min/queries/with-schemas/index.js.gz +0 -0
  48. package/min/synchronizers/index.js +1 -1
  49. package/min/synchronizers/index.js.gz +0 -0
  50. package/min/synchronizers/synchronizer-broadcast-channel/index.js +1 -1
  51. package/min/synchronizers/synchronizer-broadcast-channel/index.js.gz +0 -0
  52. package/min/synchronizers/synchronizer-broadcast-channel/with-schemas/index.js +1 -1
  53. package/min/synchronizers/synchronizer-broadcast-channel/with-schemas/index.js.gz +0 -0
  54. package/min/synchronizers/synchronizer-local/index.js +1 -1
  55. package/min/synchronizers/synchronizer-local/index.js.gz +0 -0
  56. package/min/synchronizers/synchronizer-local/with-schemas/index.js +1 -1
  57. package/min/synchronizers/synchronizer-local/with-schemas/index.js.gz +0 -0
  58. package/min/synchronizers/synchronizer-ws-client/index.js +1 -1
  59. package/min/synchronizers/synchronizer-ws-client/index.js.gz +0 -0
  60. package/min/synchronizers/synchronizer-ws-client/with-schemas/index.js +1 -1
  61. package/min/synchronizers/synchronizer-ws-client/with-schemas/index.js.gz +0 -0
  62. package/min/synchronizers/synchronizer-ws-server/index.js +1 -1
  63. package/min/synchronizers/synchronizer-ws-server/index.js.gz +0 -0
  64. package/min/synchronizers/synchronizer-ws-server/with-schemas/index.js +1 -1
  65. package/min/synchronizers/synchronizer-ws-server/with-schemas/index.js.gz +0 -0
  66. package/min/synchronizers/synchronizer-ws-server-durable-object/index.js +1 -1
  67. package/min/synchronizers/synchronizer-ws-server-durable-object/index.js.gz +0 -0
  68. package/min/synchronizers/synchronizer-ws-server-durable-object/with-schemas/index.js +1 -1
  69. package/min/synchronizers/synchronizer-ws-server-durable-object/with-schemas/index.js.gz +0 -0
  70. package/min/synchronizers/with-schemas/index.js +1 -1
  71. package/min/synchronizers/with-schemas/index.js.gz +0 -0
  72. package/min/ui-react-dom/index.js +1 -1
  73. package/min/ui-react-dom/index.js.gz +0 -0
  74. package/min/ui-react-dom/with-schemas/index.js +1 -1
  75. package/min/ui-react-dom/with-schemas/index.js.gz +0 -0
  76. package/min/ui-react-dom-charts/index.js +1 -0
  77. package/min/ui-react-dom-charts/index.js.gz +0 -0
  78. package/min/ui-react-dom-charts/with-schemas/index.js +1 -0
  79. package/min/ui-react-dom-charts/with-schemas/index.js.gz +0 -0
  80. package/min/ui-react-inspector/index.js +1 -1
  81. package/min/ui-react-inspector/index.js.gz +0 -0
  82. package/min/ui-react-inspector/with-schemas/index.js +1 -1
  83. package/min/ui-react-inspector/with-schemas/index.js.gz +0 -0
  84. package/min/ui-solid-dom/index.js +1 -1
  85. package/min/ui-solid-dom/index.js.gz +0 -0
  86. package/min/ui-solid-dom/with-schemas/index.js +1 -1
  87. package/min/ui-solid-dom/with-schemas/index.js.gz +0 -0
  88. package/min/ui-solid-inspector/index.js +1 -1
  89. package/min/ui-solid-inspector/index.js.gz +0 -0
  90. package/min/ui-solid-inspector/with-schemas/index.js +1 -1
  91. package/min/ui-solid-inspector/with-schemas/index.js.gz +0 -0
  92. package/min/ui-svelte-dom/index.js +1 -1
  93. package/min/ui-svelte-dom/index.js.gz +0 -0
  94. package/min/ui-svelte-dom/with-schemas/index.js +1 -1
  95. package/min/ui-svelte-dom/with-schemas/index.js.gz +0 -0
  96. package/min/ui-svelte-inspector/index.js +1 -1
  97. package/min/ui-svelte-inspector/index.js.gz +0 -0
  98. package/min/ui-svelte-inspector/with-schemas/index.js +1 -1
  99. package/min/ui-svelte-inspector/with-schemas/index.js.gz +0 -0
  100. package/min/with-schemas/index.js +1 -1
  101. package/min/with-schemas/index.js.gz +0 -0
  102. package/omni/index.js +7 -4
  103. package/omni/with-schemas/index.js +7 -4
  104. package/package.json +38 -2
  105. package/persisters/persister-durable-object-sql-storage/index.js +13 -11
  106. package/persisters/persister-durable-object-sql-storage/with-schemas/index.js +13 -11
  107. package/persisters/persister-partykit-client/index.js +2 -1
  108. package/persisters/persister-partykit-client/with-schemas/index.js +2 -1
  109. package/persisters/persister-partykit-server/index.js +2 -1
  110. package/persisters/persister-partykit-server/with-schemas/index.js +2 -1
  111. package/queries/index.js +1 -1
  112. package/queries/with-schemas/index.js +1 -1
  113. package/readme.md +18 -14
  114. package/releases.md +91 -58
  115. package/synchronizers/index.js +3 -2
  116. package/synchronizers/synchronizer-broadcast-channel/index.js +3 -2
  117. package/synchronizers/synchronizer-broadcast-channel/with-schemas/index.js +3 -2
  118. package/synchronizers/synchronizer-local/index.js +3 -2
  119. package/synchronizers/synchronizer-local/with-schemas/index.js +3 -2
  120. package/synchronizers/synchronizer-ws-client/index.js +3 -2
  121. package/synchronizers/synchronizer-ws-client/with-schemas/index.js +3 -2
  122. package/synchronizers/synchronizer-ws-server/index.js +3 -2
  123. package/synchronizers/synchronizer-ws-server/with-schemas/index.js +3 -2
  124. package/synchronizers/synchronizer-ws-server-durable-object/index.js +3 -2
  125. package/synchronizers/synchronizer-ws-server-durable-object/with-schemas/index.js +3 -2
  126. package/synchronizers/with-schemas/index.js +3 -2
  127. package/ui-react-dom/index.js +10 -7
  128. package/ui-react-dom/with-schemas/index.js +10 -7
  129. package/ui-react-dom-charts/index.js +1229 -0
  130. package/ui-react-dom-charts/with-schemas/index.js +1229 -0
  131. package/ui-react-inspector/index.js +13 -9
  132. package/ui-react-inspector/with-schemas/index.js +13 -9
  133. package/ui-solid-dom/index.js +10 -7
  134. package/ui-solid-dom/with-schemas/index.js +10 -7
  135. package/ui-solid-inspector/index.js +13 -9
  136. package/ui-solid-inspector/with-schemas/index.js +13 -9
  137. package/ui-svelte-dom/index.js +11 -8
  138. package/ui-svelte-dom/with-schemas/index.js +11 -8
  139. package/ui-svelte-inspector/index.js +17 -13
  140. package/ui-svelte-inspector/with-schemas/index.js +17 -13
  141. package/with-schemas/index.js +5 -3
package/omni/index.js CHANGED
@@ -63,6 +63,7 @@ const strReplace = (str, searchValue, replaceValue) =>
63
63
  str.replace(searchValue, replaceValue);
64
64
 
65
65
  const promise = Promise;
66
+ const math = Math;
66
67
  const getIfNotFunction = (predicate) => (value, then, otherwise) =>
67
68
  predicate(value)
68
69
  ? /* istanbul ignore next */
@@ -71,16 +72,17 @@ const getIfNotFunction = (predicate) => (value, then, otherwise) =>
71
72
  const GLOBAL = globalThis;
72
73
  const WINDOW = GLOBAL.window;
73
74
  const THOUSAND = 1e3;
75
+ const string = String;
74
76
  const startInterval = (callback, sec, immediate) => {
75
77
  return setInterval(callback, sec * THOUSAND);
76
78
  };
77
79
  const stopInterval = clearInterval;
78
80
  const startTimeout = (callback, sec = 0) =>
79
81
  setTimeout(callback, sec * THOUSAND);
80
- const math = Math;
81
82
  const mathMax = math.max;
82
83
  const mathMin = math.min;
83
84
  const mathFloor = math.floor;
85
+ const mathRandom = math.random;
84
86
  const isFiniteNumber = isFinite;
85
87
  const isInstanceOf = (thing, cls) => thing instanceof cls;
86
88
  const isNullish = (thing) => thing == null;
@@ -92,6 +94,7 @@ const ifNotNullish = getIfNotFunction(isNullish);
92
94
  const ifNotUndefined = getIfNotFunction(isUndefined);
93
95
  const isTypeStringOrBoolean = (type) => type == STRING || type == BOOLEAN;
94
96
  const isString = (thing) => getTypeOf(thing) == STRING;
97
+ const isNumber = (thing) => getTypeOf(thing) == NUMBER;
95
98
  const isFunction = (thing) => getTypeOf(thing) == FUNCTION$1;
96
99
  const isArray = (thing) => Array.isArray(thing);
97
100
  const slice = (arrayOrString, start, end) => arrayOrString.slice(start, end);
@@ -823,7 +826,7 @@ const decode = (str, pos) => mapGet(DECODE, str[pos]) ?? 0;
823
826
  const getRandomValues = GLOBAL.crypto
824
827
  ? (array) => GLOBAL.crypto.getRandomValues(array)
825
828
  : /* istanbul ignore next */
826
- (array) => arrayMap(array, () => mathFloor(math.random() * 256));
829
+ (array) => arrayMap(array, () => mathFloor(mathRandom() * 256));
827
830
  const getUniqueId = (length = 16) =>
828
831
  arrayReduce(
829
832
  getRandomValues(new Uint8Array(length)),
@@ -1242,7 +1245,7 @@ const stampValidate = (stamp, validateThing) =>
1242
1245
  isArray(stamp) &&
1243
1246
  size(stamp) == 3 &&
1244
1247
  isString(stamp[1]) &&
1245
- getTypeOf(stamp[2]) == NUMBER &&
1248
+ isNumber(stamp[2]) &&
1246
1249
  isFiniteNumber(stamp[2]) &&
1247
1250
  validateThing(stamp[0]);
1248
1251
 
@@ -5457,7 +5460,7 @@ const deconstruct = (prefix, message, stringified) => {
5457
5460
  return strStartsWith(message, prefix)
5458
5461
  ? [
5459
5462
  message[prefixSize],
5460
- (stringified ? jsonParseWithUndefined : String)(
5463
+ (stringified ? jsonParseWithUndefined : string)(
5461
5464
  slice(message, prefixSize + 1),
5462
5465
  ),
5463
5466
  ]
@@ -63,6 +63,7 @@ const strReplace = (str, searchValue, replaceValue) =>
63
63
  str.replace(searchValue, replaceValue);
64
64
 
65
65
  const promise = Promise;
66
+ const math = Math;
66
67
  const getIfNotFunction = (predicate) => (value, then, otherwise) =>
67
68
  predicate(value)
68
69
  ? /* istanbul ignore next */
@@ -71,16 +72,17 @@ const getIfNotFunction = (predicate) => (value, then, otherwise) =>
71
72
  const GLOBAL = globalThis;
72
73
  const WINDOW = GLOBAL.window;
73
74
  const THOUSAND = 1e3;
75
+ const string = String;
74
76
  const startInterval = (callback, sec, immediate) => {
75
77
  return setInterval(callback, sec * THOUSAND);
76
78
  };
77
79
  const stopInterval = clearInterval;
78
80
  const startTimeout = (callback, sec = 0) =>
79
81
  setTimeout(callback, sec * THOUSAND);
80
- const math = Math;
81
82
  const mathMax = math.max;
82
83
  const mathMin = math.min;
83
84
  const mathFloor = math.floor;
85
+ const mathRandom = math.random;
84
86
  const isFiniteNumber = isFinite;
85
87
  const isInstanceOf = (thing, cls) => thing instanceof cls;
86
88
  const isNullish = (thing) => thing == null;
@@ -92,6 +94,7 @@ const ifNotNullish = getIfNotFunction(isNullish);
92
94
  const ifNotUndefined = getIfNotFunction(isUndefined);
93
95
  const isTypeStringOrBoolean = (type) => type == STRING || type == BOOLEAN;
94
96
  const isString = (thing) => getTypeOf(thing) == STRING;
97
+ const isNumber = (thing) => getTypeOf(thing) == NUMBER;
95
98
  const isFunction = (thing) => getTypeOf(thing) == FUNCTION$1;
96
99
  const isArray = (thing) => Array.isArray(thing);
97
100
  const slice = (arrayOrString, start, end) => arrayOrString.slice(start, end);
@@ -823,7 +826,7 @@ const decode = (str, pos) => mapGet(DECODE, str[pos]) ?? 0;
823
826
  const getRandomValues = GLOBAL.crypto
824
827
  ? (array) => GLOBAL.crypto.getRandomValues(array)
825
828
  : /* istanbul ignore next */
826
- (array) => arrayMap(array, () => mathFloor(math.random() * 256));
829
+ (array) => arrayMap(array, () => mathFloor(mathRandom() * 256));
827
830
  const getUniqueId = (length = 16) =>
828
831
  arrayReduce(
829
832
  getRandomValues(new Uint8Array(length)),
@@ -1242,7 +1245,7 @@ const stampValidate = (stamp, validateThing) =>
1242
1245
  isArray(stamp) &&
1243
1246
  size(stamp) == 3 &&
1244
1247
  isString(stamp[1]) &&
1245
- getTypeOf(stamp[2]) == NUMBER &&
1248
+ isNumber(stamp[2]) &&
1246
1249
  isFiniteNumber(stamp[2]) &&
1247
1250
  validateThing(stamp[0]);
1248
1251
 
@@ -5457,7 +5460,7 @@ const deconstruct = (prefix, message, stringified) => {
5457
5460
  return strStartsWith(message, prefix)
5458
5461
  ? [
5459
5462
  message[prefixSize],
5460
- (stringified ? jsonParseWithUndefined : String)(
5463
+ (stringified ? jsonParseWithUndefined : string)(
5461
5464
  slice(message, prefixSize + 1),
5462
5465
  ),
5463
5466
  ]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tinybase",
3
- "version": "8.4.2",
3
+ "version": "8.5.0-beta.1",
4
4
  "author": "jamesgpearce",
5
5
  "repository": "github:tinyplex/tinybase",
6
6
  "license": "MIT",
@@ -36,7 +36,7 @@
36
36
  "effect": "^3.21.2",
37
37
  "electric-sql": "^0.12.1",
38
38
  "expo": "^56.0.8",
39
- "expo-sqlite": "^55.0.15",
39
+ "expo-sqlite": "^56.0.4",
40
40
  "partykit": "^0.0.115",
41
41
  "partysocket": "^1.1.19",
42
42
  "postgres": "^3.4.9",
@@ -436,6 +436,12 @@
436
436
  "ui-react-dom/with-schemas": [
437
437
  "./@types/ui-react-dom/with-schemas/index.d.ts"
438
438
  ],
439
+ "ui-react-dom-charts": [
440
+ "./@types/ui-react-dom-charts/index.d.ts"
441
+ ],
442
+ "ui-react-dom-charts/with-schemas": [
443
+ "./@types/ui-react-dom-charts/with-schemas/index.d.ts"
444
+ ],
439
445
  "ui-react-inspector": [
440
446
  "./@types/ui-react-inspector/index.d.ts"
441
447
  ],
@@ -778,6 +784,12 @@
778
784
  "min/ui-react-dom/with-schemas": [
779
785
  "./@types/ui-react-dom/with-schemas/index.d.ts"
780
786
  ],
787
+ "min/ui-react-dom-charts": [
788
+ "./@types/ui-react-dom-charts/index.d.ts"
789
+ ],
790
+ "min/ui-react-dom-charts/with-schemas": [
791
+ "./@types/ui-react-dom-charts/with-schemas/index.d.ts"
792
+ ],
781
793
  "min/ui-react-inspector": [
782
794
  "./@types/ui-react-inspector/index.d.ts"
783
795
  ],
@@ -1417,6 +1429,18 @@
1417
1429
  "default": "./ui-react-dom/index.js"
1418
1430
  }
1419
1431
  },
1432
+ "./ui-react-dom-charts": {
1433
+ "default": {
1434
+ "types": "./@types/ui-react-dom-charts/index.d.ts",
1435
+ "default": "./ui-react-dom-charts/index.js"
1436
+ }
1437
+ },
1438
+ "./ui-react-dom-charts/with-schemas": {
1439
+ "default": {
1440
+ "types": "./@types/ui-react-dom-charts/with-schemas/index.d.ts",
1441
+ "default": "./ui-react-dom-charts/index.js"
1442
+ }
1443
+ },
1420
1444
  "./ui-react-inspector": {
1421
1445
  "default": {
1422
1446
  "types": "./@types/ui-react-inspector/index.d.ts",
@@ -2101,6 +2125,18 @@
2101
2125
  "default": "./min/ui-react-dom/index.js"
2102
2126
  }
2103
2127
  },
2128
+ "./min/ui-react-dom-charts": {
2129
+ "default": {
2130
+ "types": "./@types/ui-react-dom-charts/index.d.ts",
2131
+ "default": "./min/ui-react-dom-charts/index.js"
2132
+ }
2133
+ },
2134
+ "./min/ui-react-dom-charts/with-schemas": {
2135
+ "default": {
2136
+ "types": "./@types/ui-react-dom-charts/with-schemas/index.d.ts",
2137
+ "default": "./min/ui-react-dom-charts/index.js"
2138
+ }
2139
+ },
2104
2140
  "./min/ui-react-inspector": {
2105
2141
  "default": {
2106
2142
  "types": "./@types/ui-react-inspector/index.d.ts",
@@ -19,6 +19,8 @@ const getIfNotFunction = (predicate) => (value, then, otherwise) =>
19
19
  otherwise?.()
20
20
  : then(value);
21
21
  const THOUSAND = 1e3;
22
+ const number = Number;
23
+ const string = String;
22
24
  const startInterval = (callback, sec, immediate) => {
23
25
  return setInterval(callback, sec * THOUSAND);
24
26
  };
@@ -1291,13 +1293,13 @@ const createDurableObjectFragmentedSqlStoragePersister = (
1291
1293
  const values = stampNewObjectWithHash();
1292
1294
  const tablesResult = sqlStorage.exec(`SELECT * FROM ${tablesTable}`);
1293
1295
  for (const row of tablesResult.toArray()) {
1294
- const type = String(row.type);
1295
- const table_id = row.table_id ? String(row.table_id) : null;
1296
- const row_id = row.row_id ? String(row.row_id) : null;
1297
- const cell_id = row.cell_id ? String(row.cell_id) : null;
1298
- const value_data = String(row.value_data);
1299
- const timestamp = String(row.timestamp);
1300
- const hash = Number(row.hash);
1296
+ const type = string(row.type);
1297
+ const table_id = row.table_id ? string(row.table_id) : null;
1298
+ const row_id = row.row_id ? string(row.row_id) : null;
1299
+ const cell_id = row.cell_id ? string(row.cell_id) : null;
1300
+ const value_data = string(row.value_data);
1301
+ const timestamp = string(row.timestamp);
1302
+ const hash = number(row.hash);
1301
1303
  const [zeroOrCellOrValue] = JSON.parse(value_data);
1302
1304
  if (type === T) {
1303
1305
  if (table_id && row_id && cell_id) {
@@ -1318,10 +1320,10 @@ const createDurableObjectFragmentedSqlStoragePersister = (
1318
1320
  }
1319
1321
  const valuesResult = sqlStorage.exec(`SELECT * FROM ${valuesTable}`);
1320
1322
  for (const row of valuesResult.toArray()) {
1321
- const value_id = row.value_id ? String(row.value_id) : null;
1322
- const value_data = String(row.value_data);
1323
- const timestamp = String(row.timestamp);
1324
- const hash = Number(row.hash);
1323
+ const value_id = row.value_id ? string(row.value_id) : null;
1324
+ const value_data = string(row.value_data);
1325
+ const timestamp = string(row.timestamp);
1326
+ const hash = number(row.hash);
1325
1327
  const [zeroOrCellOrValue] = JSON.parse(value_data);
1326
1328
  if (value_id) {
1327
1329
  values[0][value_id] = [zeroOrCellOrValue, timestamp, hash];
@@ -19,6 +19,8 @@ const getIfNotFunction = (predicate) => (value, then, otherwise) =>
19
19
  otherwise?.()
20
20
  : then(value);
21
21
  const THOUSAND = 1e3;
22
+ const number = Number;
23
+ const string = String;
22
24
  const startInterval = (callback, sec, immediate) => {
23
25
  return setInterval(callback, sec * THOUSAND);
24
26
  };
@@ -1291,13 +1293,13 @@ const createDurableObjectFragmentedSqlStoragePersister = (
1291
1293
  const values = stampNewObjectWithHash();
1292
1294
  const tablesResult = sqlStorage.exec(`SELECT * FROM ${tablesTable}`);
1293
1295
  for (const row of tablesResult.toArray()) {
1294
- const type = String(row.type);
1295
- const table_id = row.table_id ? String(row.table_id) : null;
1296
- const row_id = row.row_id ? String(row.row_id) : null;
1297
- const cell_id = row.cell_id ? String(row.cell_id) : null;
1298
- const value_data = String(row.value_data);
1299
- const timestamp = String(row.timestamp);
1300
- const hash = Number(row.hash);
1296
+ const type = string(row.type);
1297
+ const table_id = row.table_id ? string(row.table_id) : null;
1298
+ const row_id = row.row_id ? string(row.row_id) : null;
1299
+ const cell_id = row.cell_id ? string(row.cell_id) : null;
1300
+ const value_data = string(row.value_data);
1301
+ const timestamp = string(row.timestamp);
1302
+ const hash = number(row.hash);
1301
1303
  const [zeroOrCellOrValue] = JSON.parse(value_data);
1302
1304
  if (type === T) {
1303
1305
  if (table_id && row_id && cell_id) {
@@ -1318,10 +1320,10 @@ const createDurableObjectFragmentedSqlStoragePersister = (
1318
1320
  }
1319
1321
  const valuesResult = sqlStorage.exec(`SELECT * FROM ${valuesTable}`);
1320
1322
  for (const row of valuesResult.toArray()) {
1321
- const value_id = row.value_id ? String(row.value_id) : null;
1322
- const value_data = String(row.value_data);
1323
- const timestamp = String(row.timestamp);
1324
- const hash = Number(row.hash);
1323
+ const value_id = row.value_id ? string(row.value_id) : null;
1324
+ const value_data = string(row.value_data);
1325
+ const timestamp = string(row.timestamp);
1326
+ const hash = number(row.hash);
1325
1327
  const [zeroOrCellOrValue] = JSON.parse(value_data);
1326
1328
  if (value_id) {
1327
1329
  values[0][value_id] = [zeroOrCellOrValue, timestamp, hash];
@@ -10,6 +10,7 @@ const getIfNotFunction = (predicate) => (value, then, otherwise) =>
10
10
  ? /* istanbul ignore next */
11
11
  otherwise?.()
12
12
  : then(value);
13
+ const string = String;
13
14
  const isInstanceOf = (thing, cls) => thing instanceof cls;
14
15
  const isNullish = (thing) => thing == null;
15
16
  const isUndefined = (thing) => thing === void 0;
@@ -475,7 +476,7 @@ const deconstruct = (prefix, message, stringified) => {
475
476
  return strStartsWith(message, prefix)
476
477
  ? [
477
478
  message[prefixSize],
478
- (stringified ? jsonParseWithUndefined : String)(
479
+ (stringified ? jsonParseWithUndefined : string)(
479
480
  slice(message, prefixSize + 1),
480
481
  ),
481
482
  ]
@@ -10,6 +10,7 @@ const getIfNotFunction = (predicate) => (value, then, otherwise) =>
10
10
  ? /* istanbul ignore next */
11
11
  otherwise?.()
12
12
  : then(value);
13
+ const string = String;
13
14
  const isInstanceOf = (thing, cls) => thing instanceof cls;
14
15
  const isNullish = (thing) => thing == null;
15
16
  const isUndefined = (thing) => thing === void 0;
@@ -475,7 +476,7 @@ const deconstruct = (prefix, message, stringified) => {
475
476
  return strStartsWith(message, prefix)
476
477
  ? [
477
478
  message[prefixSize],
478
- (stringified ? jsonParseWithUndefined : String)(
479
+ (stringified ? jsonParseWithUndefined : string)(
479
480
  slice(message, prefixSize + 1),
480
481
  ),
481
482
  ]
@@ -12,6 +12,7 @@ const getIfNotFunction = (predicate) => (value, then, otherwise) =>
12
12
  ? /* istanbul ignore next */
13
13
  otherwise?.()
14
14
  : then(value);
15
+ const string = String;
15
16
  const isInstanceOf = (thing, cls) => thing instanceof cls;
16
17
  const isNullish = (thing) => thing == null;
17
18
  const isUndefined = (thing) => thing === void 0;
@@ -93,7 +94,7 @@ const deconstruct = (prefix, message, stringified) => {
93
94
  return strStartsWith(message, prefix)
94
95
  ? [
95
96
  message[prefixSize],
96
- (stringified ? jsonParseWithUndefined : String)(
97
+ (stringified ? jsonParseWithUndefined : string)(
97
98
  slice(message, prefixSize + 1),
98
99
  ),
99
100
  ]
@@ -12,6 +12,7 @@ const getIfNotFunction = (predicate) => (value, then, otherwise) =>
12
12
  ? /* istanbul ignore next */
13
13
  otherwise?.()
14
14
  : then(value);
15
+ const string = String;
15
16
  const isInstanceOf = (thing, cls) => thing instanceof cls;
16
17
  const isNullish = (thing) => thing == null;
17
18
  const isUndefined = (thing) => thing === void 0;
@@ -93,7 +94,7 @@ const deconstruct = (prefix, message, stringified) => {
93
94
  return strStartsWith(message, prefix)
94
95
  ? [
95
96
  message[prefixSize],
96
- (stringified ? jsonParseWithUndefined : String)(
97
+ (stringified ? jsonParseWithUndefined : string)(
97
98
  slice(message, prefixSize + 1),
98
99
  ),
99
100
  ]
package/queries/index.js CHANGED
@@ -24,12 +24,12 @@ const SORTED_ROW_IDS = 'Sorted' + ROW + IDS;
24
24
  const CELL = 'Cell';
25
25
  const CELL_IDS = CELL + IDS;
26
26
 
27
+ const math = Math;
27
28
  const getIfNotFunction = (predicate) => (value, then, otherwise) =>
28
29
  predicate(value)
29
30
  ? /* istanbul ignore next */
30
31
  otherwise?.()
31
32
  : then(value);
32
- const math = Math;
33
33
  const mathMax = math.max;
34
34
  const mathMin = math.min;
35
35
  const isFiniteNumber = isFinite;
@@ -24,12 +24,12 @@ const SORTED_ROW_IDS = 'Sorted' + ROW + IDS;
24
24
  const CELL = 'Cell';
25
25
  const CELL_IDS = CELL + IDS;
26
26
 
27
+ const math = Math;
27
28
  const getIfNotFunction = (predicate) => (value, then, otherwise) =>
28
29
  predicate(value)
29
30
  ? /* istanbul ignore next */
30
31
  otherwise?.()
31
32
  : then(value);
32
- const math = Math;
33
33
  const mathMax = math.max;
34
34
  const mathMin = math.min;
35
35
  const isFiniteNumber = isFinite;