{
  "version": 3,
  "sources": ["../../../../../src/libs/custom/data-structure/map/default-map.mts"],
  "sourcesContent": ["import type { Func } from \"../../../../types/concepts.mjs\";\n\nexport class DefaultMap<Key, Value> extends Map<Key, Value> {\n  #getDefault: Func<[Key], Value>;\n  constructor(\n    getDefault: Func<[Key], Value>,\n    entries?: readonly (readonly [Key, Value])[] | null\n  ) {\n    super(entries);\n    this.#getDefault = getDefault;\n  }\n  override get(key: Key): Value {\n    if (!this.has(key)) {\n      this.set(key, this.#getDefault(key));\n    }\n    return super.get(key)!;\n  }\n}\n"],
  "mappings": "AAEO,yBAAqC,IAAgB;AAAA,EAC1D;AAAA,EACA,YACE,YACA,SACA;AACA,UAAM;AACN,uBAAmB;AAAA;AAAA,EAEZ,IAAI,KAAiB;AAC5B,QAAI,CAAC,KAAK,IAAI,MAAM;AAClB,WAAK,IAAI,KAAK,iBAAiB;AAAA;AAEjC,WAAO,MAAM,IAAI;AAAA;AAAA;",
  "names": []
}
