@nxtedition/deepstream.io-client-js 31.2.14 → 31.2.16
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/package.json
CHANGED
|
@@ -10,6 +10,11 @@ import type {
|
|
|
10
10
|
|
|
11
11
|
type Lookup<Table, Name> = Name extends keyof Table ? Table[Name] : unknown
|
|
12
12
|
|
|
13
|
+
type Disposer = {
|
|
14
|
+
(): void
|
|
15
|
+
[Symbol.dispose](): void
|
|
16
|
+
}
|
|
17
|
+
|
|
13
18
|
export default class RecordHandler<Records = Record<string, unknown>> {
|
|
14
19
|
VOID: 0
|
|
15
20
|
CLIENT: 1
|
|
@@ -41,7 +46,7 @@ export default class RecordHandler<Records = Record<string, unknown>> {
|
|
|
41
46
|
pattern: string,
|
|
42
47
|
callback: (key: string) => unknown,
|
|
43
48
|
optionsOrRecursive?: ProvideOptions | boolean,
|
|
44
|
-
) =>
|
|
49
|
+
) => Disposer
|
|
45
50
|
|
|
46
51
|
sync: (options?: SyncOptions) => Promise<void>
|
|
47
52
|
|
|
@@ -223,6 +228,7 @@ export interface RecordStats {
|
|
|
223
228
|
export interface ProvideOptions {
|
|
224
229
|
recursive?: boolean
|
|
225
230
|
stringify?: ((input: unknown) => string) | null
|
|
231
|
+
mode: undefined | null | 'unicast'
|
|
226
232
|
}
|
|
227
233
|
|
|
228
234
|
export interface SyncOptions {
|
package/src/utils/utils.js
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import xxhash from 'xxhash-wasm'
|
|
2
2
|
|
|
3
3
|
const NODE_ENV = typeof process !== 'undefined' && process.env && process.env.NODE_ENV
|
|
4
|
+
const HASHER = await xxhash()
|
|
5
|
+
|
|
6
|
+
// This is a hack to avoid top-level await
|
|
7
|
+
// const HASHER = await xxhash()
|
|
4
8
|
export const isNode = typeof process !== 'undefined' && process.toString() === '[object process]'
|
|
5
9
|
export const isProduction = NODE_ENV === 'production'
|
|
6
10
|
|
|
@@ -177,23 +181,18 @@ export function removeAbortListener(signal, handler) {
|
|
|
177
181
|
}
|
|
178
182
|
}
|
|
179
183
|
|
|
180
|
-
// This is a hack to avoid top-level await
|
|
181
|
-
// const HASHER = await xxhash()
|
|
182
|
-
let HASHER
|
|
183
|
-
xxhash().then((hasher) => (HASHER = hasher))
|
|
184
|
-
|
|
185
184
|
export function h64ToString(str) {
|
|
186
185
|
return HASHER.h64ToString(str)
|
|
187
186
|
}
|
|
188
187
|
|
|
189
|
-
export function findBigIntPaths(obj, path =
|
|
188
|
+
export function findBigIntPaths(obj, path = '') {
|
|
190
189
|
const paths = []
|
|
191
190
|
|
|
192
|
-
if (typeof obj ===
|
|
191
|
+
if (typeof obj === 'bigint') {
|
|
193
192
|
return [path]
|
|
194
193
|
}
|
|
195
194
|
|
|
196
|
-
if (typeof obj ===
|
|
195
|
+
if (typeof obj === 'object' && obj !== null) {
|
|
197
196
|
for (const key of Object.keys(obj)) {
|
|
198
197
|
paths.push(...findBigIntPaths(obj[key], path ? `${path}.${key}` : key))
|
|
199
198
|
}
|