/** Cache adapter backed by pre-generated static data, typically produced by the CLI cache:generate command. */
export class GeneratedCacheAdapter {
  #data;
  constructor(options) {
    this.#data = new Map(Object.entries(options.data));
  }
  /**
   * @inheritDoc
   */
  get(name) {
    const key = name.replace(/\.[jt]s$/, '');
    const data = this.#data.get(key);
    return data;
  }
  /**
   * @inheritDoc
   */
  set(name, data, origin) {
    this.#data.set(name, { data });
  }
  /**
   * @inheritDoc
   */
  remove(name) {
    this.#data.delete(name);
  }
  /**
   * @inheritDoc
   */
  clear() {
    this.#data.clear();
  }
}
