@halospv3/hce.shared-config
Version:
Automate commit message quality, changelogs, and CI/CD releases. Exports a semantic-release shareable configuration deserialized from this package's '.releaserc.yml'. Shared resources for .NET projects are also distributed with this package.
35 lines (31 loc) • 808 B
text/typescript
/**
* https://stackoverflow.com/a/50022230/14894786
* licensed under CC BY-SA 4.0
* changes: add overrides, remove "as any", remove empty lines
*/
export class CaseInsensitiveMap<T, U> extends Map<T, U> {
override delete(key: T): boolean {
if (typeof key === 'string') {
key = key.toLowerCase() as T;
}
return super.delete(key);
}
override get(key: T): U | undefined {
if (typeof key === 'string') {
key = key.toLowerCase() as T;
}
return super.get(key);
}
override has(key: T): boolean {
if (typeof key === 'string') {
key = key.toLowerCase() as T;
}
return super.has(key);
}
override set(key: T, value: U): this {
if (typeof key === 'string') {
key = key.toLowerCase() as T;
}
return super.set(key, value);
}
}