Skip to content

JsonDeserializer

@tsed/json-mapper

Usage

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

See /packages/specs/json-mapper/src/types/domain/JsonDeserializer.ts.

Overview

ts
class JsonDeserializer extends JsonMapperCompiler<JsonDeserializerOptions> {
    protected constructors: Record<string, Type<any>>;
    constructor();
    map<Model = any>(input: any, options?: JsonDeserializerOptions): Model;
    compile(model: Type<any>, groups: false | string[]): CachedJsonMapper<JsonDeserializerOptions>;
    eval(mapper: string, { id, groupsId, model }: {
        id: string;
        model: Type<any>;
        groupsId: string;
    }): CachedJsonMapper<JsonDeserializerOptions>;
    protected newInstanceOf(id: string, obj: any, options: any): any;
    protected createMapper(model: Type<any>, id: string, groups: false | string[]): string;
    protected alterValue(schemaId: string, value: any, options: JsonDeserializerOptions): any;
    
    
    
    
    
    
}

Constructor

ts
protected constructors: Record<string, Type<any>>;

Cached classes by his id

map

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

compile

ts
compile(model: Type<any>, groups: false | string[]): CachedJsonMapper<JsonDeserializerOptions>;

eval

ts
eval(mapper: string, { id, groupsId, model }: {
     id: string;
     model: Type<any>;
     groupsId: string;
 }): CachedJsonMapper<JsonDeserializerOptions>;

protected newInstanceOf

ts
protected newInstanceOf(id: string, obj: any, options: any): any;

protected createMapper

ts
protected createMapper(model: Type<any>, id: string, groups: false | string[]): string;

protected alterValue

ts
protected alterValue(schemaId: string, value: any, options: JsonDeserializerOptions): any;

Released under the MIT License.