@tsed/json-mapper
Version:
Json mapper module for Ts.ED Framework
21 lines (19 loc) • 590 B
text/typescript
import {Type} from "@tsed/core";
import {JsonMapperMethods} from "../interfaces/JsonMapperMethods.js";
/**
* @ignore
*/
// tslint:disable-next-line:variable-name
const JsonMapperTypesContainer: Map<Type<any> | Symbol | string, JsonMapperMethods> = new Map();
/**
* @ignore
*/
export function registerJsonTypeMapper(type: Type<any> | Symbol | string, token: Type<JsonMapperMethods>) {
JsonMapperTypesContainer.set(type, new token());
}
/**
* @ignore
*/
export function getJsonMapperTypes(): Map<Type<any> | Symbol | string, JsonMapperMethods> {
return JsonMapperTypesContainer;
}