mapper-factory 4.0.2 → 4.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.
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { MapInterface } from "../class.decorator";
|
|
2
2
|
export declare function ArrayField<T extends MapInterface<T>>(clsFactory: new () => T, opt?: {
|
|
3
3
|
src?: string;
|
|
4
|
-
}): (target: unknown, propertyKey: string | symbol) => void;
|
|
4
|
+
}): (target: unknown, propertyKey: string | symbol | object) => void;
|
|
@@ -12,7 +12,7 @@ export interface MapperMetadata<T = any> {
|
|
|
12
12
|
}
|
|
13
13
|
export declare function isClass(func: any): func is ClassType;
|
|
14
14
|
export declare function getPrototype(target: Record<string, unknown> | ClassType): any;
|
|
15
|
-
export declare const MapField: <T = any>({ transformer, reverser, src, initialize, }?: MapperMetadata<T>) => ((target: unknown, propertyKey: string | symbol) => void);
|
|
15
|
+
export declare const MapField: <T = any>({ transformer, reverser, src, initialize, }?: MapperMetadata<T>) => ((target: unknown, propertyKey: string | symbol | object) => void);
|
|
16
16
|
export declare const getMapFieldMetadataList: (target: Record<string, unknown> | ClassType | any) => {
|
|
17
17
|
[key: string]: MapperMetadata;
|
|
18
18
|
} | undefined;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { MapInterface } from "../class.decorator";
|
|
2
2
|
export declare function ObjectField<T extends MapInterface<T>>(clsFactory: new () => T, opt?: {
|
|
3
3
|
src?: string;
|
|
4
|
-
}): (target: unknown, propertyKey: string | symbol) => void;
|
|
4
|
+
}): (target: unknown, propertyKey: string | symbol | object) => void;
|
package/dist/test.js
CHANGED
|
@@ -109,11 +109,6 @@ const JSONObject = {
|
|
|
109
109
|
};
|
|
110
110
|
//TEST constructor
|
|
111
111
|
const u = new User().from(JSONObject);
|
|
112
|
-
console.log("\n\n\n");
|
|
113
|
-
console.log(u);
|
|
114
|
-
console.log("\n\n\n");
|
|
115
|
-
console.log(JSONObject);
|
|
116
|
-
console.log("\n\n\n");
|
|
117
112
|
const constructorTest = !!(u.id == JSONObject.id &&
|
|
118
113
|
u.username == JSONObject.username &&
|
|
119
114
|
u.name == JSONObject.firstName &&
|