Skip to content

serialize

@tsed/json-mapper

Usage

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

See /packages/specs/json-mapper/src/utils/serialize.ts.

Overview

ts
function serialize(input: any, options?: JsonSerializerOptions): any;

Description

Serialize any value using the shared JsonSerializer instance. Respects schema metadata, hooks, aliases, and registered custom mappers.

Example

ts
import {serialize} from "@tsed/json-mapper";

const payload = serialize(model, {type: UserModel, useAlias: true});

Released under the MIT License.