Options
All
  • Public
  • Public/Protected
  • All
Menu

Class MapObjectUtility

static members for @type {Map<K, V>}

export

Hierarchy

  • MapObjectUtility

Index

Constructors

Methods

  • getMap<TValue>(o: {}, valueGetter?: (propertyName: string, propertyValue: TValue) => TValue): null | Map<string, TValue>
  • gets @type {Map<string, TValue>} from an object

    Type parameters

    • TValue

    Parameters

    • o: {}
      • [index: string]: any
    • Optional valueGetter: (propertyName: string, propertyValue: TValue) => TValue
        • (propertyName: string, propertyValue: TValue): TValue
        • Parameters

          • propertyName: string
          • propertyValue: TValue

          Returns TValue

    Returns null | Map<string, TValue>

  • getMapFromKeyValuePairs<TValue>(pairs: { key: string; value: any }[], valueGetter?: (propertyName: string, propertyValue: TValue) => TValue): null | Map<string, TValue>
  • gets @type {Map<string, TValue>} from an object of @type {Array<{ key: string; value: any }>}

    see

    https://stackoverflow.com/a/26265095/22944

    Type parameters

    • TValue

    Parameters

    • pairs: { key: string; value: any }[]
    • Optional valueGetter: (propertyName: string, propertyValue: TValue) => TValue
        • (propertyName: string, propertyValue: TValue): TValue
        • Parameters

          • propertyName: string
          • propertyValue: TValue

          Returns TValue

    Returns null | Map<string, TValue>

  • getObject(map: Map<string | number, any>): {}

Generated using TypeDoc