JSCache

JSCache

The JSCache can be used by to share information between subsequent runs of the same script or between scripts (depending on implementation).

Methods

exists(key) → {boolean}

Description:
  • Checks the mapping for a key from this map.

Source:
Parameters:
Name Type Description
key string

key whose mapping is to be checked in the map

Returns:

whether the key has a mapping

Type
boolean

get(key, defaultSupplieropt) → {*|null}

Description:
  • Returns the value to which the specified key is mapped.

Source:
Parameters:
Name Type Attributes Description
key string

the key whose associated value is to be returned

defaultSupplier function <optional>

if the specified key is not already associated with a value, this function will return a default value

Returns:

the current object for the supplied key, a default value if defaultSupplier is provided, or null

Type
* | null

put(key, value) → {*|null}

Description:
  • Associates the specified value with the specified key.

Source:
Parameters:
Name Type Description
key string

key with which the specified value is to be associated

value *

value to be associated with the specified key

Returns:

the previous value associated with the key, or null if there was no mapping for key

Type
* | null

remove(key) → {*|null}

Description:
  • Removes the mapping for a key from this map if it is present.

Source:
Parameters:
Name Type Description
key string

key whose mapping is to be removed from the cache

Returns:

the previous value associated with the key or null if there was no mapping for key

Type
* | null