tinybase 8.5.0-beta.0 → 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.
- package/@types/ui-react-dom-charts/index.d.ts +242 -0
- package/@types/ui-react-dom-charts/with-schemas/index.d.ts +296 -0
- package/common/index.js +3 -2
- package/common/with-schemas/index.js +3 -2
- package/index.js +5 -3
- package/mergeable-store/index.js +5 -3
- package/mergeable-store/with-schemas/index.js +5 -3
- package/metrics/index.js +1 -1
- package/metrics/with-schemas/index.js +1 -1
- package/min/common/index.js +1 -1
- package/min/common/index.js.gz +0 -0
- package/min/common/with-schemas/index.js +1 -1
- package/min/common/with-schemas/index.js.gz +0 -0
- package/min/index.js +1 -1
- package/min/index.js.gz +0 -0
- package/min/mergeable-store/index.js +1 -1
- package/min/mergeable-store/index.js.gz +0 -0
- package/min/mergeable-store/with-schemas/index.js +1 -1
- package/min/mergeable-store/with-schemas/index.js.gz +0 -0
- package/min/omni/index.js +1 -1
- package/min/omni/index.js.gz +0 -0
- package/min/omni/with-schemas/index.js +1 -1
- package/min/omni/with-schemas/index.js.gz +0 -0
- package/min/persisters/persister-durable-object-sql-storage/index.js +1 -1
- package/min/persisters/persister-durable-object-sql-storage/index.js.gz +0 -0
- package/min/persisters/persister-durable-object-sql-storage/with-schemas/index.js +1 -1
- package/min/persisters/persister-durable-object-sql-storage/with-schemas/index.js.gz +0 -0
- package/min/persisters/persister-partykit-server/index.js +1 -1
- package/min/persisters/persister-partykit-server/index.js.gz +0 -0
- package/min/persisters/persister-partykit-server/with-schemas/index.js +1 -1
- package/min/persisters/persister-partykit-server/with-schemas/index.js.gz +0 -0
- package/min/queries/index.js +1 -1
- package/min/queries/index.js.gz +0 -0
- package/min/queries/with-schemas/index.js +1 -1
- package/min/queries/with-schemas/index.js.gz +0 -0
- package/min/synchronizers/index.js +1 -1
- package/min/synchronizers/index.js.gz +0 -0
- package/min/synchronizers/synchronizer-broadcast-channel/index.js +1 -1
- package/min/synchronizers/synchronizer-broadcast-channel/index.js.gz +0 -0
- package/min/synchronizers/synchronizer-broadcast-channel/with-schemas/index.js +1 -1
- package/min/synchronizers/synchronizer-broadcast-channel/with-schemas/index.js.gz +0 -0
- package/min/synchronizers/synchronizer-local/index.js +1 -1
- package/min/synchronizers/synchronizer-local/index.js.gz +0 -0
- package/min/synchronizers/synchronizer-local/with-schemas/index.js +1 -1
- package/min/synchronizers/synchronizer-local/with-schemas/index.js.gz +0 -0
- package/min/synchronizers/synchronizer-ws-client/index.js +1 -1
- package/min/synchronizers/synchronizer-ws-client/index.js.gz +0 -0
- package/min/synchronizers/synchronizer-ws-client/with-schemas/index.js +1 -1
- package/min/synchronizers/synchronizer-ws-client/with-schemas/index.js.gz +0 -0
- package/min/synchronizers/synchronizer-ws-server/index.js +1 -1
- package/min/synchronizers/synchronizer-ws-server/index.js.gz +0 -0
- package/min/synchronizers/synchronizer-ws-server/with-schemas/index.js +1 -1
- package/min/synchronizers/synchronizer-ws-server/with-schemas/index.js.gz +0 -0
- package/min/synchronizers/synchronizer-ws-server-durable-object/index.js +1 -1
- package/min/synchronizers/synchronizer-ws-server-durable-object/index.js.gz +0 -0
- package/min/synchronizers/synchronizer-ws-server-durable-object/with-schemas/index.js +1 -1
- package/min/synchronizers/synchronizer-ws-server-durable-object/with-schemas/index.js.gz +0 -0
- package/min/synchronizers/with-schemas/index.js +1 -1
- package/min/synchronizers/with-schemas/index.js.gz +0 -0
- package/min/ui-react-dom/index.js +1 -1
- package/min/ui-react-dom/index.js.gz +0 -0
- package/min/ui-react-dom/with-schemas/index.js +1 -1
- package/min/ui-react-dom/with-schemas/index.js.gz +0 -0
- package/min/ui-react-dom-charts/index.js +1 -0
- package/min/ui-react-dom-charts/index.js.gz +0 -0
- package/min/ui-react-dom-charts/with-schemas/index.js +1 -0
- package/min/ui-react-dom-charts/with-schemas/index.js.gz +0 -0
- package/min/ui-react-inspector/index.js +1 -1
- package/min/ui-react-inspector/index.js.gz +0 -0
- package/min/ui-react-inspector/with-schemas/index.js +1 -1
- package/min/ui-react-inspector/with-schemas/index.js.gz +0 -0
- package/min/ui-solid-dom/index.js +1 -1
- package/min/ui-solid-dom/index.js.gz +0 -0
- package/min/ui-solid-dom/with-schemas/index.js +1 -1
- package/min/ui-solid-dom/with-schemas/index.js.gz +0 -0
- package/min/ui-solid-inspector/index.js +1 -1
- package/min/ui-solid-inspector/index.js.gz +0 -0
- package/min/ui-solid-inspector/with-schemas/index.js +1 -1
- package/min/ui-solid-inspector/with-schemas/index.js.gz +0 -0
- package/min/ui-svelte-dom/index.js +1 -1
- package/min/ui-svelte-dom/index.js.gz +0 -0
- package/min/ui-svelte-dom/with-schemas/index.js +1 -1
- package/min/ui-svelte-dom/with-schemas/index.js.gz +0 -0
- package/min/ui-svelte-inspector/index.js +1 -1
- package/min/ui-svelte-inspector/index.js.gz +0 -0
- package/min/ui-svelte-inspector/with-schemas/index.js +1 -1
- package/min/ui-svelte-inspector/with-schemas/index.js.gz +0 -0
- package/min/with-schemas/index.js +1 -1
- package/min/with-schemas/index.js.gz +0 -0
- package/omni/index.js +7 -4
- package/omni/with-schemas/index.js +7 -4
- package/package.json +50 -14
- package/persisters/persister-durable-object-sql-storage/index.js +13 -11
- package/persisters/persister-durable-object-sql-storage/with-schemas/index.js +13 -11
- package/persisters/persister-partykit-client/index.js +2 -1
- package/persisters/persister-partykit-client/with-schemas/index.js +2 -1
- package/persisters/persister-partykit-server/index.js +2 -1
- package/persisters/persister-partykit-server/with-schemas/index.js +2 -1
- package/queries/index.js +1 -1
- package/queries/with-schemas/index.js +1 -1
- package/readme.md +18 -14
- package/releases.md +91 -58
- package/synchronizers/index.js +3 -2
- package/synchronizers/synchronizer-broadcast-channel/index.js +3 -2
- package/synchronizers/synchronizer-broadcast-channel/with-schemas/index.js +3 -2
- package/synchronizers/synchronizer-local/index.js +3 -2
- package/synchronizers/synchronizer-local/with-schemas/index.js +3 -2
- package/synchronizers/synchronizer-ws-client/index.js +3 -2
- package/synchronizers/synchronizer-ws-client/with-schemas/index.js +3 -2
- package/synchronizers/synchronizer-ws-server/index.js +3 -2
- package/synchronizers/synchronizer-ws-server/with-schemas/index.js +3 -2
- package/synchronizers/synchronizer-ws-server-durable-object/index.js +3 -2
- package/synchronizers/synchronizer-ws-server-durable-object/with-schemas/index.js +3 -2
- package/synchronizers/with-schemas/index.js +3 -2
- package/ui-react-dom/index.js +10 -7
- package/ui-react-dom/with-schemas/index.js +10 -7
- package/ui-react-dom-charts/index.js +1229 -0
- package/ui-react-dom-charts/with-schemas/index.js +1229 -0
- package/ui-react-inspector/index.js +16 -10
- package/ui-react-inspector/with-schemas/index.js +16 -10
- package/ui-solid-dom/index.js +10 -7
- package/ui-solid-dom/with-schemas/index.js +10 -7
- package/ui-solid-inspector/index.js +16 -10
- package/ui-solid-inspector/with-schemas/index.js +16 -10
- package/ui-svelte/index.js +5 -5
- package/ui-svelte/with-schemas/index.js +5 -5
- package/ui-svelte-dom/index.js +162 -164
- package/ui-svelte-dom/with-schemas/index.js +162 -164
- package/ui-svelte-inspector/index.js +192 -196
- package/ui-svelte-inspector/with-schemas/index.js +192 -196
- package/with-schemas/index.js +5 -3
package/synchronizers/index.js
CHANGED
|
@@ -4,6 +4,7 @@ const strSplit = (str, separator = EMPTY_STRING, limit) =>
|
|
|
4
4
|
str.split(separator, limit);
|
|
5
5
|
|
|
6
6
|
const promise = Promise;
|
|
7
|
+
const math = Math;
|
|
7
8
|
const getIfNotFunction = (predicate) => (value, then, otherwise) =>
|
|
8
9
|
predicate(value)
|
|
9
10
|
? /* istanbul ignore next */
|
|
@@ -13,8 +14,8 @@ const GLOBAL = globalThis;
|
|
|
13
14
|
const THOUSAND = 1e3;
|
|
14
15
|
const startTimeout = (callback, sec = 0) =>
|
|
15
16
|
setTimeout(callback, sec * THOUSAND);
|
|
16
|
-
const math = Math;
|
|
17
17
|
const mathFloor = math.floor;
|
|
18
|
+
const mathRandom = math.random;
|
|
18
19
|
const isNullish = (thing) => thing == null;
|
|
19
20
|
const isUndefined = (thing) => thing === void 0;
|
|
20
21
|
const isNull = (thing) => thing === null;
|
|
@@ -121,7 +122,7 @@ const encode = (num) => ENCODE[num & MASK6];
|
|
|
121
122
|
const getRandomValues = GLOBAL.crypto
|
|
122
123
|
? (array) => GLOBAL.crypto.getRandomValues(array)
|
|
123
124
|
: /* istanbul ignore next */
|
|
124
|
-
(array) => arrayMap(array, () => mathFloor(
|
|
125
|
+
(array) => arrayMap(array, () => mathFloor(mathRandom() * 256));
|
|
125
126
|
const getUniqueId = (length = 16) =>
|
|
126
127
|
arrayReduce(
|
|
127
128
|
getRandomValues(new Uint8Array(length)),
|
|
@@ -4,6 +4,7 @@ const strSplit = (str, separator = EMPTY_STRING, limit) =>
|
|
|
4
4
|
str.split(separator, limit);
|
|
5
5
|
|
|
6
6
|
const promise = Promise;
|
|
7
|
+
const math = Math;
|
|
7
8
|
const getIfNotFunction = (predicate) => (value, then, otherwise) =>
|
|
8
9
|
predicate(value)
|
|
9
10
|
? /* istanbul ignore next */
|
|
@@ -13,8 +14,8 @@ const GLOBAL = globalThis;
|
|
|
13
14
|
const THOUSAND = 1e3;
|
|
14
15
|
const startTimeout = (callback, sec = 0) =>
|
|
15
16
|
setTimeout(callback, sec * THOUSAND);
|
|
16
|
-
const math = Math;
|
|
17
17
|
const mathFloor = math.floor;
|
|
18
|
+
const mathRandom = math.random;
|
|
18
19
|
const isNullish = (thing) => thing == null;
|
|
19
20
|
const isUndefined = (thing) => thing === void 0;
|
|
20
21
|
const isNull = (thing) => thing === null;
|
|
@@ -121,7 +122,7 @@ const encode = (num) => ENCODE[num & MASK6];
|
|
|
121
122
|
const getRandomValues = GLOBAL.crypto
|
|
122
123
|
? (array) => GLOBAL.crypto.getRandomValues(array)
|
|
123
124
|
: /* istanbul ignore next */
|
|
124
|
-
(array) => arrayMap(array, () => mathFloor(
|
|
125
|
+
(array) => arrayMap(array, () => mathFloor(mathRandom() * 256));
|
|
125
126
|
const getUniqueId = (length = 16) =>
|
|
126
127
|
arrayReduce(
|
|
127
128
|
getRandomValues(new Uint8Array(length)),
|
|
@@ -4,6 +4,7 @@ const strSplit = (str, separator = EMPTY_STRING, limit) =>
|
|
|
4
4
|
str.split(separator, limit);
|
|
5
5
|
|
|
6
6
|
const promise = Promise;
|
|
7
|
+
const math = Math;
|
|
7
8
|
const getIfNotFunction = (predicate) => (value, then, otherwise) =>
|
|
8
9
|
predicate(value)
|
|
9
10
|
? /* istanbul ignore next */
|
|
@@ -13,8 +14,8 @@ const GLOBAL = globalThis;
|
|
|
13
14
|
const THOUSAND = 1e3;
|
|
14
15
|
const startTimeout = (callback, sec = 0) =>
|
|
15
16
|
setTimeout(callback, sec * THOUSAND);
|
|
16
|
-
const math = Math;
|
|
17
17
|
const mathFloor = math.floor;
|
|
18
|
+
const mathRandom = math.random;
|
|
18
19
|
const isNullish = (thing) => thing == null;
|
|
19
20
|
const isUndefined = (thing) => thing === void 0;
|
|
20
21
|
const isNull = (thing) => thing === null;
|
|
@@ -121,7 +122,7 @@ const encode = (num) => ENCODE[num & MASK6];
|
|
|
121
122
|
const getRandomValues = GLOBAL.crypto
|
|
122
123
|
? (array) => GLOBAL.crypto.getRandomValues(array)
|
|
123
124
|
: /* istanbul ignore next */
|
|
124
|
-
(array) => arrayMap(array, () => mathFloor(
|
|
125
|
+
(array) => arrayMap(array, () => mathFloor(mathRandom() * 256));
|
|
125
126
|
const getUniqueId = (length = 16) =>
|
|
126
127
|
arrayReduce(
|
|
127
128
|
getRandomValues(new Uint8Array(length)),
|
|
@@ -4,6 +4,7 @@ const strSplit = (str, separator = EMPTY_STRING, limit) =>
|
|
|
4
4
|
str.split(separator, limit);
|
|
5
5
|
|
|
6
6
|
const promise = Promise;
|
|
7
|
+
const math = Math;
|
|
7
8
|
const getIfNotFunction = (predicate) => (value, then, otherwise) =>
|
|
8
9
|
predicate(value)
|
|
9
10
|
? /* istanbul ignore next */
|
|
@@ -13,8 +14,8 @@ const GLOBAL = globalThis;
|
|
|
13
14
|
const THOUSAND = 1e3;
|
|
14
15
|
const startTimeout = (callback, sec = 0) =>
|
|
15
16
|
setTimeout(callback, sec * THOUSAND);
|
|
16
|
-
const math = Math;
|
|
17
17
|
const mathFloor = math.floor;
|
|
18
|
+
const mathRandom = math.random;
|
|
18
19
|
const isNullish = (thing) => thing == null;
|
|
19
20
|
const isUndefined = (thing) => thing === void 0;
|
|
20
21
|
const isNull = (thing) => thing === null;
|
|
@@ -123,7 +124,7 @@ const encode = (num) => ENCODE[num & MASK6];
|
|
|
123
124
|
const getRandomValues = GLOBAL.crypto
|
|
124
125
|
? (array) => GLOBAL.crypto.getRandomValues(array)
|
|
125
126
|
: /* istanbul ignore next */
|
|
126
|
-
(array) => arrayMap(array, () => mathFloor(
|
|
127
|
+
(array) => arrayMap(array, () => mathFloor(mathRandom() * 256));
|
|
127
128
|
const getUniqueId = (length = 16) =>
|
|
128
129
|
arrayReduce(
|
|
129
130
|
getRandomValues(new Uint8Array(length)),
|
|
@@ -4,6 +4,7 @@ const strSplit = (str, separator = EMPTY_STRING, limit) =>
|
|
|
4
4
|
str.split(separator, limit);
|
|
5
5
|
|
|
6
6
|
const promise = Promise;
|
|
7
|
+
const math = Math;
|
|
7
8
|
const getIfNotFunction = (predicate) => (value, then, otherwise) =>
|
|
8
9
|
predicate(value)
|
|
9
10
|
? /* istanbul ignore next */
|
|
@@ -13,8 +14,8 @@ const GLOBAL = globalThis;
|
|
|
13
14
|
const THOUSAND = 1e3;
|
|
14
15
|
const startTimeout = (callback, sec = 0) =>
|
|
15
16
|
setTimeout(callback, sec * THOUSAND);
|
|
16
|
-
const math = Math;
|
|
17
17
|
const mathFloor = math.floor;
|
|
18
|
+
const mathRandom = math.random;
|
|
18
19
|
const isNullish = (thing) => thing == null;
|
|
19
20
|
const isUndefined = (thing) => thing === void 0;
|
|
20
21
|
const isNull = (thing) => thing === null;
|
|
@@ -123,7 +124,7 @@ const encode = (num) => ENCODE[num & MASK6];
|
|
|
123
124
|
const getRandomValues = GLOBAL.crypto
|
|
124
125
|
? (array) => GLOBAL.crypto.getRandomValues(array)
|
|
125
126
|
: /* istanbul ignore next */
|
|
126
|
-
(array) => arrayMap(array, () => mathFloor(
|
|
127
|
+
(array) => arrayMap(array, () => mathFloor(mathRandom() * 256));
|
|
127
128
|
const getUniqueId = (length = 16) =>
|
|
128
129
|
arrayReduce(
|
|
129
130
|
getRandomValues(new Uint8Array(length)),
|
|
@@ -9,6 +9,7 @@ const strSplit = (str, separator = EMPTY_STRING, limit) =>
|
|
|
9
9
|
str.split(separator, limit);
|
|
10
10
|
|
|
11
11
|
const promise = Promise;
|
|
12
|
+
const math = Math;
|
|
12
13
|
const getIfNotFunction = (predicate) => (value, then, otherwise) =>
|
|
13
14
|
predicate(value)
|
|
14
15
|
? /* istanbul ignore next */
|
|
@@ -18,8 +19,8 @@ const GLOBAL = globalThis;
|
|
|
18
19
|
const THOUSAND = 1e3;
|
|
19
20
|
const startTimeout = (callback, sec = 0) =>
|
|
20
21
|
setTimeout(callback, sec * THOUSAND);
|
|
21
|
-
const math = Math;
|
|
22
22
|
const mathFloor = math.floor;
|
|
23
|
+
const mathRandom = math.random;
|
|
23
24
|
const isNullish = (thing) => thing == null;
|
|
24
25
|
const isUndefined = (thing) => thing === void 0;
|
|
25
26
|
const isNull = (thing) => thing === null;
|
|
@@ -163,7 +164,7 @@ const encode = (num) => ENCODE[num & MASK6];
|
|
|
163
164
|
const getRandomValues = GLOBAL.crypto
|
|
164
165
|
? (array) => GLOBAL.crypto.getRandomValues(array)
|
|
165
166
|
: /* istanbul ignore next */
|
|
166
|
-
(array) => arrayMap(array, () => mathFloor(
|
|
167
|
+
(array) => arrayMap(array, () => mathFloor(mathRandom() * 256));
|
|
167
168
|
const getUniqueId = (length = 16) =>
|
|
168
169
|
arrayReduce(
|
|
169
170
|
getRandomValues(new Uint8Array(length)),
|
|
@@ -9,6 +9,7 @@ const strSplit = (str, separator = EMPTY_STRING, limit) =>
|
|
|
9
9
|
str.split(separator, limit);
|
|
10
10
|
|
|
11
11
|
const promise = Promise;
|
|
12
|
+
const math = Math;
|
|
12
13
|
const getIfNotFunction = (predicate) => (value, then, otherwise) =>
|
|
13
14
|
predicate(value)
|
|
14
15
|
? /* istanbul ignore next */
|
|
@@ -18,8 +19,8 @@ const GLOBAL = globalThis;
|
|
|
18
19
|
const THOUSAND = 1e3;
|
|
19
20
|
const startTimeout = (callback, sec = 0) =>
|
|
20
21
|
setTimeout(callback, sec * THOUSAND);
|
|
21
|
-
const math = Math;
|
|
22
22
|
const mathFloor = math.floor;
|
|
23
|
+
const mathRandom = math.random;
|
|
23
24
|
const isNullish = (thing) => thing == null;
|
|
24
25
|
const isUndefined = (thing) => thing === void 0;
|
|
25
26
|
const isNull = (thing) => thing === null;
|
|
@@ -163,7 +164,7 @@ const encode = (num) => ENCODE[num & MASK6];
|
|
|
163
164
|
const getRandomValues = GLOBAL.crypto
|
|
164
165
|
? (array) => GLOBAL.crypto.getRandomValues(array)
|
|
165
166
|
: /* istanbul ignore next */
|
|
166
|
-
(array) => arrayMap(array, () => mathFloor(
|
|
167
|
+
(array) => arrayMap(array, () => mathFloor(mathRandom() * 256));
|
|
167
168
|
const getUniqueId = (length = 16) =>
|
|
168
169
|
arrayReduce(
|
|
169
170
|
getRandomValues(new Uint8Array(length)),
|
|
@@ -9,6 +9,7 @@ const strSplit = (str, separator = EMPTY_STRING, limit) =>
|
|
|
9
9
|
str.split(separator, limit);
|
|
10
10
|
|
|
11
11
|
const promise = Promise;
|
|
12
|
+
const math = Math;
|
|
12
13
|
const getIfNotFunction = (predicate) => (value, then, otherwise) =>
|
|
13
14
|
predicate(value)
|
|
14
15
|
? /* istanbul ignore next */
|
|
@@ -18,8 +19,8 @@ const GLOBAL = globalThis;
|
|
|
18
19
|
const THOUSAND = 1e3;
|
|
19
20
|
const startTimeout = (callback, sec = 0) =>
|
|
20
21
|
setTimeout(callback, sec * THOUSAND);
|
|
21
|
-
const math = Math;
|
|
22
22
|
const mathFloor = math.floor;
|
|
23
|
+
const mathRandom = math.random;
|
|
23
24
|
const isNullish = (thing) => thing == null;
|
|
24
25
|
const isUndefined = (thing) => thing === void 0;
|
|
25
26
|
const isNull = (thing) => thing === null;
|
|
@@ -269,7 +270,7 @@ const encode = (num) => ENCODE[num & MASK6];
|
|
|
269
270
|
const getRandomValues = GLOBAL.crypto
|
|
270
271
|
? (array) => GLOBAL.crypto.getRandomValues(array)
|
|
271
272
|
: /* istanbul ignore next */
|
|
272
|
-
(array) => arrayMap(array, () => mathFloor(
|
|
273
|
+
(array) => arrayMap(array, () => mathFloor(mathRandom() * 256));
|
|
273
274
|
const getUniqueId = (length = 16) =>
|
|
274
275
|
arrayReduce(
|
|
275
276
|
getRandomValues(new Uint8Array(length)),
|
|
@@ -9,6 +9,7 @@ const strSplit = (str, separator = EMPTY_STRING, limit) =>
|
|
|
9
9
|
str.split(separator, limit);
|
|
10
10
|
|
|
11
11
|
const promise = Promise;
|
|
12
|
+
const math = Math;
|
|
12
13
|
const getIfNotFunction = (predicate) => (value, then, otherwise) =>
|
|
13
14
|
predicate(value)
|
|
14
15
|
? /* istanbul ignore next */
|
|
@@ -18,8 +19,8 @@ const GLOBAL = globalThis;
|
|
|
18
19
|
const THOUSAND = 1e3;
|
|
19
20
|
const startTimeout = (callback, sec = 0) =>
|
|
20
21
|
setTimeout(callback, sec * THOUSAND);
|
|
21
|
-
const math = Math;
|
|
22
22
|
const mathFloor = math.floor;
|
|
23
|
+
const mathRandom = math.random;
|
|
23
24
|
const isNullish = (thing) => thing == null;
|
|
24
25
|
const isUndefined = (thing) => thing === void 0;
|
|
25
26
|
const isNull = (thing) => thing === null;
|
|
@@ -269,7 +270,7 @@ const encode = (num) => ENCODE[num & MASK6];
|
|
|
269
270
|
const getRandomValues = GLOBAL.crypto
|
|
270
271
|
? (array) => GLOBAL.crypto.getRandomValues(array)
|
|
271
272
|
: /* istanbul ignore next */
|
|
272
|
-
(array) => arrayMap(array, () => mathFloor(
|
|
273
|
+
(array) => arrayMap(array, () => mathFloor(mathRandom() * 256));
|
|
273
274
|
const getUniqueId = (length = 16) =>
|
|
274
275
|
arrayReduce(
|
|
275
276
|
getRandomValues(new Uint8Array(length)),
|
|
@@ -8,6 +8,7 @@ const strSplit = (str, separator = EMPTY_STRING, limit) =>
|
|
|
8
8
|
str.split(separator, limit);
|
|
9
9
|
|
|
10
10
|
const promise = Promise;
|
|
11
|
+
const math = Math;
|
|
11
12
|
const getIfNotFunction = (predicate) => (value, then, otherwise) =>
|
|
12
13
|
predicate(value)
|
|
13
14
|
? /* istanbul ignore next */
|
|
@@ -17,8 +18,8 @@ const GLOBAL = globalThis;
|
|
|
17
18
|
const THOUSAND = 1e3;
|
|
18
19
|
const startTimeout = (callback, sec = 0) =>
|
|
19
20
|
setTimeout(callback, sec * THOUSAND);
|
|
20
|
-
const math = Math;
|
|
21
21
|
const mathFloor = math.floor;
|
|
22
|
+
const mathRandom = math.random;
|
|
22
23
|
const isNullish = (thing) => thing == null;
|
|
23
24
|
const isUndefined = (thing) => thing === void 0;
|
|
24
25
|
const isNull = (thing) => thing === null;
|
|
@@ -165,7 +166,7 @@ const encode = (num) => ENCODE[num & MASK6];
|
|
|
165
166
|
const getRandomValues = GLOBAL.crypto
|
|
166
167
|
? (array) => GLOBAL.crypto.getRandomValues(array)
|
|
167
168
|
: /* istanbul ignore next */
|
|
168
|
-
(array) => arrayMap(array, () => mathFloor(
|
|
169
|
+
(array) => arrayMap(array, () => mathFloor(mathRandom() * 256));
|
|
169
170
|
const getUniqueId = (length = 16) =>
|
|
170
171
|
arrayReduce(
|
|
171
172
|
getRandomValues(new Uint8Array(length)),
|
|
@@ -8,6 +8,7 @@ const strSplit = (str, separator = EMPTY_STRING, limit) =>
|
|
|
8
8
|
str.split(separator, limit);
|
|
9
9
|
|
|
10
10
|
const promise = Promise;
|
|
11
|
+
const math = Math;
|
|
11
12
|
const getIfNotFunction = (predicate) => (value, then, otherwise) =>
|
|
12
13
|
predicate(value)
|
|
13
14
|
? /* istanbul ignore next */
|
|
@@ -17,8 +18,8 @@ const GLOBAL = globalThis;
|
|
|
17
18
|
const THOUSAND = 1e3;
|
|
18
19
|
const startTimeout = (callback, sec = 0) =>
|
|
19
20
|
setTimeout(callback, sec * THOUSAND);
|
|
20
|
-
const math = Math;
|
|
21
21
|
const mathFloor = math.floor;
|
|
22
|
+
const mathRandom = math.random;
|
|
22
23
|
const isNullish = (thing) => thing == null;
|
|
23
24
|
const isUndefined = (thing) => thing === void 0;
|
|
24
25
|
const isNull = (thing) => thing === null;
|
|
@@ -165,7 +166,7 @@ const encode = (num) => ENCODE[num & MASK6];
|
|
|
165
166
|
const getRandomValues = GLOBAL.crypto
|
|
166
167
|
? (array) => GLOBAL.crypto.getRandomValues(array)
|
|
167
168
|
: /* istanbul ignore next */
|
|
168
|
-
(array) => arrayMap(array, () => mathFloor(
|
|
169
|
+
(array) => arrayMap(array, () => mathFloor(mathRandom() * 256));
|
|
169
170
|
const getUniqueId = (length = 16) =>
|
|
170
171
|
arrayReduce(
|
|
171
172
|
getRandomValues(new Uint8Array(length)),
|
|
@@ -4,6 +4,7 @@ const strSplit = (str, separator = EMPTY_STRING, limit) =>
|
|
|
4
4
|
str.split(separator, limit);
|
|
5
5
|
|
|
6
6
|
const promise = Promise;
|
|
7
|
+
const math = Math;
|
|
7
8
|
const getIfNotFunction = (predicate) => (value, then, otherwise) =>
|
|
8
9
|
predicate(value)
|
|
9
10
|
? /* istanbul ignore next */
|
|
@@ -13,8 +14,8 @@ const GLOBAL = globalThis;
|
|
|
13
14
|
const THOUSAND = 1e3;
|
|
14
15
|
const startTimeout = (callback, sec = 0) =>
|
|
15
16
|
setTimeout(callback, sec * THOUSAND);
|
|
16
|
-
const math = Math;
|
|
17
17
|
const mathFloor = math.floor;
|
|
18
|
+
const mathRandom = math.random;
|
|
18
19
|
const isNullish = (thing) => thing == null;
|
|
19
20
|
const isUndefined = (thing) => thing === void 0;
|
|
20
21
|
const isNull = (thing) => thing === null;
|
|
@@ -121,7 +122,7 @@ const encode = (num) => ENCODE[num & MASK6];
|
|
|
121
122
|
const getRandomValues = GLOBAL.crypto
|
|
122
123
|
? (array) => GLOBAL.crypto.getRandomValues(array)
|
|
123
124
|
: /* istanbul ignore next */
|
|
124
|
-
(array) => arrayMap(array, () => mathFloor(
|
|
125
|
+
(array) => arrayMap(array, () => mathFloor(mathRandom() * 256));
|
|
125
126
|
const getUniqueId = (length = 16) =>
|
|
126
127
|
arrayReduce(
|
|
127
128
|
getRandomValues(new Uint8Array(length)),
|
package/ui-react-dom/index.js
CHANGED
|
@@ -38,13 +38,16 @@ const EXTRA = 'extra';
|
|
|
38
38
|
const strSplit = (str, separator = EMPTY_STRING, limit) =>
|
|
39
39
|
str.split(separator, limit);
|
|
40
40
|
|
|
41
|
+
const math = Math;
|
|
41
42
|
const getIfNotFunction = (predicate) => (value, then, otherwise) =>
|
|
42
43
|
predicate(value)
|
|
43
44
|
? /* istanbul ignore next */
|
|
44
45
|
otherwise?.()
|
|
45
46
|
: then(value);
|
|
46
47
|
const GLOBAL = globalThis;
|
|
47
|
-
const
|
|
48
|
+
const number = Number;
|
|
49
|
+
const string = String;
|
|
50
|
+
const boolean = Boolean;
|
|
48
51
|
const mathMin = math.min;
|
|
49
52
|
const isFiniteNumber = isFinite;
|
|
50
53
|
const isNullish = (thing) => thing == null;
|
|
@@ -705,9 +708,9 @@ const EditableThing = ({
|
|
|
705
708
|
} else if (isArray(thing)) {
|
|
706
709
|
setArrayThing(jsonString(thing));
|
|
707
710
|
} else {
|
|
708
|
-
setStringThing(
|
|
709
|
-
setNumberThing(
|
|
710
|
-
setBooleanThing(
|
|
711
|
+
setStringThing(string(thing));
|
|
712
|
+
setNumberThing(number(thing) || 0);
|
|
713
|
+
setBooleanThing(boolean(thing));
|
|
711
714
|
}
|
|
712
715
|
}
|
|
713
716
|
const handleThingChange = useCallback(
|
|
@@ -775,7 +778,7 @@ const EditableThing = ({
|
|
|
775
778
|
onChange: useCallback(
|
|
776
779
|
(event) =>
|
|
777
780
|
handleThingChange(
|
|
778
|
-
|
|
781
|
+
string(event[CURRENT_TARGET][_VALUE]),
|
|
779
782
|
setStringThing,
|
|
780
783
|
),
|
|
781
784
|
[handleThingChange],
|
|
@@ -791,7 +794,7 @@ const EditableThing = ({
|
|
|
791
794
|
onChange: useCallback(
|
|
792
795
|
(event) =>
|
|
793
796
|
handleThingChange(
|
|
794
|
-
|
|
797
|
+
number(event[CURRENT_TARGET][_VALUE] || 0),
|
|
795
798
|
setNumberThing,
|
|
796
799
|
),
|
|
797
800
|
[handleThingChange],
|
|
@@ -807,7 +810,7 @@ const EditableThing = ({
|
|
|
807
810
|
onChange: useCallback(
|
|
808
811
|
(event) =>
|
|
809
812
|
handleThingChange(
|
|
810
|
-
|
|
813
|
+
boolean(event[CURRENT_TARGET].checked),
|
|
811
814
|
setBooleanThing,
|
|
812
815
|
),
|
|
813
816
|
[handleThingChange],
|
|
@@ -38,13 +38,16 @@ const EXTRA = 'extra';
|
|
|
38
38
|
const strSplit = (str, separator = EMPTY_STRING, limit) =>
|
|
39
39
|
str.split(separator, limit);
|
|
40
40
|
|
|
41
|
+
const math = Math;
|
|
41
42
|
const getIfNotFunction = (predicate) => (value, then, otherwise) =>
|
|
42
43
|
predicate(value)
|
|
43
44
|
? /* istanbul ignore next */
|
|
44
45
|
otherwise?.()
|
|
45
46
|
: then(value);
|
|
46
47
|
const GLOBAL = globalThis;
|
|
47
|
-
const
|
|
48
|
+
const number = Number;
|
|
49
|
+
const string = String;
|
|
50
|
+
const boolean = Boolean;
|
|
48
51
|
const mathMin = math.min;
|
|
49
52
|
const isFiniteNumber = isFinite;
|
|
50
53
|
const isNullish = (thing) => thing == null;
|
|
@@ -705,9 +708,9 @@ const EditableThing = ({
|
|
|
705
708
|
} else if (isArray(thing)) {
|
|
706
709
|
setArrayThing(jsonString(thing));
|
|
707
710
|
} else {
|
|
708
|
-
setStringThing(
|
|
709
|
-
setNumberThing(
|
|
710
|
-
setBooleanThing(
|
|
711
|
+
setStringThing(string(thing));
|
|
712
|
+
setNumberThing(number(thing) || 0);
|
|
713
|
+
setBooleanThing(boolean(thing));
|
|
711
714
|
}
|
|
712
715
|
}
|
|
713
716
|
const handleThingChange = useCallback(
|
|
@@ -775,7 +778,7 @@ const EditableThing = ({
|
|
|
775
778
|
onChange: useCallback(
|
|
776
779
|
(event) =>
|
|
777
780
|
handleThingChange(
|
|
778
|
-
|
|
781
|
+
string(event[CURRENT_TARGET][_VALUE]),
|
|
779
782
|
setStringThing,
|
|
780
783
|
),
|
|
781
784
|
[handleThingChange],
|
|
@@ -791,7 +794,7 @@ const EditableThing = ({
|
|
|
791
794
|
onChange: useCallback(
|
|
792
795
|
(event) =>
|
|
793
796
|
handleThingChange(
|
|
794
|
-
|
|
797
|
+
number(event[CURRENT_TARGET][_VALUE] || 0),
|
|
795
798
|
setNumberThing,
|
|
796
799
|
),
|
|
797
800
|
[handleThingChange],
|
|
@@ -807,7 +810,7 @@ const EditableThing = ({
|
|
|
807
810
|
onChange: useCallback(
|
|
808
811
|
(event) =>
|
|
809
812
|
handleThingChange(
|
|
810
|
-
|
|
813
|
+
boolean(event[CURRENT_TARGET].checked),
|
|
811
814
|
setBooleanThing,
|
|
812
815
|
),
|
|
813
816
|
[handleThingChange],
|