UNPKG

@tsed/common

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