Classdesc

ExactIndex is a simple index that allows you to store a value and retrieve it by key. The key must be an exact match.

Example

var index = new ExactIndex();
index.set("foo", 1);
index.get("foo"); // [1]
index.get("bar"); // undefined
index.set("foo", 2);
index.get("foo"); // [2]
index.remove("foo");
index.get("foo"); // undefined
index.set("foo", 1);
index.clear();
index.get("foo"); // undefined

Param

The field to index on

Returns

  • The ExactIndex object

Type Parameters

  • T extends number

Hierarchy

  • ExactIndex

Constructors

Properties

Methods

Constructors

Properties

#index: Record<string, T[]>
field: string

Methods

Generated using TypeDoc