Components Interactions Examples Tutorials API FAQ
Options
Menu

Interface Map

A shim for ES6 maps. The implementation uses a JavaScript object internally, and thus keys are limited to strings.

Type parameters

  • T

Hierarchy

  • Map

Index

Methods

empty

  • empty(): boolean

entries

  • entries(): object[]
  • Returns an array of key-value objects in arbitrary order.

    Returns object[]

    • key: string
    • value: T

forEach

  • forEach(func: function): void
  • Calls the function for each key and value pair in the map. The 'this' context is the map itself.

    Parameters

    • func: function
        • (key: string, value: T): any
        • Parameters

          • key: string
          • value: T

          Returns any

    Returns void

get

  • get(key: string): T
  • Retrieve the value for the given key. Returns undefined if there is no value stored.

    Parameters

    • key: string

    Returns T

has

  • has(key: string): boolean

keys

  • keys(): string[]

remove

  • remove(key: string): boolean
  • Remove the value for the given key. Returns true if there was a value and false otherwise.

    Parameters

    • key: string

    Returns boolean

set

  • set(key: string, value: T): T
  • Set the value for the given key. Returns the new value.

    Parameters

    • key: string
    • value: T

    Returns T

size

  • size(): number

values

  • values(): T[]

Generated using TypeDoc