@naturalcycles/js-lib 14.203.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 +4 -4
- package/package.json +1 -1
- package/src/types.ts +4 -6
package/dist/types.d.ts
CHANGED
|
@@ -63,10 +63,10 @@ export type BaseDBEntity = {
|
|
|
63
63
|
*/
|
|
64
64
|
updated?: UnixTimestampNumber;
|
|
65
65
|
};
|
|
66
|
-
export type Saved<T
|
|
67
|
-
export type Unsaved<T
|
|
68
|
-
export type UnsavedId<T
|
|
69
|
-
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;
|
|
70
70
|
};
|
|
71
71
|
/**
|
|
72
72
|
* Convenience type shorthand.
|
package/package.json
CHANGED
package/src/types.ts
CHANGED
|
@@ -82,16 +82,14 @@ export type BaseDBEntity = {
|
|
|
82
82
|
updated?: UnixTimestampNumber
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
-
export type Saved<T
|
|
86
|
-
? Omit<T, 'id' | 'created' | 'updated'> & SavedDBEntity
|
|
87
|
-
: T
|
|
85
|
+
export type Saved<T> = T & SavedDBEntity
|
|
88
86
|
|
|
89
|
-
export type Unsaved<T
|
|
87
|
+
export type Unsaved<T> = T extends AnyObject
|
|
90
88
|
? Omit<T, 'id' | 'created' | 'updated'> & BaseDBEntity
|
|
91
89
|
: T
|
|
92
90
|
|
|
93
|
-
export type UnsavedId<T
|
|
94
|
-
id?:
|
|
91
|
+
export type UnsavedId<T> = Omit<T, 'id'> & {
|
|
92
|
+
id?: string
|
|
95
93
|
}
|
|
96
94
|
|
|
97
95
|
/**
|