Options
All
  • Public
  • Public/Protected
  • All
Menu

Creates a cache object to store key/value pairs.

Hierarchy

  • MapCache

Index

Properties

Methods

Properties

Optional clear

clear: undefined | function

Removes all key-value entries from the map.

Methods

delete

  • delete(key: any): boolean
  • Removes key and its value from the cache.

    Parameters

    • key: any

      The key of the value to remove.

    Returns boolean

    Returns true if the entry was removed successfully, else false.

get

  • get(key: any): any
  • Gets the cached value for key.

    Parameters

    • key: any

      The key of the value to get.

    Returns any

    Returns the cached value.

has

  • has(key: any): boolean
  • Checks if a cached value for key exists.

    Parameters

    • key: any

      The key of the entry to check.

    Returns boolean

    Returns true if an entry for key exists, else false.

set

  • set(key: any, value: any): this
  • Sets value to key of the cache.

    Parameters

    • key: any

      The key of the value to cache.

    • value: any

      The value to cache.

    Returns this

    Returns the cache object.

Generated using TypeDoc