Skip to content

OnSerialize

@tsed/json-mapper

Usage

typescript
import { OnSerialize } from "@tsed/json-mapper";

See /packages/specs/json-mapper/src/types/decorators/onSerialize.ts.

Overview

ts
function OnSerialize(cb: OnSerializeCallback): PropertyDecorator;

Description

Call the function before property serialization.

Example

typescript
class Model {
   @OnSerialize(v => v + 1)
   property: string;
}

Released under the MIT License.