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 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?: boolean): Promise<T | {
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?: boolean): Promise<T | {
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
- return Object.fromEntries(
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
- return Object.fromEntries(
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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sigo-entities",
3
- "version": "0.0.111",
3
+ "version": "0.0.112",
4
4
  "description": "Desarrollo de modelos de datos SIGO",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",