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