Skip to content

Commit 940f51f

Browse files
committed
v5.3.2
1 parent eede821 commit 940f51f

File tree

15 files changed

+1553
-7439
lines changed

15 files changed

+1553
-7439
lines changed

coverage.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"tests":7456,"assertions":33195,"lines":{"total":2282,"covered":2282,"skipped":0,"pct":100},"statements":{"total":2465,"covered":2465,"skipped":0,"pct":100},"functions":{"total":986,"covered":986,"skipped":0,"pct":100},"branches":{"total":854,"covered":854,"skipped":0,"pct":100},"branchesTrue":{"total":0,"covered":0,"skipped":0,"pct":100}}
1+
{"tests":7456,"assertions":33193,"lines":{"total":2285,"covered":2285,"skipped":0,"pct":100},"statements":{"total":2466,"covered":2466,"skipped":0,"pct":100},"functions":{"total":985,"covered":985,"skipped":0,"pct":100},"branches":{"total":853,"covered":853,"skipped":0,"pct":100},"branchesTrue":{"total":0,"covered":0,"skipped":0,"pct":100}}

docs/index.html

Lines changed: 2 additions & 2 deletions
Large diffs are not rendered by default.

docs/js/app.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/js/home.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/js/single.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/umd/tinybase/index.js

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@
2424
const LISTENER = 'Listener';
2525
const RESULT = 'Result';
2626
const GET = 'get';
27+
const SET = 'set';
2728
const ADD = 'add';
29+
const DEL = 'del';
2830
const HAS = 'Has';
2931
const IDS = 'Ids';
3032
const TABLE = 'Table';
@@ -39,9 +41,12 @@
3941
const VALUE = 'Value';
4042
const VALUES = VALUE + 's';
4143
const VALUE_IDS = VALUE + IDS;
44+
const TRANSACTION = 'Transaction';
4245
const id = (key) => EMPTY_STRING + key;
4346
const strStartsWith = (str, prefix) => str.startsWith(prefix);
4447
const strEndsWith = (str, suffix) => str.endsWith(suffix);
48+
const strSplit = (str, separator = EMPTY_STRING, limit) =>
49+
str.split(separator, limit);
4550

4651
const GLOBAL = globalThis;
4752
const math = Math;
@@ -768,11 +773,12 @@
768773
);
769774

770775
const MASK6 = 63;
771-
const ENCODE =
772-
'-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz'.split(
773-
EMPTY_STRING,
774-
);
775-
const DECODE = mapNew(arrayMap(ENCODE, (char, index) => [char, index]));
776+
const ENCODE = strSplit(
777+
'-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz',
778+
);
779+
const DECODE = /* @__PURE__ */ mapNew(
780+
/* @__PURE__ */ arrayMap(ENCODE, (char, index) => [char, index]),
781+
);
776782
const encode = (num) => ENCODE[num & MASK6];
777783
const decode = (str, pos) => mapGet(DECODE, str[pos]) ?? 0;
778784

@@ -994,7 +1000,7 @@
9941000
return objFreeze(indexes);
9951001
});
9961002

