{"version":3,"file":"CaseInsensitiveMap.cjs","names":[],"sources":["../../src/collections/CaseInsensitiveMap.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any -- ok */\n// https://stackoverflow.com/questions/50019920/javascript-map-key-value-pairs-case-insensitive-search\nexport class CaseInsensitiveMap<T, U> extends Map<T, U> {\n    constructor(values?: Iterable<[T, U]>) {\n        // eslint-disable-next-line @typescript-eslint/no-unused-expressions -- this is a valid use case\n        values\n            ? super(\n                  Array.from(values, ([key, value]) => {\n                      if (typeof key === 'string') {\n                          key = key.toLowerCase() as any as T;\n                      }\n\n                      return [key, value] as [T, U];\n                  }),\n              )\n            : super();\n    }\n\n    set(key: T, value: U): this {\n        if (typeof key === 'string') {\n            key = key.toLowerCase() as any as T;\n        }\n        return super.set(key, value);\n    }\n\n    get(key: T): U | undefined {\n        if (typeof key === 'string') {\n            key = key.toLowerCase() as any as T;\n        }\n\n        return super.get(key);\n    }\n\n    has(key: T): boolean {\n        if (typeof key === 'string') {\n            key = key.toLowerCase() as any as T;\n        }\n\n        return super.has(key);\n    }\n}\n"],"mappings":";;;AAEA,IAAa,qBAAb,cAA8C,IAAU;CACpD,YAAY,QAA2B;EAEnC,SACM,MACI,MAAM,KAAK,SAAS,CAAC,KAAK,WAAW;GACjC,IAAI,OAAO,QAAQ,UACf,MAAM,IAAI,YAAY;GAG1B,OAAO,CAAC,KAAK,KAAK;EACtB,CAAC,CACL,IACA,MAAM;CAChB;CAEA,IAAI,KAAQ,OAAgB;EACxB,IAAI,OAAO,QAAQ,UACf,MAAM,IAAI,YAAY;EAE1B,OAAO,MAAM,IAAI,KAAK,KAAK;CAC/B;CAEA,IAAI,KAAuB;EACvB,IAAI,OAAO,QAAQ,UACf,MAAM,IAAI,YAAY;EAG1B,OAAO,MAAM,IAAI,GAAG;CACxB;CAEA,IAAI,KAAiB;EACjB,IAAI,OAAO,QAAQ,UACf,MAAM,IAAI,YAAY;EAG1B,OAAO,MAAM,IAAI,GAAG;CACxB;AACJ"}