@automapper/pojos
Advanced tools
Comparing version 2.2.1 to 3.0.0
{ | ||
"name": "@automapper/pojos", | ||
"version": "2.2.1", | ||
"version": "3.0.0", | ||
"sideEffects": false, | ||
@@ -32,5 +32,5 @@ "engines": { | ||
"peerDependencies": { | ||
"@automapper/types": "2.2.1", | ||
"@automapper/core": "2.2.1" | ||
"@automapper/types": "3.0.0", | ||
"@automapper/core": "3.0.0" | ||
} | ||
} |
@@ -14,6 +14,6 @@ import { Dictionary } from '@automapper/types'; | ||
export declare function createMetadataMap<TModel extends Dictionary<TModel> = any>(key: string, metadata: { | ||
[key in keyof TModel]?: StringConstructor | DateConstructor | NumberConstructor | BooleanConstructor | string; | ||
[key in keyof TModel]?: StringConstructor | DateConstructor | NumberConstructor | BooleanConstructor | string | null; | ||
}): void; | ||
export declare function createMetadataMap<TModel extends Dictionary<TModel> = any>(key: string, existMetadataMap: string, metadata?: { | ||
[key in keyof TModel]?: StringConstructor | DateConstructor | NumberConstructor | BooleanConstructor | string | null; | ||
[key in keyof TModel]?: StringConstructor | DateConstructor | NumberConstructor | BooleanConstructor | string | null | false; | ||
}): void; |
@@ -30,5 +30,5 @@ "use strict"; | ||
result.push(...entries); | ||
storages_1.pojosSymbolStorage.set(symbol, result.filter(([, meta]) => meta !== null)); | ||
storages_1.pojosSymbolStorage.set(symbol, result.filter(([, meta]) => meta !== false)); | ||
} | ||
exports.createMetadataMap = createMetadataMap; | ||
//# sourceMappingURL=create-metadata-map.js.map |
@@ -21,3 +21,7 @@ "use strict"; | ||
mappingStorage.set(source, destination, mapping); | ||
}, options); | ||
}, options, { | ||
isMetadataNullAtKey: (key) => { | ||
return metadataStorage.getMetadataForKey(destination, key) === null; | ||
}, | ||
}); | ||
}, | ||
@@ -24,0 +28,0 @@ getMapping(source, destination) { |
@@ -17,3 +17,3 @@ "use strict"; | ||
const metaResult = meta(); | ||
if (core_1.isPrimitiveConstructor(metaResult)) { | ||
if (core_1.isPrimitiveConstructor(metaResult) || metaResult === null) { | ||
obj[key] = core_1.isDefined(valueAtKey) | ||
@@ -27,3 +27,3 @@ ? valueAtKey | ||
? new Date(valueAtKey) | ||
: new Date(); | ||
: undefined; | ||
continue; | ||
@@ -30,0 +30,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
23324
344