debt - use Record to define [IString|INumber]Dictionary

This commit is contained in:
Johannes Rieken 2019-09-04 11:36:52 +02:00
parent 458ac96529
commit f9289bb4c6

View file

@ -7,17 +7,14 @@
* An interface for a JavaScript object that
* acts a dictionary. The keys are strings.
*/
export interface IStringDictionary<V> {
[name: string]: V;
}
export type IStringDictionary<V> = Record<string, V>;
/**
* An interface for a JavaScript object that
* acts a dictionary. The keys are numbers.
*/
export interface INumberDictionary<V> {
[idx: number]: V;
}
export type INumberDictionary<V> = Record<number, V>;
const hasOwnProperty = Object.prototype.hasOwnProperty;
@ -136,4 +133,4 @@ export class SetMap<K, V> {
values.forEach(fn);
}
}
}