UNPKG

@tsed/common

Version:
35 lines 908 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.OnDeserialize = void 0; const json_mapper_1 = require("@tsed/json-mapper"); /** * Call the function before property deserialization. * * ::: warning * This decorator will be removed in v6 in favor of @@OnDeserialize@@ from @tsed/json-mapper. * For v5 user, use @@OnDeserialize@@ decorator from @tsed/common then in v6 switch to @tsed/schema. * ::: * * ## Example * * ```typescript * class Model { * @OnDeserialize(v => v + 1) * property: string; * } * ``` * * @param {Function} fn * @returns {Function} * @decorator * @jsonMapper * @schema * @property * @ignore * @deprecated Since v6. Use @OnDeserialize from @tsed/json-mapper */ function OnDeserialize(fn) { return json_mapper_1.OnDeserialize(fn); } exports.OnDeserialize = OnDeserialize; //# sourceMappingURL=propertyDeserialize.js.map