Options
All
  • Public
  • Public/Protected
  • All
Menu

A very simple implementation of a map. Do not use with complex objects as Key.

Type parameters

  • K

    type of the key

  • V

    type of the value

Hierarchy

  • SimpleMap

Index

Properties

Methods

Properties

Private data

data: object

Type declaration

  • [key: string]: V

Methods

clear

  • clear(): void

get

  • get(key: K): V | undefined
  • Gets the value for the given key if available

    Parameters

    • key: K

      the key to look up

    Returns V | undefined

    the looked up value or undefined if the map does not contain any value associated with the given key

has

  • has(key: K): boolean
  • Tests if the map contains value stored by the given key

    Parameters

    • key: K

      the key

    Returns boolean

    true if the map contains a value by the given key, false otherwise

set

  • set(key: K, value: V): void
  • Sets the value for the given key. If the map already contains a value stored by the given key, then this value is overridden

    Parameters

    • key: K

      the key

    • value: V

      the value to associate with the given key

    Returns void

Private toInternalKey

  • toInternalKey(key: K): string

Generated using TypeDoc