Class AbstractTransformer<MyModel, MyView, MyBody>Abstract

type: AbstractTransformer

  • common base class of Transformable

Type Parameters

  • MyModel extends Model

  • MyView extends View

  • MyBody extends Body

Hierarchy

  • AbstractTransformer

Implements

Constructors

Properties

Methods

Constructors

Properties

asDate: ((val: string, field?: string) => string)

Type declaration

    • (val: string, field?: string): string
    • check in date: YYYY-MM-DD

      Parameters

      • val: string

        string

      • Optional field: string

        (optional) target field name to use

      Returns string

onlyDefined: (<T>(N: T) => T)

Type declaration

    • <T>(N: T): T
    • extract only the defined attribute. ex) { a:1, b: undefined } -> { a:1 }

      Type Parameters

      • T extends object

      Parameters

      • N: T

      Returns T

Methods

  • transform from body(req-body) to model

    See

    Transformable.bodyToModel

    Parameters

    • body: any
    • Optional isCreate: boolean

    Returns MyModel

  • transform from model to view

    See

    Transformable.modelAsView

    Parameters

    • model: MyModel
    • Optional hasCores: boolean

    Returns MyView

Generated using TypeDoc