Options
All
  • Public
  • Public/Protected
  • All
Menu

Class FastMap<T>

fast map allows for very quick lookups of objects with a unique key

Type parameters

  • T

Hierarchy

  • FastMap

Index

Constructors

constructor

  • Type parameters

    • T

    Returns FastMap<T>

Properties

Private mapObject

mapObject: {} = {}

Type declaration

  • [key: string]: T

Methods

addAllFromOther

  • addAllFromOther(fastMapArg: FastMap<T>): void
  • tries to merge another Fastmap Note: uniqueKeyCollisions will cause overwrite

    Parameters

    Returns void

addToMap

  • addToMap(keyArg: string, objectArg: T, optionsArg?: { force: boolean }): boolean
  • Parameters

    • keyArg: string
    • objectArg: T
    • Optional optionsArg: { force: boolean }
      • force: boolean

    Returns boolean

clean

  • clean(): void
  • Returns void

concat

  • returns a new Fastmap that includes all values from this and all from the fastmap in the argument

    Parameters

    Returns FastMap<T>

find

  • find(findFunctionArg: (mapItemArg: T) => Promise<boolean>): Promise<T>
  • Parameters

    • findFunctionArg: (mapItemArg: T) => Promise<boolean>
        • (mapItemArg: T): Promise<boolean>
        • Parameters

          • mapItemArg: T

          Returns Promise<boolean>

    Returns Promise<T>

getByKey

  • getByKey(keyArg: string): T
  • Parameters

    • keyArg: string

    Returns T

getKeys

  • getKeys(): string[]
  • Returns string[]

isUniqueKey

  • isUniqueKey(keyArg: string): boolean
  • Parameters

    • keyArg: string

    Returns boolean

removeFromMap

  • removeFromMap(keyArg: string): T
  • Parameters

    • keyArg: string

    Returns T

Generated using TypeDoc