@etsoo/shared 1.0.99 → 1.1.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.
@@ -117,9 +117,9 @@ export declare namespace DataTypes {
117
117
  * Add or edit conditional type for same data model
118
118
  * Dynamic add changedFields for editing case
119
119
  */
120
- type AddOrEditType<T, Editing extends boolean> = Editing extends true ? T & {
120
+ type AddOrEditType<T, Editing extends boolean> = (Editing extends true ? T : Partial<T>) & {
121
121
  changedFields?: string[];
122
- } : Partial<T>;
122
+ };
123
123
  /**
124
124
  * Enum value type
125
125
  */
@@ -117,9 +117,9 @@ export declare namespace DataTypes {
117
117
  * Add or edit conditional type for same data model
118
118
  * Dynamic add changedFields for editing case
119
119
  */
120
- type AddOrEditType<T, Editing extends boolean> = Editing extends true ? T & {
120
+ type AddOrEditType<T, Editing extends boolean> = (Editing extends true ? T : Partial<T>) & {
121
121
  changedFields?: string[];
122
- } : Partial<T>;
122
+ };
123
123
  /**
124
124
  * Enum value type
125
125
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/shared",
3
- "version": "1.0.99",
3
+ "version": "1.1.0",
4
4
  "description": "TypeScript shared utilities and functions",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/mjs/index.js",
package/src/DataTypes.ts CHANGED
@@ -151,9 +151,10 @@ export namespace DataTypes {
151
151
  * Add or edit conditional type for same data model
152
152
  * Dynamic add changedFields for editing case
153
153
  */
154
- export type AddOrEditType<T, Editing extends boolean> = Editing extends true
155
- ? T & { changedFields?: string[] }
156
- : Partial<T>;
154
+ export type AddOrEditType<
155
+ T,
156
+ Editing extends boolean
157
+ > = (Editing extends true ? T : Partial<T>) & { changedFields?: string[] };
157
158
 
158
159
  /**
159
160
  * Enum value type