mirror of
https://github.com/Microsoft/vscode
synced 2024-09-18 01:58:27 +00:00
debt - use Record to define [IString|INumber]Dictionary
This commit is contained in:
parent
458ac96529
commit
f9289bb4c6
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue