@twin.org/core 0.0.4-next.8 → 0.0.4-next.9
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/dist/es/encoding/base64.js +1 -1
- package/dist/es/encoding/base64.js.map +1 -1
- package/dist/es/errors/conflictError.js +1 -1
- package/dist/es/errors/conflictError.js.map +1 -1
- package/dist/es/errors/generalError.js +1 -1
- package/dist/es/errors/generalError.js.map +1 -1
- package/dist/es/errors/notImplementedError.js +1 -1
- package/dist/es/errors/notImplementedError.js.map +1 -1
- package/dist/es/errors/validationError.js +1 -1
- package/dist/es/errors/validationError.js.map +1 -1
- package/dist/es/helpers/arrayHelper.js +1 -1
- package/dist/es/helpers/arrayHelper.js.map +1 -1
- package/dist/es/helpers/errorHelper.js +1 -1
- package/dist/es/helpers/errorHelper.js.map +1 -1
- package/dist/es/helpers/jsonHelper.js +1 -1
- package/dist/es/helpers/jsonHelper.js.map +1 -1
- package/dist/es/helpers/objectHelper.js +2 -2
- package/dist/es/helpers/objectHelper.js.map +1 -1
- package/dist/es/helpers/stringHelper.js +2 -2
- package/dist/es/helpers/stringHelper.js.map +1 -1
- package/dist/es/index.js +4 -0
- package/dist/es/index.js.map +1 -1
- package/dist/es/models/IComponent.js.map +1 -1
- package/dist/es/models/ILocale.js.map +1 -1
- package/dist/es/models/ISharedObjectBufferOptions.js +4 -0
- package/dist/es/models/ISharedObjectBufferOptions.js.map +1 -0
- package/dist/es/models/ISharedObjectBufferWorkerMessage.js +2 -0
- package/dist/es/models/ISharedObjectBufferWorkerMessage.js.map +1 -0
- package/dist/es/models/IValidationFailure.js.map +1 -1
- package/dist/es/models/sharedObjectBufferMessageTypes.js +13 -0
- package/dist/es/models/sharedObjectBufferMessageTypes.js.map +1 -0
- package/dist/es/utils/asyncCache.js +1 -1
- package/dist/es/utils/asyncCache.js.map +1 -1
- package/dist/es/utils/coerce.js +10 -20
- package/dist/es/utils/coerce.js.map +1 -1
- package/dist/es/utils/compression.js +1 -1
- package/dist/es/utils/compression.js.map +1 -1
- package/dist/es/utils/is.js +9 -9
- package/dist/es/utils/is.js.map +1 -1
- package/dist/es/utils/sharedObjectBuffer.js +305 -0
- package/dist/es/utils/sharedObjectBuffer.js.map +1 -0
- package/dist/es/utils/sharedStore.js +2 -2
- package/dist/es/utils/sharedStore.js.map +1 -1
- package/dist/types/errors/conflictError.d.ts +1 -1
- package/dist/types/errors/generalError.d.ts +1 -1
- package/dist/types/errors/notImplementedError.d.ts +1 -1
- package/dist/types/errors/validationError.d.ts +1 -1
- package/dist/types/helpers/arrayHelper.d.ts +1 -1
- package/dist/types/helpers/errorHelper.d.ts +1 -1
- package/dist/types/helpers/jsonHelper.d.ts +1 -1
- package/dist/types/helpers/objectHelper.d.ts +2 -2
- package/dist/types/helpers/stringHelper.d.ts +2 -2
- package/dist/types/index.d.ts +4 -0
- package/dist/types/models/IComponent.d.ts +2 -2
- package/dist/types/models/ILocale.d.ts +1 -1
- package/dist/types/models/ISharedObjectBufferOptions.d.ts +17 -0
- package/dist/types/models/ISharedObjectBufferWorkerMessage.d.ts +29 -0
- package/dist/types/models/IValidationFailure.d.ts +1 -1
- package/dist/types/models/sharedObjectBufferMessageTypes.d.ts +13 -0
- package/dist/types/utils/asyncCache.d.ts +1 -1
- package/dist/types/utils/coerce.d.ts +10 -20
- package/dist/types/utils/compression.d.ts +1 -1
- package/dist/types/utils/is.d.ts +9 -9
- package/dist/types/utils/sharedObjectBuffer.d.ts +74 -0
- package/dist/types/utils/sharedStore.d.ts +2 -2
- package/docs/changelog.md +22 -0
- package/docs/reference/classes/ArrayHelper.md +1 -1
- package/docs/reference/classes/AsyncCache.md +1 -1
- package/docs/reference/classes/Coerce.md +10 -50
- package/docs/reference/classes/Compression.md +1 -1
- package/docs/reference/classes/ConflictError.md +1 -1
- package/docs/reference/classes/ErrorHelper.md +1 -1
- package/docs/reference/classes/GeneralError.md +1 -1
- package/docs/reference/classes/Is.md +9 -9
- package/docs/reference/classes/JsonHelper.md +1 -1
- package/docs/reference/classes/NotImplementedError.md +1 -1
- package/docs/reference/classes/ObjectHelper.md +2 -2
- package/docs/reference/classes/SharedObjectBuffer.md +192 -0
- package/docs/reference/classes/SharedStore.md +2 -2
- package/docs/reference/classes/StringHelper.md +16 -13
- package/docs/reference/classes/ValidationError.md +1 -1
- package/docs/reference/index.md +5 -0
- package/docs/reference/interfaces/IComponent.md +2 -2
- package/docs/reference/interfaces/ILocale.md +1 -1
- package/docs/reference/interfaces/ISharedObjectBufferOptions.md +33 -0
- package/docs/reference/interfaces/ISharedObjectBufferWorkerMessage.md +44 -0
- package/docs/reference/interfaces/IValidationFailure.md +1 -1
- package/docs/reference/type-aliases/SharedObjectBufferMessageTypes.md +5 -0
- package/docs/reference/variables/SharedObjectBufferMessageTypes.md +13 -0
- package/locales/en.json +5 -0
- package/package.json +2 -2
|
@@ -6,71 +6,61 @@ export declare class Coerce {
|
|
|
6
6
|
/**
|
|
7
7
|
* Coerce the value to a string.
|
|
8
8
|
* @param value The value to coerce.
|
|
9
|
-
* @
|
|
10
|
-
* @returns The value if it can be coerced.
|
|
9
|
+
* @returns The coerced string, or undefined if the value cannot be coerced.
|
|
11
10
|
*/
|
|
12
11
|
static string(value: unknown): string | undefined;
|
|
13
12
|
/**
|
|
14
13
|
* Coerce the value to a number.
|
|
15
14
|
* @param value The value to coerce.
|
|
16
|
-
* @
|
|
17
|
-
* @returns The value if it can be coerced.
|
|
15
|
+
* @returns The coerced number, or undefined if the value cannot be coerced.
|
|
18
16
|
*/
|
|
19
17
|
static number(value: unknown): number | undefined;
|
|
20
18
|
/**
|
|
21
19
|
* Coerce the value to an integer.
|
|
22
20
|
* @param value The value to coerce.
|
|
23
|
-
* @
|
|
24
|
-
* @returns The value if it can be coerced.
|
|
21
|
+
* @returns The coerced integer, or undefined if the value cannot be coerced.
|
|
25
22
|
*/
|
|
26
23
|
static integer(value: unknown): number | undefined;
|
|
27
24
|
/**
|
|
28
25
|
* Coerce the value to a bigint.
|
|
29
26
|
* @param value The value to coerce.
|
|
30
|
-
* @
|
|
31
|
-
* @returns The value if it can be coerced.
|
|
27
|
+
* @returns The coerced bigint, or undefined if the value cannot be coerced.
|
|
32
28
|
*/
|
|
33
29
|
static bigint(value: unknown): bigint | undefined;
|
|
34
30
|
/**
|
|
35
31
|
* Coerce the value to a boolean.
|
|
36
32
|
* @param value The value to coerce.
|
|
37
|
-
* @
|
|
38
|
-
* @returns The value if it can be coerced.
|
|
33
|
+
* @returns The coerced boolean, or undefined if the value cannot be coerced.
|
|
39
34
|
*/
|
|
40
35
|
static boolean(value: unknown): boolean | undefined;
|
|
41
36
|
/**
|
|
42
37
|
* Coerce the value to a date.
|
|
43
38
|
* @param value The value to coerce.
|
|
44
|
-
* @
|
|
45
|
-
* @returns The value if it can be coerced.
|
|
39
|
+
* @returns The coerced date, or undefined if the value cannot be coerced.
|
|
46
40
|
*/
|
|
47
41
|
static date(value: unknown): Date | undefined;
|
|
48
42
|
/**
|
|
49
43
|
* Coerce the value to a date/time.
|
|
50
44
|
* @param value The value to coerce.
|
|
51
|
-
* @
|
|
52
|
-
* @returns The value if it can be coerced.
|
|
45
|
+
* @returns The coerced date/time, or undefined if the value cannot be coerced.
|
|
53
46
|
*/
|
|
54
47
|
static dateTime(value: unknown): Date | undefined;
|
|
55
48
|
/**
|
|
56
49
|
* Coerce the value to a time.
|
|
57
50
|
* @param value The value to coerce.
|
|
58
|
-
* @
|
|
59
|
-
* @returns The value if it can be coerced.
|
|
51
|
+
* @returns The coerced time, or undefined if the value cannot be coerced.
|
|
60
52
|
*/
|
|
61
53
|
static time(value: unknown): Date | undefined;
|
|
62
54
|
/**
|
|
63
55
|
* Coerce the value to an object.
|
|
64
56
|
* @param value The value to coerce.
|
|
65
|
-
* @
|
|
66
|
-
* @returns The value if it can be coerced.
|
|
57
|
+
* @returns The coerced object, or undefined if the value cannot be coerced.
|
|
67
58
|
*/
|
|
68
59
|
static object<T = unknown>(value: unknown): T | undefined;
|
|
69
60
|
/**
|
|
70
61
|
* Coerce the value to a Uint8Array.
|
|
71
62
|
* @param value The value to coerce.
|
|
72
|
-
* @
|
|
73
|
-
* @returns The value if it can be coerced.
|
|
63
|
+
* @returns The coerced Uint8Array, or undefined if the value cannot be coerced.
|
|
74
64
|
*/
|
|
75
65
|
static uint8Array(value: unknown): Uint8Array | undefined;
|
|
76
66
|
/**
|
|
@@ -8,7 +8,7 @@ export declare class Compression {
|
|
|
8
8
|
*/
|
|
9
9
|
static readonly CLASS_NAME: string;
|
|
10
10
|
/**
|
|
11
|
-
* Compress bytes using
|
|
11
|
+
* Compress bytes using the specified compression type.
|
|
12
12
|
* @param bytes The bytes to compress.
|
|
13
13
|
* @param type The type of compression to use.
|
|
14
14
|
* @returns The compressed bytes.
|
package/dist/types/utils/is.d.ts
CHANGED
|
@@ -5,25 +5,25 @@ export declare class Is {
|
|
|
5
5
|
/**
|
|
6
6
|
* Is the property undefined.
|
|
7
7
|
* @param value The value to test.
|
|
8
|
-
* @returns True if the value is
|
|
8
|
+
* @returns True if the value is undefined.
|
|
9
9
|
*/
|
|
10
10
|
static undefined(value: unknown): value is undefined;
|
|
11
11
|
/**
|
|
12
12
|
* Is the property null.
|
|
13
13
|
* @param value The value to test.
|
|
14
|
-
* @returns True if the value is
|
|
14
|
+
* @returns True if the value is null.
|
|
15
15
|
*/
|
|
16
16
|
static null(value: unknown): value is null;
|
|
17
17
|
/**
|
|
18
18
|
* Is the property null or undefined.
|
|
19
19
|
* @param value The value to test.
|
|
20
|
-
* @returns True if the value is
|
|
20
|
+
* @returns True if the value is null or undefined.
|
|
21
21
|
*/
|
|
22
22
|
static empty(value: unknown): value is undefined | null;
|
|
23
23
|
/**
|
|
24
|
-
* Is the property
|
|
24
|
+
* Is the property not null or undefined.
|
|
25
25
|
* @param value The value to test.
|
|
26
|
-
* @returns True if the value is
|
|
26
|
+
* @returns True if the value is not null or undefined.
|
|
27
27
|
*/
|
|
28
28
|
static notEmpty(value: unknown): boolean;
|
|
29
29
|
/**
|
|
@@ -33,9 +33,9 @@ export declare class Is {
|
|
|
33
33
|
*/
|
|
34
34
|
static string(value: unknown): value is string;
|
|
35
35
|
/**
|
|
36
|
-
* Is the value a string.
|
|
36
|
+
* Is the value a non-empty string.
|
|
37
37
|
* @param value The value to test.
|
|
38
|
-
* @returns True if the value is a string.
|
|
38
|
+
* @returns True if the value is a non-empty string.
|
|
39
39
|
*/
|
|
40
40
|
static stringValue(value: unknown): value is string;
|
|
41
41
|
/**
|
|
@@ -134,13 +134,13 @@ export declare class Is {
|
|
|
134
134
|
/**
|
|
135
135
|
* Is the value a timestamp in seconds.
|
|
136
136
|
* @param value The value to test.
|
|
137
|
-
* @returns True if the value is a
|
|
137
|
+
* @returns True if the value is a timestamp in seconds.
|
|
138
138
|
*/
|
|
139
139
|
static timestampSeconds(value: unknown): value is number;
|
|
140
140
|
/**
|
|
141
141
|
* Is the value a timestamp in milliseconds.
|
|
142
142
|
* @param value The value to test.
|
|
143
|
-
* @returns True if the value is a
|
|
143
|
+
* @returns True if the value is a timestamp in milliseconds.
|
|
144
144
|
*/
|
|
145
145
|
static timestampMilliseconds(value: unknown): value is number;
|
|
146
146
|
/**
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import type { ISharedObjectBufferOptions } from "../models/ISharedObjectBufferOptions.js";
|
|
2
|
+
/**
|
|
3
|
+
* Manages per-object SharedArrayBuffers that store objects as UTF-8 JSON.
|
|
4
|
+
* Buffer layout: 4-byte Int32 header (current data byte length) followed by the JSON-encoded object.
|
|
5
|
+
* Buffers are explicitly created with create and cached in SharedStore.
|
|
6
|
+
* On a worker thread an existing buffer is fetched via a MessagePort handshake
|
|
7
|
+
* (same protocol as Mutex) and cached locally.
|
|
8
|
+
* Buffers grow automatically when the payload exceeds capacity; when the payload drops well below
|
|
9
|
+
* capacity the buffer is replaced with a smaller one. The caller must hold the objectId-keyed Mutex
|
|
10
|
+
* around every read and write. The main thread's worker message handler must forward messages to
|
|
11
|
+
* both Mutex.handleWorkerMessage and SharedObjectBuffer.handleWorkerMessage.
|
|
12
|
+
*/
|
|
13
|
+
export declare class SharedObjectBuffer {
|
|
14
|
+
/**
|
|
15
|
+
* Runtime name for the class.
|
|
16
|
+
*/
|
|
17
|
+
static readonly CLASS_NAME: string;
|
|
18
|
+
/**
|
|
19
|
+
* Default payload capacity per object (1 MiB). The first caller that creates the buffer
|
|
20
|
+
* for an object determines its initial capacity; later callers that pass a different value
|
|
21
|
+
* are ignored.
|
|
22
|
+
*/
|
|
23
|
+
static readonly DEFAULT_CAPACITY_BYTES: number;
|
|
24
|
+
/**
|
|
25
|
+
* Default upper bound for how large a buffer may grow (256 MiB).
|
|
26
|
+
* Override per-object via the maxCapacityBytes option on create.
|
|
27
|
+
*/
|
|
28
|
+
static readonly MAX_CAPACITY_BYTES: number;
|
|
29
|
+
/**
|
|
30
|
+
* Create the buffer for the given objectId if it does not already exist.
|
|
31
|
+
* Must be called while holding Mutex.lock(objectId).
|
|
32
|
+
* @param objectId The object id that identifies the buffer.
|
|
33
|
+
* @param options Optional capacity configuration used when creating the buffer.
|
|
34
|
+
*/
|
|
35
|
+
static create(objectId: string, options?: ISharedObjectBufferOptions): Promise<void>;
|
|
36
|
+
/**
|
|
37
|
+
* Read and decode the object stored for the given objectId.
|
|
38
|
+
* Must be called while holding Mutex.lock(objectId).
|
|
39
|
+
* @param objectId The object id that identifies the buffer.
|
|
40
|
+
* @returns The stored object, or undefined when nothing has been written yet.
|
|
41
|
+
*/
|
|
42
|
+
static read<T>(objectId: string): Promise<T | undefined>;
|
|
43
|
+
/**
|
|
44
|
+
* Encode and write the object into the buffer for the given objectId.
|
|
45
|
+
* The buffer must already exist, usually by calling create first.
|
|
46
|
+
* When the encoded payload exceeds the current buffer capacity the buffer is grown
|
|
47
|
+
* in-place via SharedArrayBuffer.grow so every thread with a reference sees the
|
|
48
|
+
* new size without any pointer swap. When the payload is smaller than
|
|
49
|
+
* _SHRINK_THRESHOLD of the current capacity and the capacity exceeds
|
|
50
|
+
* DEFAULT_CAPACITY_BYTES, the buffer is replaced with a smaller one on the calling thread.
|
|
51
|
+
* Must be called while holding Mutex.lock(objectId).
|
|
52
|
+
* @param objectId The object id that identifies the buffer.
|
|
53
|
+
* @param value The object to persist.
|
|
54
|
+
*/
|
|
55
|
+
static write<T>(objectId: string, value: T): Promise<void>;
|
|
56
|
+
/**
|
|
57
|
+
* Remove the stored object and release the buffer for the given objectId.
|
|
58
|
+
* The entry is deleted from the local cache so subsequent reads or writes will
|
|
59
|
+
* create or fetch a fresh buffer. Worker threads that have cached the old buffer
|
|
60
|
+
* reference continue using it until they restart or re-request via the worker protocol.
|
|
61
|
+
* Must be called while holding Mutex.lock(objectId).
|
|
62
|
+
* @param objectId The object id that identifies the buffer.
|
|
63
|
+
*/
|
|
64
|
+
static remove(objectId: string): void;
|
|
65
|
+
/**
|
|
66
|
+
* Inspect a message from a worker thread and, if it is a SharedObjectBuffer
|
|
67
|
+
* buffer-fetch request, respond to it synchronously.
|
|
68
|
+
* Call this from the main thread's worker message handler alongside
|
|
69
|
+
* Mutex.handleWorkerMessage.
|
|
70
|
+
* @param msg The raw message received from the worker.
|
|
71
|
+
* @returns True if the message was a SharedObjectBuffer protocol message, false otherwise.
|
|
72
|
+
*/
|
|
73
|
+
static handleWorkerMessage(msg: unknown): boolean;
|
|
74
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Provide a store for shared objects which can be
|
|
3
|
-
* instance loads of a
|
|
2
|
+
* Provide a store for shared objects which can be accessed through multiple
|
|
3
|
+
* instance loads of a package.
|
|
4
4
|
*/
|
|
5
5
|
export declare class SharedStore {
|
|
6
6
|
/**
|
package/docs/changelog.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.0.4-next.9](https://github.com/iotaledger/twin-framework/compare/core-v0.0.4-next.8...core-v0.0.4-next.9) (2026-06-15)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* shared object buffer ([#355](https://github.com/iotaledger/twin-framework/issues/355)) ([70d82ea](https://github.com/iotaledger/twin-framework/commit/70d82ea8f43f01aa840ae90ee0b1f23b064a07c6))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* linting ([b77511d](https://github.com/iotaledger/twin-framework/commit/b77511de8781707088b1beb4c92f12d7d6e0fd5f))
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### Dependencies
|
|
17
|
+
|
|
18
|
+
* The following workspace dependencies were updated
|
|
19
|
+
* dependencies
|
|
20
|
+
* @twin.org/nameof bumped from 0.0.4-next.8 to 0.0.4-next.9
|
|
21
|
+
* devDependencies
|
|
22
|
+
* @twin.org/nameof-transformer bumped from 0.0.4-next.8 to 0.0.4-next.9
|
|
23
|
+
* @twin.org/nameof-vitest-plugin bumped from 0.0.4-next.8 to 0.0.4-next.9
|
|
24
|
+
|
|
3
25
|
## [0.0.4-next.8](https://github.com/iotaledger/twin-framework/compare/core-v0.0.4-next.7...core-v0.0.4-next.8) (2026-06-10)
|
|
4
26
|
|
|
5
27
|
|
|
@@ -32,11 +32,7 @@ The value to coerce.
|
|
|
32
32
|
|
|
33
33
|
`string` \| `undefined`
|
|
34
34
|
|
|
35
|
-
The
|
|
36
|
-
|
|
37
|
-
#### Throws
|
|
38
|
-
|
|
39
|
-
TypeError If the value can not be coerced.
|
|
35
|
+
The coerced string, or undefined if the value cannot be coerced.
|
|
40
36
|
|
|
41
37
|
***
|
|
42
38
|
|
|
@@ -58,11 +54,7 @@ The value to coerce.
|
|
|
58
54
|
|
|
59
55
|
`number` \| `undefined`
|
|
60
56
|
|
|
61
|
-
The
|
|
62
|
-
|
|
63
|
-
#### Throws
|
|
64
|
-
|
|
65
|
-
TypeError If the value can not be coerced.
|
|
57
|
+
The coerced number, or undefined if the value cannot be coerced.
|
|
66
58
|
|
|
67
59
|
***
|
|
68
60
|
|
|
@@ -84,11 +76,7 @@ The value to coerce.
|
|
|
84
76
|
|
|
85
77
|
`number` \| `undefined`
|
|
86
78
|
|
|
87
|
-
The
|
|
88
|
-
|
|
89
|
-
#### Throws
|
|
90
|
-
|
|
91
|
-
TypeError If the value can not be coerced.
|
|
79
|
+
The coerced integer, or undefined if the value cannot be coerced.
|
|
92
80
|
|
|
93
81
|
***
|
|
94
82
|
|
|
@@ -110,11 +98,7 @@ The value to coerce.
|
|
|
110
98
|
|
|
111
99
|
`bigint` \| `undefined`
|
|
112
100
|
|
|
113
|
-
The
|
|
114
|
-
|
|
115
|
-
#### Throws
|
|
116
|
-
|
|
117
|
-
TypeError If the value can not be coerced.
|
|
101
|
+
The coerced bigint, or undefined if the value cannot be coerced.
|
|
118
102
|
|
|
119
103
|
***
|
|
120
104
|
|
|
@@ -136,11 +120,7 @@ The value to coerce.
|
|
|
136
120
|
|
|
137
121
|
`boolean` \| `undefined`
|
|
138
122
|
|
|
139
|
-
The
|
|
140
|
-
|
|
141
|
-
#### Throws
|
|
142
|
-
|
|
143
|
-
TypeError If the value can not be coerced.
|
|
123
|
+
The coerced boolean, or undefined if the value cannot be coerced.
|
|
144
124
|
|
|
145
125
|
***
|
|
146
126
|
|
|
@@ -162,11 +142,7 @@ The value to coerce.
|
|
|
162
142
|
|
|
163
143
|
`Date` \| `undefined`
|
|
164
144
|
|
|
165
|
-
The
|
|
166
|
-
|
|
167
|
-
#### Throws
|
|
168
|
-
|
|
169
|
-
TypeError If the value can not be coerced.
|
|
145
|
+
The coerced date, or undefined if the value cannot be coerced.
|
|
170
146
|
|
|
171
147
|
***
|
|
172
148
|
|
|
@@ -188,11 +164,7 @@ The value to coerce.
|
|
|
188
164
|
|
|
189
165
|
`Date` \| `undefined`
|
|
190
166
|
|
|
191
|
-
The
|
|
192
|
-
|
|
193
|
-
#### Throws
|
|
194
|
-
|
|
195
|
-
TypeError If the value can not be coerced.
|
|
167
|
+
The coerced date/time, or undefined if the value cannot be coerced.
|
|
196
168
|
|
|
197
169
|
***
|
|
198
170
|
|
|
@@ -214,11 +186,7 @@ The value to coerce.
|
|
|
214
186
|
|
|
215
187
|
`Date` \| `undefined`
|
|
216
188
|
|
|
217
|
-
The
|
|
218
|
-
|
|
219
|
-
#### Throws
|
|
220
|
-
|
|
221
|
-
TypeError If the value can not be coerced.
|
|
189
|
+
The coerced time, or undefined if the value cannot be coerced.
|
|
222
190
|
|
|
223
191
|
***
|
|
224
192
|
|
|
@@ -246,11 +214,7 @@ The value to coerce.
|
|
|
246
214
|
|
|
247
215
|
`T` \| `undefined`
|
|
248
216
|
|
|
249
|
-
The
|
|
250
|
-
|
|
251
|
-
#### Throws
|
|
252
|
-
|
|
253
|
-
TypeError If the value can not be coerced.
|
|
217
|
+
The coerced object, or undefined if the value cannot be coerced.
|
|
254
218
|
|
|
255
219
|
***
|
|
256
220
|
|
|
@@ -272,11 +236,7 @@ The value to coerce.
|
|
|
272
236
|
|
|
273
237
|
`Uint8Array`\<`ArrayBufferLike`\> \| `undefined`
|
|
274
238
|
|
|
275
|
-
The
|
|
276
|
-
|
|
277
|
-
#### Throws
|
|
278
|
-
|
|
279
|
-
TypeError If the value can not be coerced.
|
|
239
|
+
The coerced Uint8Array, or undefined if the value cannot be coerced.
|
|
280
240
|
|
|
281
241
|
***
|
|
282
242
|
|
|
@@ -32,7 +32,7 @@ The value to test.
|
|
|
32
32
|
|
|
33
33
|
`value is undefined`
|
|
34
34
|
|
|
35
|
-
True if the value is
|
|
35
|
+
True if the value is undefined.
|
|
36
36
|
|
|
37
37
|
***
|
|
38
38
|
|
|
@@ -54,7 +54,7 @@ The value to test.
|
|
|
54
54
|
|
|
55
55
|
`value is null`
|
|
56
56
|
|
|
57
|
-
True if the value is
|
|
57
|
+
True if the value is null.
|
|
58
58
|
|
|
59
59
|
***
|
|
60
60
|
|
|
@@ -76,7 +76,7 @@ The value to test.
|
|
|
76
76
|
|
|
77
77
|
value is null \| undefined
|
|
78
78
|
|
|
79
|
-
True if the value is
|
|
79
|
+
True if the value is null or undefined.
|
|
80
80
|
|
|
81
81
|
***
|
|
82
82
|
|
|
@@ -84,7 +84,7 @@ True if the value is a empty.
|
|
|
84
84
|
|
|
85
85
|
> `static` **notEmpty**(`value`): `boolean`
|
|
86
86
|
|
|
87
|
-
Is the property
|
|
87
|
+
Is the property not null or undefined.
|
|
88
88
|
|
|
89
89
|
#### Parameters
|
|
90
90
|
|
|
@@ -98,7 +98,7 @@ The value to test.
|
|
|
98
98
|
|
|
99
99
|
`boolean`
|
|
100
100
|
|
|
101
|
-
True if the value is
|
|
101
|
+
True if the value is not null or undefined.
|
|
102
102
|
|
|
103
103
|
***
|
|
104
104
|
|
|
@@ -128,7 +128,7 @@ True if the value is a string.
|
|
|
128
128
|
|
|
129
129
|
> `static` **stringValue**(`value`): `value is string`
|
|
130
130
|
|
|
131
|
-
Is the value a string.
|
|
131
|
+
Is the value a non-empty string.
|
|
132
132
|
|
|
133
133
|
#### Parameters
|
|
134
134
|
|
|
@@ -142,7 +142,7 @@ The value to test.
|
|
|
142
142
|
|
|
143
143
|
`value is string`
|
|
144
144
|
|
|
145
|
-
True if the value is a string.
|
|
145
|
+
True if the value is a non-empty string.
|
|
146
146
|
|
|
147
147
|
***
|
|
148
148
|
|
|
@@ -512,7 +512,7 @@ The value to test.
|
|
|
512
512
|
|
|
513
513
|
`value is number`
|
|
514
514
|
|
|
515
|
-
True if the value is a
|
|
515
|
+
True if the value is a timestamp in seconds.
|
|
516
516
|
|
|
517
517
|
***
|
|
518
518
|
|
|
@@ -534,7 +534,7 @@ The value to test.
|
|
|
534
534
|
|
|
535
535
|
`value is number`
|
|
536
536
|
|
|
537
|
-
True if the value is a
|
|
537
|
+
True if the value is a timestamp in milliseconds.
|
|
538
538
|
|
|
539
539
|
***
|
|
540
540
|
|
|
@@ -506,7 +506,7 @@ The object without the omitted keys, or undefined if the input was undefined.
|
|
|
506
506
|
|
|
507
507
|
> `static` **toExtended**(`obj`): `any`
|
|
508
508
|
|
|
509
|
-
|
|
509
|
+
Convert the non JSON primitives to extended types.
|
|
510
510
|
|
|
511
511
|
#### Parameters
|
|
512
512
|
|
|
@@ -528,7 +528,7 @@ The object with extended properties.
|
|
|
528
528
|
|
|
529
529
|
> `static` **fromExtended**(`obj`): `any`
|
|
530
530
|
|
|
531
|
-
|
|
531
|
+
Convert the extended types to non JSON primitives.
|
|
532
532
|
|
|
533
533
|
#### Parameters
|
|
534
534
|
|