Skip to content

deserialize

@tsed/json-mapper

Usage

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

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

Overview

ts
function deserialize<Model = any>(input: any, options?: JsonDeserializerOptions): Model;

Description

Deserialize arbitrary data into the provided model type using the shared JsonDeserializer.

Example

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

const model = deserialize<UserModel>(payload, {type: UserModel, useAlias: true});

Released under the MIT License.