@batpb/genart - v2.0.0-rc.3-alpha.2
    Preparing search index...

    Class StringMap<ValueType>

    A map of string keys to some ValueType. Provides a type-safe wrapper around the native Map class for string-based keys.

    2.0.0

    Type Parameters

    • ValueType
    Index

    Constructors

    Accessors

    • get size(): number

      Returns number

      The size of the map.

      2.0.0

    Methods

    • Remove all key-value pairs from the map.

      Returns void

      2.0.0

    • Removes the given key from the map.

      Parameters

      • key: string

        The key to delete from the map.

      Returns boolean

      true if the given key has been removed from the map, false if the element does not exist.

      2.0.0

    • Returns IterableIterator<[string, ValueType]>

      An iterator of key-value pairs for the map.

      2.0.0

    • Get the value associated with the given key in the map. If the given key does not exist in the map, the method will return undefined.

      Parameters

      • key: string

        The key of the desired value in the map.

      Returns undefined | ValueType

      2.0.0

    • Does the map contain the given key?

      Parameters

      • key: string

        The key to check for in the map.

      Returns boolean

      true if the map contains the given key, false otherwise.

      2.0.0

    • Returns IterableIterator<string>

      All the keys of the map.

      2.0.0

    • Associate the given key with the given value in the map.

      Parameters

      • key: string

        The key to associate with the value in the map.

      • value: ValueType

        The value to store in the map.

      Returns void

      2.0.0

    • Associate the given key with the given value in the map only if the key has not been set in the map.

      Parameters

      • key: string

        The key to associate with the value in the map.

      • value: ValueType

        The value to store in the map.

      • OptionalerrorMessage: string

        Message to log if the key already has a value.

      Returns boolean

      true if the operation is successful, false if it is not.

      2.0.0

    • Returns IterableIterator<ValueType>

      All the values of the map.

      2.0.0