Options
All
  • Public
  • Public/Protected
  • All
Menu

A value transformer supporting function-based transformation.

Hierarchy

  • ValueTransformer

Index

Constructors

constructor

Properties

Protected Optional forward

Protected Optional reverse

Methods

allowsReverseTransformation

  • allowsReverseTransformation(): boolean

invertedTransformer

  • Flips the direction of the receiver's transformation, such that transformedValue will become reverseTransformedValue, and vice-versa.

    Returns ValueTransformer

    an inverted transformer.

reverseTransformedValue

  • reverseTransformedValue(value?: any): any
  • Reverses the transformation of the given value.

    Parameters

    • Optional value: any

      The value to be reversed.

    Returns any

transformedValue

  • transformedValue(value?: any): any
  • Transforms the given value.

    Parameters

    • Optional value: any

      The value to be transformed.

    Returns any

Static arrayTransformer

Static forward

Static forwardAndReversible

Static numberTransformer

  • numberTransformer(locales?: string | string[], options?: Intl.NumberFormatOptions): ValueTransformer
  • A reversible value transformer to transform between a number and it's string representation.

    Parameters

    • Optional locales: string | string[]

      A locale string or array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used.

    • Optional options: Intl.NumberFormatOptions

      An object that contains one or more properties that specify comparison options.

    Returns ValueTransformer

    a transformer which will map from strings to numbers for forward transformations, and from numbers to strings for reverse transformations.

Static objectTransformer

Static reversible

Static valueMappingTransformer

  • valueMappingTransformer(object: object, defaultValue?: any, reverseDefaultValue?: any): ValueTransformer
  • A reversible value transformer to transform between the keys and values of an object.

    Parameters

    • object: object

      The object whose keys and values should be transformed between.

      • [key: string]: any
    • Optional defaultValue: any

      The result to fall back to, in case no key matching the input value was found during the forward transformation.

    • Optional reverseDefaultValue: any

      The result to fall back to, in case no value matching the input value was found during a reverse transformation.

    Returns ValueTransformer

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc