tinybase 4.5.0-beta.0 → 4.5.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 (69) hide show
  1. package/lib/cjs/persisters/persister-expo-sqlite-next.cjs +1 -0
  2. package/lib/cjs/persisters/persister-expo-sqlite-next.cjs.gz +0 -0
  3. package/lib/cjs/persisters/persister-partykit-server.cjs +1 -1
  4. package/lib/cjs/persisters/persister-partykit-server.cjs.gz +0 -0
  5. package/lib/cjs/ui-react.cjs +1 -1
  6. package/lib/cjs/ui-react.cjs.gz +0 -0
  7. package/lib/cjs-es6/persisters/persister-expo-sqlite-next.cjs +1 -0
  8. package/lib/cjs-es6/persisters/persister-expo-sqlite-next.cjs.gz +0 -0
  9. package/lib/cjs-es6/persisters/persister-partykit-server.cjs +1 -1
  10. package/lib/cjs-es6/persisters/persister-partykit-server.cjs.gz +0 -0
  11. package/lib/cjs-es6/ui-react.cjs +1 -1
  12. package/lib/cjs-es6/ui-react.cjs.gz +0 -0
  13. package/lib/debug/checkpoints.js +8 -8
  14. package/lib/debug/indexes.js +8 -8
  15. package/lib/debug/metrics.js +8 -8
  16. package/lib/debug/persisters/persister-automerge.js +23 -23
  17. package/lib/debug/persisters/persister-expo-sqlite-next.js +835 -0
  18. package/lib/debug/persisters/persister-partykit-server.js +35 -21
  19. package/lib/debug/persisters/persister-yjs.js +23 -23
  20. package/lib/debug/queries.js +10 -10
  21. package/lib/debug/relationships.js +6 -6
  22. package/lib/debug/store.js +10 -10
  23. package/lib/debug/tinybase.js +24 -24
  24. package/lib/debug/tools.js +2 -2
  25. package/lib/debug/ui-react-dom.js +12 -12
  26. package/lib/debug/ui-react.js +56 -22
  27. package/lib/es6/persisters/persister-expo-sqlite-next.js +1 -0
  28. package/lib/es6/persisters/persister-expo-sqlite-next.js.gz +0 -0
  29. package/lib/es6/persisters/persister-partykit-server.js +1 -1
  30. package/lib/es6/persisters/persister-partykit-server.js.gz +0 -0
  31. package/lib/es6/ui-react.js +1 -1
  32. package/lib/es6/ui-react.js.gz +0 -0
  33. package/lib/persisters/persister-expo-sqlite-next.js +1 -0
  34. package/lib/persisters/persister-expo-sqlite-next.js.gz +0 -0
  35. package/lib/persisters/persister-partykit-server.js +1 -1
  36. package/lib/persisters/persister-partykit-server.js.gz +0 -0
  37. package/lib/types/metrics.d.ts +2 -2
  38. package/lib/types/persisters/persister-expo-sqlite-next.d.ts +168 -0
  39. package/lib/types/persisters/persister-expo-sqlite.d.ts +8 -0
  40. package/lib/types/persisters/persister-partykit-server.d.ts +58 -2
  41. package/lib/types/persisters/persister-remote.d.ts +6 -1
  42. package/lib/types/persisters.d.ts +1 -0
  43. package/lib/types/queries.d.ts +2 -45
  44. package/lib/types/ui-react.d.ts +53 -0
  45. package/lib/types/with-schemas/metrics.d.ts +2 -2
  46. package/lib/types/with-schemas/persisters/persister-expo-sqlite-next.d.ts +181 -0
  47. package/lib/types/with-schemas/persisters/persister-expo-sqlite.d.ts +8 -0
  48. package/lib/types/with-schemas/persisters/persister-partykit-server.d.ts +61 -0
  49. package/lib/types/with-schemas/persisters/persister-remote.d.ts +6 -1
  50. package/lib/types/with-schemas/persisters.d.ts +1 -0
  51. package/lib/types/with-schemas/queries.d.ts +2 -45
  52. package/lib/types/with-schemas/store.d.ts +8 -8
  53. package/lib/types/with-schemas/ui-react.d.ts +59 -0
  54. package/lib/ui-react.js +1 -1
  55. package/lib/ui-react.js.gz +0 -0
  56. package/lib/umd/persisters/persister-expo-sqlite-next.js +1 -0
  57. package/lib/umd/persisters/persister-expo-sqlite-next.js.gz +0 -0
  58. package/lib/umd/persisters/persister-partykit-server.js +1 -1
  59. package/lib/umd/persisters/persister-partykit-server.js.gz +0 -0
  60. package/lib/umd/ui-react.js +1 -1
  61. package/lib/umd/ui-react.js.gz +0 -0
  62. package/lib/umd-es6/persisters/persister-expo-sqlite-next.js +1 -0
  63. package/lib/umd-es6/persisters/persister-expo-sqlite-next.js.gz +0 -0
  64. package/lib/umd-es6/persisters/persister-partykit-server.js +1 -1
  65. package/lib/umd-es6/persisters/persister-partykit-server.js.gz +0 -0
  66. package/lib/umd-es6/ui-react.js +1 -1
  67. package/lib/umd-es6/ui-react.js.gz +0 -0
  68. package/package.json +22 -23
  69. package/readme.md +13 -13
