@naturalcycles/db-lib 10.31.0 → 10.33.0

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.
@@ -29,10 +29,9 @@ export const testItemBMJsonSchema = j
29
29
  k3: j.number().optional(),
30
30
  even: j.boolean().optional(),
31
31
  b1: j.buffer().optional(),
32
- nested: j.object({ foo: j.number() }).optional(),
32
+ nested: j.object.infer({ foo: j.number() }).optional(),
33
33
  })
34
34
  .dbEntity()
35
- .isOfType()
36
35
  .build();
37
36
  export function createTestItemDBM(num = 1) {
38
37
  return {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@naturalcycles/db-lib",
3
3
  "type": "module",
4
- "version": "10.31.0",
4
+ "version": "10.33.0",
5
5
  "dependencies": {
6
6
  "@naturalcycles/js-lib": "^15",
7
7
  "@naturalcycles/nodejs-lib": "^15"
@@ -51,7 +51,7 @@ export const testItemTMSchema: ObjectSchema<TestItemTM> = objectSchema<TestItemT
51
51
  })
52
52
 
53
53
  export const testItemBMJsonSchema = j
54
- .object({
54
+ .object<TestItemBM>({
55
55
  // todo: figure out how to not copy-paste these 3 fields
56
56
  id: j.string(), // todo: not strictly needed here
57
57
  created: j.number().integer().unixTimestamp(),
@@ -61,10 +61,9 @@ export const testItemBMJsonSchema = j
61
61
  k3: j.number().optional(),
62
62
  even: j.boolean().optional(),
63
63
  b1: j.buffer().optional(),
64
- nested: j.object({ foo: j.number() }).optional(),
64
+ nested: j.object.infer({ foo: j.number() }).optional(),
65
65
  })
66
66
  .dbEntity()
67
- .isOfType<TestItemBM>()
68
67
  .build()
69
68
 
70
69
  export function createTestItemDBM(num = 1): TestItemDBM {