UNPKG

@tsed/json-mapper

Version:
25 lines 494 B
import { JsonEntityFn } from "@tsed/schema"; /** * Call the function before property deserialization. * * ## Example * * ```typescript * class Model { * @OnDeserialize(v => v + 1) * property: string; * } * ``` * * @returns {Function} * @decorator * @schema * @property * @param cb */ export function OnDeserialize(cb) { return JsonEntityFn((storedJson) => { storedJson.schema.$hooks.on("onDeserialize", cb); }); } //# sourceMappingURL=onDeserialize.js.map