This problem is about implementing Least-Recently Used (LRU) Cache using JavaScript's built in Map functionality. Here is how I would approach this problem:

```ts
/** A fixed capacity LRU cache */
export class LruCache<K, V> {
  private readonly map: Map<K, V>;

  constructor(capacity: number) {
    if (capacity <= 0 || !Number.isInteger(capacity)) {
      throw new Error('Capacity must be a positive integer');
    }
    this.map = new Map();
    // @ts-expect-error - This is for guard clause and the Map's capacity does not exist in vanilla JavaScript Maps. It's implementation dependent.
    Object.defineProperty(this, 'capacity', { value: capacity });
  } 

  get(key: K): V | undefined {
    const hasKey = this.map.has(key);
    let val: V | undefined;
    if (hasKey) {
      // @ts-expect-error TS7015 - Element implicitly has an 'any' type because expression of type 'K' can't be used to index type 'Map<K, V>'.
      val = this.map.get(key);
      this.map.delete(key);   // delete the key and reinsert it with .set() in next line
    } else {
      return undefined;  // return undefined if key not found
    }
    // @ts-expect-error TS2531 - Object is possibly 'undefined'.
    this.map.set(key, val);   // reinsert to keep LRU order (most recent at the end of map)
    return hasKey ? val : undefined;  // if key exists then return value otherwise return undefined
  } 
  
  set(key: K, value: V): void {
    if (this.map.has(key)) this.map.delete(key);   // deleting to re-order
    this.map.set(key, value);                      // insert at end of map
    // @ts-expect-error TS2339 - Property 'capacity' does not exist on type 'LruCache<K, V>'.
    if (this.map.size > this.capacity) {          // if over capacity, delete first entry ( Map iterate order is insertion based)
      const oldestKey = this.map.keys().next().value;  // find the oldest key
      this.map.delete(oldestKey);                       // and delete it. 
    }         
  }   
  
  get size(): number { return this.map.size }     // returning map's size
}
```