put()

in client/src/typeahead/LRUCache.ts [21:31]


  put(key: string, value: T) {
    this.cache.delete(key);

    if (this.cache.size === this.capacity) {
      const leastUsed = this.cache.keys().next().value;
      if (leastUsed !== undefined) {
        this.cache.delete(leastUsed);
      }
    }
    this.cache.set(key, value);
  }