@naturalcycles/js-lib 14.202.0 → 14.204.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.
package/dist/types.d.ts CHANGED
@@ -28,6 +28,8 @@ export type ObjectWithId = {
28
28
  export type PartialObjectWithId = {
29
29
  id?: string;
30
30
  };
31
+ export interface AnyPartialObjectWithId extends AnyObject, PartialObjectWithId {
32
+ }
31
33
  export interface AnyObjectWithId extends AnyObject, ObjectWithId {
32
34
  }
33
35
  /**
@@ -61,10 +63,10 @@ export type BaseDBEntity = {
61
63
  */
62
64
  updated?: UnixTimestampNumber;
63
65
  };
64
- export type Saved<T extends PartialObjectWithId> = T extends AnyObject ? Omit<T, 'id' | 'created' | 'updated'> & SavedDBEntity : T;
65
- export type Unsaved<T extends PartialObjectWithId> = T extends AnyObject ? Omit<T, 'id' | 'created' | 'updated'> & BaseDBEntity : T;
66
- export type UnsavedId<T extends PartialObjectWithId> = Omit<T, 'id'> & {
67
- id?: T['id'];
66
+ export type Saved<T> = T & SavedDBEntity;
67
+ export type Unsaved<T> = T extends AnyObject ? Omit<T, 'id' | 'created' | 'updated'> & BaseDBEntity : T;
68
+ export type UnsavedId<T> = Omit<T, 'id'> & {
69
+ id?: string;
68
70
  };
69
71
  /**
70
72
  * Convenience type shorthand.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@naturalcycles/js-lib",
3
- "version": "14.202.0",
3
+ "version": "14.204.0",
4
4
  "scripts": {
5
5
  "prepare": "husky install",
6
6
  "build-prod": "build-prod-esm-cjs",
package/src/types.ts CHANGED
@@ -39,6 +39,8 @@ export type PartialObjectWithId = {
39
39
  id?: string
40
40
  }
41
41
 
42
+ export interface AnyPartialObjectWithId extends AnyObject, PartialObjectWithId {}
43
+
42
44
  export interface AnyObjectWithId extends AnyObject, ObjectWithId {}
43
45
 
44
46
  /**
@@ -80,16 +82,14 @@ export type BaseDBEntity = {
80
82
  updated?: UnixTimestampNumber
81
83
  }
82
84
 
83
- export type Saved<T extends PartialObjectWithId> = T extends AnyObject
84
- ? Omit<T, 'id' | 'created' | 'updated'> & SavedDBEntity
85
- : T
85
+ export type Saved<T> = T & SavedDBEntity
86
86
 
87
- export type Unsaved<T extends PartialObjectWithId> = T extends AnyObject
87
+ export type Unsaved<T> = T extends AnyObject
88
88
  ? Omit<T, 'id' | 'created' | 'updated'> & BaseDBEntity
89
89
  : T
90
90
 
91
- export type UnsavedId<T extends PartialObjectWithId> = Omit<T, 'id'> & {
92
- id?: T['id']
91
+ export type UnsavedId<T> = Omit<T, 'id'> & {
92
+ id?: string
93
93
  }
94
94
 
95
95
  /**