@@ -67,15 +67,12 @@ const RESPONSE_HEADERS = objNew(
67
67
  '*',
68
68
  ]),
69
69
  );
70
- const hasStore = async (that) =>
71
- await that.party.storage.get(
72
- (that.config.storagePrefix ?? EMPTY_STRING) + HAS_STORE,
73
- );
74
- const loadStore = async (that) => {
70
+ const hasStoreInStorage = async (storage, storagePrefix = EMPTY_STRING) =>
71
+ !!(await storage.get(storagePrefix + HAS_STORE));
72
+ const loadStoreFromStorage = async (storage, storagePrefix = EMPTY_STRING) => {
75
73
  const tables = {};
76
74
  const values = {};
77
- const storagePrefix = that.config.storagePrefix ?? EMPTY_STRING;
78
- mapForEach(await that.party.storage.list(), (key, cellOrValue) =>
75
+ mapForEach(await storage.list(), (key, cellOrValue) =>
79
76
  ifNotUndefined(deconstruct(storagePrefix, key), ([type, ids]) => {
80
77
  if (type == T) {
81
78
  const [tableId, rowId, cellId] = jsonParse('[' + ids + ']');
@@ -95,9 +92,9 @@ const saveStore = async (
95
92
  requestOrConnection,
96
93
  ) => {
97
94
  const storage = that.party.storage;
98
- const prefix = that.config.storagePrefix ?? EMPTY_STRING;
95
+ const storagePrefix = that.config.storagePrefix;
99
96
  const keysToSet = {
100
- [prefix + HAS_STORE]: 1,
97
+ [storagePrefix + HAS_STORE]: 1,
101
98
  };
102
99
  const keysToDel = [];
103
100
  const keyPrefixesToDel = [];
@@ -108,7 +105,7 @@ const saveStore = async (
108
105
  that.canDelTable(tableId, requestOrConnection) &&
109
106
  arrayUnshift(
110
107
  keyPrefixesToDel,
111
- constructStorageKey(prefix, T, tableId),
108
+ constructStorageKey(storagePrefix, T, tableId),
112
109
  )
113
110
  : that.canSetTable(tableId, initialSave, requestOrConnection) &&
114
111
  (await promiseAll(
@@ -118,7 +115,7 @@ const saveStore = async (
118
115
  that.canDelRow(tableId, rowId, requestOrConnection) &&
119
116
  arrayPush(
120
117
  keyPrefixesToDel,
121
- constructStorageKey(prefix, T, tableId, rowId),
118
+ constructStorageKey(storagePrefix, T, tableId, rowId),
122
119
  )
123
120
  : that.canSetRow(
124
121
  tableId,
@@ -129,7 +126,7 @@ const saveStore = async (
129
126
  (await promiseAll(
130
127
  objMap(row, async (cell, cellId) => {
131
128
  const ids = [tableId, rowId, cellId];
132
- const key = constructStorageKey(prefix, T, ...ids);
129
+ const key = constructStorageKey(storagePrefix, T, ...ids);
133
130
  isUndefined(cell)
134
131
  ? !initialSave &&
135
132
  that.canDelCell(...ids, requestOrConnection) &&
@@ -149,7 +146,7 @@ const saveStore = async (
149
146
  );
150
147
  await promiseAll(
151
148
  objMap(transactionChanges[1], async (value, valueId) => {
152
- const key = prefix + V + valueId;
149
+ const key = storagePrefix + V + valueId;
153
150
  isUndefined(value)
154
151
  ? !initialSave &&
155
152
  that.canDelValue(valueId, requestOrConnection) &&
@@ -181,17 +178,24 @@ const constructStorageKey = (storagePrefix, type, ...ids) =>
181
178
  const createResponse = async (that, status, body = null) =>
182
179
  new Response(body, {
183
180
  status,
184
- headers: that.config.responseHeaders ?? RESPONSE_HEADERS,
181
+ headers: that.config.responseHeaders,
185
182
  });
186
183
  class TinyBasePartyKitServer {
187
184
  constructor(party) {
188
185
  this.party = party;
189
186
  this.config = {};
187
+ this.config.storePath ??= STORE_PATH;
188
+ this.config.messagePrefix ??= EMPTY_STRING;
189
+ this.config.storagePrefix ??= EMPTY_STRING;
190
+ this.config.responseHeaders ??= RESPONSE_HEADERS;
190
191
  }
191
192
  async onRequest(request) {
192
- const storePath = this.config.storePath ?? STORE_PATH;
193
+ const {
194
+ party: {storage},
195
+ config: {storePath, storagePrefix},
196
+ } = this;
193
197
  if (new URL(request.url).pathname.endsWith(storePath)) {
194
- const hasExistingStore = await hasStore(this);
198
+ const hasExistingStore = await hasStoreInStorage(storage, storagePrefix);
195
199
  const text = await request.text();
196
200
  if (request.method == PUT) {
197
201
  if (hasExistingStore) {
@@ -203,19 +207,29 @@ class TinyBasePartyKitServer {
203
207
  return createResponse(
204
208
  this,
205
209
  200,
206
- hasExistingStore ? jsonString(await loadStore(this)) : EMPTY_STRING,
210
+ hasExistingStore
211
+ ? jsonString(await loadStoreFromStorage(storage, storagePrefix))
212
+ : EMPTY_STRING,
207
213
  );
208
214
  }
209
215
  return createResponse(this, 404);
210
216
  }
211
217
  async onMessage(message, connection) {
212
- const messagePrefix = this.config.messagePrefix ?? EMPTY_STRING;
218
+ const {
219
+ party: {storage, broadcast},
220
+ config: {messagePrefix, storagePrefix},
221
+ } = this;
213
222
  await ifNotUndefined(
214
223
  deconstruct(messagePrefix, message, 1),
215
224
  async ([type, payload]) => {
216
- if (type == SET_CHANGES && (await hasStore(this))) {
225
+ if (
226
+ type == SET_CHANGES &&
227
+ (await hasStoreInStorage(storage, storagePrefix))
228
+ ) {
217
229
  await saveStore(this, payload, false, connection);
218
- this.party.broadcast(construct(messagePrefix, SET_CHANGES, payload));
230
+ broadcast(construct(messagePrefix, SET_CHANGES, payload), [
231
+ connection.id,
232
+ ]);
219
233
  }
220
234
  },
221
235
  );
@@ -254,4 +268,4 @@ class TinyBasePartyKitServer {
254
268
  }
255
269
  }
256
270
 
257
- export {TinyBasePartyKitServer};
271
+ export {TinyBasePartyKitServer, hasStoreInStorage, loadStoreFromStorage};
@@ -275,35 +275,35 @@ const setTransactionChangesToYDoc = (
275
275
  transactionChangesFailed
276
276
  ? 0
277
277
  : isUndefined(table)
278
- ? yTables.delete(tableId)
279
- : ifNotUndefined(
280
- yTables.get(tableId),
281
- (yTable) =>
282
- objMap(table, (row, rowId) =>
283
- transactionChangesFailed
284
- ? 0
285
- : isUndefined(row)
286
- ? yTable.delete(rowId)
287
- : ifNotUndefined(
288
- yTable.get(rowId),
289
- (yRow) =>
290
- objMap(row, (cell, cellId) =>
291
- isUndefined(cell)
292
- ? yRow.delete(cellId)
293
- : yRow.set(cellId, cell),
278
+ ? yTables.delete(tableId)
279
+ : ifNotUndefined(
280
+ yTables.get(tableId),
281
+ (yTable) =>
282
+ objMap(table, (row, rowId) =>
283
+ transactionChangesFailed
284
+ ? 0
285
+ : isUndefined(row)
286
+ ? yTable.delete(rowId)
287
+ : ifNotUndefined(
288
+ yTable.get(rowId),
289
+ (yRow) =>
290
+ objMap(row, (cell, cellId) =>
291
+ isUndefined(cell)
292
+ ? yRow.delete(cellId)
293
+ : yRow.set(cellId, cell),
294
+ ),
295
+ transactionChangesDidFail,
294
296
  ),
295
- transactionChangesDidFail,
296
- ),
297
- ),
298
- transactionChangesDidFail,
299
- ),
297
+ ),
298
+ transactionChangesDidFail,
299
+ ),
300
300
  );
301
301
  objMap(valueChanges, (value, valueId) =>
302
302
  transactionChangesFailed
303
303
  ? 0
304
304
  : isUndefined(value)
305
- ? yValues.delete(valueId)
306
- : yValues.set(valueId, value),
305
+ ? yValues.delete(valueId)
306
+ : yValues.set(valueId, value),
307
307
  );
308
308
  });
309
309
  if (transactionChangesFailed) {
@@ -160,8 +160,8 @@ const getAggregateValue = (
160
160
  aggregateValue = isUndefined(oldValue)
161
161
  ? aggregateAdd?.(aggregateValue, newValue, oldLength++)
162
162
  : isUndefined(newValue)
163
- ? aggregateRemove?.(aggregateValue, oldValue, oldLength--)
164
- : aggregateReplace?.(aggregateValue, newValue, oldValue, oldLength);
163
+ ? aggregateRemove?.(aggregateValue, oldValue, oldLength--)
164
+ : aggregateReplace?.(aggregateValue, newValue, oldValue, oldLength);
165
165
  force ||= isUndefined(aggregateValue);
166
166
  }
167
167
  });
@@ -454,8 +454,8 @@ const createQueries = getCreateFunction((store) => {
454
454
  isFunction(arg1)
455
455
  ? arg1
456
456
  : isUndefined(arg3)
457
- ? (getTableCell) => getTableCell(arg1) === arg2
458
- : (getTableCell) => getTableCell(arg1, arg2) === arg3,
457
+ ? (getTableCell) => getTableCell(arg1) === arg2
458
+ : (getTableCell) => getTableCell(arg1, arg2) === arg3,
459
459
  );
460
460
  const group = (
461
461
  selectedCellId,
@@ -658,12 +658,12 @@ const createQueries = getCreateFunction((store) => {
658
658
  ...(isUndefined(arg2)
659
659
  ? [tableId, rootRowId, arg1]
660
660
  : arg1 === tableId
661
- ? [tableId, rootRowId, arg2]
662
- : [
663
- mapGet(joins, arg1)?.[0],
664
- mapGet(mapGet(joins, arg1)?.[4], rootRowId)?.[0],
665
- arg2,
666
- ]),
661
+ ? [tableId, rootRowId, arg2]
662
+ : [
663
+ mapGet(joins, arg1)?.[0],
664
+ mapGet(mapGet(joins, arg1)?.[4], rootRowId)?.[0],
665
+ arg2,
666
+ ]),
667
667
  );
668
668
  selectJoinWhereStore.transaction(() =>
669
669
  arrayEvery(wheres, (where2) => where2(getTableCell))
@@ -268,8 +268,8 @@ const getWildcardedLeaves = (deepIdSet, path = [EMPTY_STRING]) => {
268
268
  p == size(path)
269
269
  ? arrayPush(leaves, node)
270
270
  : path[p] === null
271
- ? collForEach(node, (node2) => deep(node2, p + 1))
272
- : arrayForEach([path[p], null], (id) => deep(mapGet(node, id), p + 1));
271
+ ? collForEach(node, (node2) => deep(node2, p + 1))
272
+ : arrayForEach([path[p], null], (id) => deep(mapGet(node, id), p + 1));
273
273
  deep(deepIdSet, 0);
274
274
  return leaves;
275
275
  };
@@ -321,10 +321,10 @@ const getListenerFunctions = (getThing) => {
321
321
  index == size(path)
322
322
  ? listener(thing, ...ids, ...extraArgsGetter(ids))
323
323
  : isUndefined(path[index])
324
- ? arrayForEach(pathGetters[index]?.(...ids) ?? [], (id2) =>
325
- callWithIds(...ids, id2),
326
- )
327
- : callWithIds(...ids, path[index]);
324
+ ? arrayForEach(pathGetters[index]?.(...ids) ?? [], (id2) =>
325
+ callWithIds(...ids, id2),
326
+ )
327
+ : callWithIds(...ids, path[index]);
328
328
  };
329
329
  callWithIds();
330
330
  },
@@ -182,8 +182,8 @@ const getWildcardedLeaves = (deepIdSet, path = [EMPTY_STRING]) => {
182
182
  p == size(path)
183
183
  ? arrayPush(leaves, node)
184
184
  : path[p] === null
185
- ? collForEach(node, (node2) => deep(node2, p + 1))
186
- : arrayForEach([path[p], null], (id) => deep(mapGet(node, id), p + 1));
185
+ ? collForEach(node, (node2) => deep(node2, p + 1))
186
+ : arrayForEach([path[p], null], (id) => deep(mapGet(node, id), p + 1));
187
187
  deep(deepIdSet, 0);
188
188
  return leaves;
189
189
  };
@@ -235,10 +235,10 @@ const getListenerFunctions = (getThing) => {
235
235
  index == size(path)
236
236
  ? listener(thing, ...ids, ...extraArgsGetter(ids))
237
237
  : isUndefined(path[index])
238
- ? arrayForEach(pathGetters[index]?.(...ids) ?? [], (id2) =>
239
- callWithIds(...ids, id2),
240
- )
241
- : callWithIds(...ids, path[index]);
238
+ ? arrayForEach(pathGetters[index]?.(...ids) ?? [], (id2) =>
239
+ callWithIds(...ids, id2),
240
+ )
241
+ : callWithIds(...ids, path[index]);
242
242
  };
243
243
  callWithIds();
244
244
  },
@@ -400,8 +400,8 @@ const createStore = () => {
400
400
  () => cellInvalid(tableId, rowId, cellId, cell),
401
401
  )
402
402
  : isUndefined(getCellOrValueType(cell))
403
- ? cellInvalid(tableId, rowId, cellId, cell)
404
- : cell;
403
+ ? cellInvalid(tableId, rowId, cellId, cell)
404
+ : cell;
405
405
  const validateValues = (values, skipDefaults) =>
406
406
  validate(
407
407
  skipDefaults ? values : addDefaultsToValues(values),
@@ -427,8 +427,8 @@ const createStore = () => {
427
427
  () => valueInvalid(valueId, value),
428
428
  )
429
429
  : isUndefined(getCellOrValueType(value))
430
- ? valueInvalid(valueId, value)
431
- : value;
430
+ ? valueInvalid(valueId, value)
431
+ : value;
432
432
  const addDefaultsToRow = (row, tableId, rowId) => {
433
433
  ifNotUndefined(
434
434
  mapGet(tablesSchemaRowCache, tableId),
@@ -386,8 +386,8 @@ const getWildcardedLeaves = (deepIdSet, path = [EMPTY_STRING]) => {
386
386
  p == size(path)
387
387
  ? arrayPush(leaves, node)
388
388
  : path[p] === null
389
- ? collForEach(node, (node2) => deep(node2, p + 1))
390
- : arrayForEach([path[p], null], (id) => deep(mapGet(node, id), p + 1));
389
+ ? collForEach(node, (node2) => deep(node2, p + 1))
390
+ : arrayForEach([path[p], null], (id) => deep(mapGet(node, id), p + 1));
391
391
  deep(deepIdSet, 0);
392
392
  return leaves;
393
393
  };
@@ -439,10 +439,10 @@ const getListenerFunctions = (getThing) => {
439
439
  index == size(path)
440
440
  ? listener(thing, ...ids, ...extraArgsGetter(ids))
441
441
  : isUndefined(path[index])
442
- ? arrayForEach(pathGetters[index]?.(...ids) ?? [], (id2) =>
443
- callWithIds(...ids, id2),
444
- )
445
- : callWithIds(...ids, path[index]);
442
+ ? arrayForEach(pathGetters[index]?.(...ids) ?? [], (id2) =>
443
+ callWithIds(...ids, id2),
444
+ )
445
+ : callWithIds(...ids, path[index]);
446
446
  };
447
447
  callWithIds();
448
448
  },
@@ -621,8 +621,8 @@ const createCheckpoints = getCreateFunction((store) => {
621
621
  const action = arrayHas(backwardIds, checkpointId)
622
622
  ? goBackwardImpl
623
623
  : arrayHas(forwardIds, checkpointId)
624
- ? goForwardImpl
625
- : null;
624
+ ? goForwardImpl
625
+ : null;
626
626
  while (!isUndefined(action) && checkpointId != currentId) {
627
627
  action();
628
628
  }
@@ -707,8 +707,8 @@ const createIndexes = getCreateFunction((store) => {
707
707
  isUndefined(value)
708
708
  ? EMPTY_STRING
709
709
  : isArray(value)
710
- ? arrayMap(value, id)
711
- : id(value),
710
+ ? arrayMap(value, id)
711
+ : id(value),
712
712
  addListener,
713
713
  callListeners,
714
714
  );
@@ -938,8 +938,8 @@ const getAggregateValue = (
938
938
  aggregateValue = isUndefined(oldValue)
939
939
  ? aggregateAdd?.(aggregateValue, newValue, oldLength++)
940
940
  : isUndefined(newValue)
941
- ? aggregateRemove?.(aggregateValue, oldValue, oldLength--)
942
- : aggregateReplace?.(aggregateValue, newValue, oldValue, oldLength);
941
+ ? aggregateRemove?.(aggregateValue, oldValue, oldLength--)
942
+ : aggregateReplace?.(aggregateValue, newValue, oldValue, oldLength);
943
943
  force ||= isUndefined(aggregateValue);
944
944
  }
945
945
  });
@@ -1301,8 +1301,8 @@ const createQueries = getCreateFunction((store) => {
1301
1301
  isFunction(arg1)
1302
1302
  ? arg1
1303
1303
  : isUndefined(arg3)
1304
- ? (getTableCell) => getTableCell(arg1) === arg2
1305
- : (getTableCell) => getTableCell(arg1, arg2) === arg3,
1304
+ ? (getTableCell) => getTableCell(arg1) === arg2
1305
+ : (getTableCell) => getTableCell(arg1, arg2) === arg3,
1306
1306
  );
1307
1307
  const group = (
1308
1308
  selectedCellId,
@@ -1505,12 +1505,12 @@ const createQueries = getCreateFunction((store) => {
1505
1505
  ...(isUndefined(arg2)
1506
1506
  ? [tableId, rootRowId, arg1]
1507
1507
  : arg1 === tableId
1508
- ? [tableId, rootRowId, arg2]
1509
- : [
1510
- mapGet(joins, arg1)?.[0],
1511
- mapGet(mapGet(joins, arg1)?.[4], rootRowId)?.[0],
1512
- arg2,
1513
- ]),
1508
+ ? [tableId, rootRowId, arg2]
1509
+ : [
1510
+ mapGet(joins, arg1)?.[0],
1511
+ mapGet(mapGet(joins, arg1)?.[4], rootRowId)?.[0],
1512
+ arg2,
1513
+ ]),
1514
1514
  );
1515
1515
  selectJoinWhereStore.transaction(() =>
1516
1516
  arrayEvery(wheres, (where2) => where2(getTableCell))
@@ -1980,8 +1980,8 @@ const createStore = () => {
1980
1980
  () => cellInvalid(tableId, rowId, cellId, cell),
1981
1981
  )
1982
1982
  : isUndefined(getCellOrValueType(cell))
1983
- ? cellInvalid(tableId, rowId, cellId, cell)
1984
- : cell;
1983
+ ? cellInvalid(tableId, rowId, cellId, cell)
1984
+ : cell;
1985
1985
  const validateValues = (values, skipDefaults) =>
1986
1986
  validate(
1987
1987
  skipDefaults ? values : addDefaultsToValues(values),
@@ -2007,8 +2007,8 @@ const createStore = () => {
2007
2007
  () => valueInvalid(valueId, value),
2008
2008
  )
2009
2009
  : isUndefined(getCellOrValueType(value))
2010
- ? valueInvalid(valueId, value)
2011
- : value;
2010
+ ? valueInvalid(valueId, value)
2011
+ : value;
2012
2012
  const addDefaultsToRow = (row, tableId, rowId) => {
2013
2013
  ifNotUndefined(
2014
2014
  mapGet(tablesSchemaRowCache, tableId),
@@ -361,8 +361,8 @@ const getCodeFunctions = () => {
361
361
  ? -1
362
362
  : 1
363
363
  : import1 > import2
364
- ? 1
365
- : -1,
364
+ ? 1
365
+ : -1,
366
366
  ),
367
367
  EMPTY_STRING,
368
368
  ],
@@ -575,8 +575,8 @@ const RelationshipInHtmlRow = ({
575
575
  tableId === localTableId
576
576
  ? localRowId
577
577
  : tableId === remoteTableId
578
- ? remoteRowId
579
- : null;
578
+ ? remoteRowId
579
+ : null;
580
580
  return isUndefined(rowId)
581
581
  ? null
582
582
  : /* @__PURE__ */ createElement(
@@ -1796,8 +1796,8 @@ const getWildcardedLeaves = (deepIdSet, path = [EMPTY_STRING]) => {
1796
1796
  p == size(path)
1797
1797
  ? arrayPush(leaves, node)
1798
1798
  : path[p] === null
1799
- ? collForEach(node, (node2) => deep(node2, p + 1))
1800
- : arrayForEach([path[p], null], (id) => deep(mapGet(node, id), p + 1));
1799
+ ? collForEach(node, (node2) => deep(node2, p + 1))
1800
+ : arrayForEach([path[p], null], (id) => deep(mapGet(node, id), p + 1));
1801
1801
  deep(deepIdSet, 0);
1802
1802
  return leaves;
1803
1803
  };
@@ -1849,10 +1849,10 @@ const getListenerFunctions = (getThing) => {
1849
1849
  index == size(path)
1850
1850
  ? listener(thing, ...ids, ...extraArgsGetter(ids))
1851
1851
  : isUndefined(path[index])
1852
- ? arrayForEach(pathGetters[index]?.(...ids) ?? [], (id2) =>
1853
- callWithIds(...ids, id2),
1854
- )
1855
- : callWithIds(...ids, path[index]);
1852
+ ? arrayForEach(pathGetters[index]?.(...ids) ?? [], (id2) =>
1853
+ callWithIds(...ids, id2),
1854
+ )
1855
+ : callWithIds(...ids, path[index]);
1856
1856
  };
1857
1857
  callWithIds();
1858
1858
  },
@@ -1995,8 +1995,8 @@ const createStore = () => {
1995
1995
  () => cellInvalid(tableId, rowId, cellId, cell),
1996
1996
  )
1997
1997
  : isUndefined(getCellOrValueType(cell))
1998
- ? cellInvalid(tableId, rowId, cellId, cell)
1999
- : cell;
1998
+ ? cellInvalid(tableId, rowId, cellId, cell)
1999
+ : cell;
2000
2000
  const validateValues = (values, skipDefaults) =>
2001
2001
  validate(
2002
2002
  skipDefaults ? values : addDefaultsToValues(values),
@@ -2022,8 +2022,8 @@ const createStore = () => {
2022
2022
  () => valueInvalid(valueId, value),
2023
2023
  )
2024
2024
  : isUndefined(getCellOrValueType(value))
2025
- ? valueInvalid(valueId, value)
2026
- : value;
2025
+ ? valueInvalid(valueId, value)
2026
+ : value;
2027
2027
  const addDefaultsToRow = (row, tableId, rowId) => {
2028
2028
  ifNotUndefined(
2029
2029
  mapGet(tablesSchemaRowCache, tableId),