Function enumerate

  • enumerate helper function. Enumerations are special objects and all used TypeScript enums have to be looped through this helper function before they can be utilized in conjunction with the Model.

    Type Parameters

    • T extends object

      The type of TypeScript enum.

    Parameters

    • enumerator: T

      The TypeScript enum to enumerate.

    Returns T

    The processed enumeration to be used by the Model.

    Example

    enumerate a TypeScript enumeration:

    import { enumerate } from '@sgrud/data';

    enum Enumeration {
    One = 'ONE',
    Two = 'TWO'
    }

    export type ExampleEnum = Enumeration;
    export const ExampleEnum = enumerate(Enumeration);

    See

    Model

Generated using TypeDoc