Skip to main content
Module

x/class_transformer/mod.ts

Deno port of class-transformer
Latest
import * as classTransformer from "https://deno.land/x/class_transformer@v0.2.3-beta.1/mod.ts";

Enums

Enum representing the different transformation types.

Functions

Converts class (constructor) object to new class (constructor) object. Also works with arrays.

Converts class (constructor) object to plain (literal) object. Uses given plain object as source object (it means fills given plain object with data from class object). Also works with arrays.

Converts class (constructor) object to plain (literal) object. Also works with arrays.

Converts class (constructor) object to plain (literal) object. Uses given plain object as source object (it means fills given plain object with data from class object). Also works with arrays.

Deserializes given JSON string to a object of the given class.

Deserializes given JSON string to an array of objects of the given class.

Marks property as excluded from the process of transformation. By default it excludes the property for both constructorToPlain and plainToConstructor transformations, however you can specify on which of transformation types you want to skip this property.

Marks property as included in the process of transformation. By default it includes the property for both constructorToPlain and plainToConstructor transformations, however you can specify on which of transformation types you want to skip this property.

Converts plain (literal) object to class (constructor) object. Also works with arrays.

Converts plain (literal) object to class (constructor) object. Uses given object as source object (it means fills given object with data from plain object). Also works with arrays.

Serializes given object to a JSON string.

Defines a custom logic for value transformation.

Return the class instance only with the exposed properties.

Transform the object from class to plain object and return only with the exposed properties.

Return the class instance only with the exposed properties.

Specifies a type of the property. The given TypeFunction can return a constructor. A discriminator can be given in the options.