sigo-entities 0.0.111 → 0.0.112
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/index.d.mts +1 -3
- package/dist/index.d.ts +1 -3
- package/dist/index.js +2 -1
- package/dist/index.mjs +2 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -4,9 +4,7 @@ declare class DestinatarioDTO {
|
|
|
4
4
|
Email: string;
|
|
5
5
|
}
|
|
6
6
|
|
|
7
|
-
declare function validateAndFormatData<T extends object>(data: any, dtoClass: new () => T, skipMissingProperties?:
|
|
8
|
-
[k: string]: any;
|
|
9
|
-
}>;
|
|
7
|
+
declare function validateAndFormatData<T extends object, Skip extends boolean = false>(data: any, dtoClass: new () => T, skipMissingProperties?: Skip): Promise<Skip extends true ? Partial<T> : T>;
|
|
10
8
|
|
|
11
9
|
declare class AlmacenDTO {
|
|
12
10
|
Codigo: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -4,9 +4,7 @@ declare class DestinatarioDTO {
|
|
|
4
4
|
Email: string;
|
|
5
5
|
}
|
|
6
6
|
|
|
7
|
-
declare function validateAndFormatData<T extends object>(data: any, dtoClass: new () => T, skipMissingProperties?:
|
|
8
|
-
[k: string]: any;
|
|
9
|
-
}>;
|
|
7
|
+
declare function validateAndFormatData<T extends object, Skip extends boolean = false>(data: any, dtoClass: new () => T, skipMissingProperties?: Skip): Promise<Skip extends true ? Partial<T> : T>;
|
|
10
8
|
|
|
11
9
|
declare class AlmacenDTO {
|
|
12
10
|
Codigo: string;
|
package/dist/index.js
CHANGED
|
@@ -249,9 +249,10 @@ async function validateAndFormatData(data, dtoClass, skipMissingProperties = fal
|
|
|
249
249
|
throw new Error(errorMessage);
|
|
250
250
|
}
|
|
251
251
|
if (skipMissingProperties) {
|
|
252
|
-
|
|
252
|
+
const result = Object.fromEntries(
|
|
253
253
|
Object.entries(instance).filter(([key, value]) => value !== void 0)
|
|
254
254
|
);
|
|
255
|
+
return result;
|
|
255
256
|
}
|
|
256
257
|
return instance;
|
|
257
258
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -52,9 +52,10 @@ async function validateAndFormatData(data, dtoClass, skipMissingProperties = fal
|
|
|
52
52
|
throw new Error(errorMessage);
|
|
53
53
|
}
|
|
54
54
|
if (skipMissingProperties) {
|
|
55
|
-
|
|
55
|
+
const result = Object.fromEntries(
|
|
56
56
|
Object.entries(instance).filter(([key, value]) => value !== void 0)
|
|
57
57
|
);
|
|
58
|
+
return result;
|
|
58
59
|
}
|
|
59
60
|
return instance;
|
|
60
61
|
}
|