@nxtedition/deepstream.io-client-js 31.0.15 → 31.0.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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nxtedition/deepstream.io-client-js",
3
- "version": "31.0.15",
3
+ "version": "31.0.16",
4
4
  "description": "the javascript client for deepstream.io",
5
5
  "homepage": "http://deepstream.io",
6
6
  "type": "module",
@@ -72,6 +72,8 @@ ds.record.set('c', 'a.b1', 'test')
72
72
  ds.record.set('x:domain', 'd1', 'test')
73
73
  const id = 'id'
74
74
  ds.record.set(`${id}:domain`, 'd2.d3', 'test')
75
+ expectError(ds.record.set(`${id}:domain`, 'd2.d3', 22))
76
+ ds.record.set(`${id}:domain`, ['d2', 'd3'] as const, 'test')
75
77
 
76
78
  expectAssignable<string>(await ds.record.get(`${id}:domain`, 'd2.d3'))
77
79
 
@@ -98,8 +100,7 @@ const daRec = ds.record.getRecord('o')
98
100
  daRec.set({ o0: {} })
99
101
 
100
102
  daRec.update('o0', (x) => ({ ...x, o1: {} }))
103
+ expectError(daRec.set('o0.x1', {}))
104
+ daRec.set('o0.o1', {})
101
105
  expectError(daRec.update((x) => 'x'))
102
106
  expectError(daRec.update('o0', (x) => ({ ...x, o1: '22' })))
103
-
104
- ds.record.set('foo', { num: [22, true] })
105
- ds.record.set('foo', { num: ['22'] })
@@ -1,6 +1,6 @@
1
1
  import type { Observable } from 'rxjs'
2
2
  import type DsRecord from './record.js'
3
- import type { EmptyObject, Get, Paths } from './record.js'
3
+ import type { EmptyObject, Get } from './record.js'
4
4
 
5
5
  export default class RecordHandler<
6
6
  Lookup extends Record<string, unknown> = Record<string, unknown>,
@@ -40,7 +40,7 @@ export default class RecordHandler<
40
40
  <Name extends string, Path extends string | string[]>(
41
41
  name: Name,
42
42
  path: Path,
43
- data: Path extends Paths<Lookup[Name]> ? Get<Lookup[Name], Path> : never,
43
+ data: unknown extends Get<Lookup[Name], Path> ? never : Get<Lookup[Name], Path>,
44
44
  ): void
45
45
  }
46
46
 
@@ -64,7 +64,10 @@ export default class Record<Data = unknown> {
64
64
 
65
65
  set: {
66
66
  // with path
67
- <P extends string | string[]>(path: P, dataAtPath: Get<Data, P>): void
67
+ <P extends string | readonly string[]>(
68
+ path: P,
69
+ dataAtPath: unknown extends Get<Data, P> ? never : Get<Data, P>,
70
+ ): void
68
71
  // without path
69
72
  (data: SettablePossibleEmpty<Data>): void
70
73
  }