997-
const numericAggregators = mapNew([
1003+
const numericAggregators = /* @__PURE__ */ mapNew([
9981004
[
9991005
AVG,
10001006
[
@@ -1830,7 +1836,7 @@
18301836
return objFreeze(relationships);
18311837
});
18321838

1833-
const textEncoder = new GLOBAL.TextEncoder();
1839+
const textEncoder = /* @__PURE__ */ new GLOBAL.TextEncoder();
18341840
const getHash = (value) => {
18351841
let hash = 2166136261;
18361842
arrayForEach(textEncoder.encode(value), (char) => {
@@ -3787,16 +3793,16 @@
37873793
store,
37883794
(method, name) =>
37893795
(mergeableStore[name] = // fluent methods
3790-
strStartsWith(name, 'set') ||
3791-
strStartsWith(name, 'del') ||
3796+
strStartsWith(name, SET) ||
3797+
strStartsWith(name, DEL) ||
37923798
strStartsWith(name, 'apply') ||
3793-
strEndsWith(name, 'Transaction') ||
3794-
name == 'callListener'
3799+
strEndsWith(name, TRANSACTION) ||
3800+
name == 'call' + LISTENER
37953801
? (...args) => {
37963802
method(...args);
37973803
return mergeableStore;
37983804
}
3799-
: strStartsWith(name, 'add') && strEndsWith(name, 'Listener')
3805+
: strStartsWith(name, ADD) && strEndsWith(name, LISTENER)
38003806
? (...args) => {
38013807
const listenerArg = LISTENER_ARGS[slice(name, 3, -8)] ?? 0;
38023808
const listener = args[listenerArg];

docs/umd/tinybase/store/index.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -322,12 +322,6 @@
322322
isInstanceOf(value, Map) ? object.fromEntries([...value]) : value,
323323
);
324324

325-
const ENCODE =
326-
'-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz'.split(
327-
EMPTY_STRING,
328-
);
329-
mapNew(arrayMap(ENCODE, (char, index) => [char, index]));
330-
331325
const defaultSorter = (sortKey1, sortKey2) =>
332326
(sortKey1 ?? 0) < (sortKey2 ?? 0) ? -1 : 1;
333327

docs/umd/tinybase/synchronizers/synchronizer-ws-client/index.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
const EMPTY_STRING = '';
1313
const UTF8 = 'utf8';
1414
const UNDEFINED = '\uFFFC';
15+
const strSplit = (str, separator = EMPTY_STRING, limit) =>
16+
str.split(separator, limit);
1517

1618
const promise = Promise;
1719
const GLOBAL = globalThis;
@@ -128,8 +130,6 @@
128130
},
129131
);
130132

131-
new GLOBAL.TextEncoder();
132-
133133
const newStamp = (value, time) => (time ? [value, time] : [value]);
134134
const getLatestTime = (time1, time2) =>
135135
/* istanbul ignore next */
@@ -447,11 +447,9 @@
447447
};
448448

449449
const MASK6 = 63;
450-
const ENCODE =
451-
'-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz'.split(
452-
EMPTY_STRING,
453-
);
454-
mapNew(arrayMap(ENCODE, (char, index) => [char, index]));
450+
const ENCODE = strSplit(
451+
'-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz',
452+
);
455453
const encode = (num) => ENCODE[num & MASK6];
456454

457455
const getRandomValues = GLOBAL.crypto

docs/umd/tinybase/ui-react-dom/index.js

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
const VALUE = 'Value';
2323
const CURRENT_TARGET = 'currentTarget';
2424
const _VALUE = 'value';
25+
const strSplit = (str, separator = EMPTY_STRING, limit) =>
26+
str.split(separator, limit);
2527

2628
const math = Math;
2729
const mathMin = math.min;
@@ -44,11 +46,16 @@
4446
const {
4547
PureComponent,
4648
Fragment,
49+
createContext,
4750
createElement,
48-
useCallback: useCallback$1,
51+
useCallback,
52+
useContext,
53+
useEffect,
4954
useLayoutEffect,
55+
useMemo,
5056
useRef,
51-
useState: useState$1,
57+
useState,
58+
useSyncExternalStore,
5259
} = React;
5360
const getProps = (getProps2, ...ids) =>
5461
isUndefined(getProps2) ? {} : getProps2(...ids);
@@ -74,7 +81,6 @@
7481
const objMap = (obj, cb) =>
7582
objNew(objToArray(obj, (value, id) => [id, cb(value, id)]));
7683

77-
const {useCallback, useMemo, useState} = React;
7884
const DOT = '.';
7985
const EDITABLE = 'editable';
8086
const LEFT_ARROW = '\u2190';
@@ -295,15 +301,15 @@
295301
idColumn === false
296302
? null
297303
: /* @__PURE__ */ createElement(
298-
React.Fragment,
304+
Fragment,
299305
null,
300306
/* @__PURE__ */ createElement('th', null, localRowId),
301307
/* @__PURE__ */ createElement('th', null, remoteRowId),
302308
),
303309
objToArray(
304310
cells,
305311
({component: CellView2, getComponentProps}, compoundCellId) => {
306-
const [tableId, cellId] = compoundCellId.split(DOT, 2);
312+
const [tableId, cellId] = strSplit(compoundCellId, DOT, 2);
307313
const rowId =
308314
tableId === localTableId
309315
? localRowId
@@ -607,7 +613,7 @@
607613
idColumn === false
608614
? null
609615
: /* @__PURE__ */ createElement(
610-
React.Fragment,
616+
Fragment,
611617
null,
612618
/* @__PURE__ */ createElement(
613619
'th',
@@ -756,11 +762,11 @@
756762
offset + limit < total,
757763
);
758764
return /* @__PURE__ */ createElement(
759-
React.Fragment,
765+
Fragment,
760766
null,
761767
total > limit &&
762768
/* @__PURE__ */ createElement(
763-
React.Fragment,
769+
Fragment,
764770
null,
765771
/* @__PURE__ */ createElement(
766772
'button',

0 commit comments

Comments
 (0)