Ver a proveniência

Fixes Objects.values types

main
Eric Amodio há 7 anos
ascendente
cometimento
c44e4c6968
3 ficheiros alterados com 7 adições e 3 eliminações
  1. +1
    -1
      src/annotations/annotations.ts
  2. +1
    -1
      src/commands/resetSuppressedWarnings.ts
  3. +5
    -1
      src/system/object.ts

+ 1
- 1
src/annotations/annotations.ts Ver ficheiro

@ -138,7 +138,7 @@ export class Annotations {
// Try to get the width of the string, if there is a cap
let width = 4; // Start with a padding
for (const token of Objects.values<Strings.ITokenOptions | undefined>(options.tokenOptions)) {
for (const token of Objects.values(options.tokenOptions!)) {
if (token === undefined) continue;
// If any token is uncapped, kick out and set no max

+ 1
- 1
src/commands/resetSuppressedWarnings.ts Ver ficheiro

@ -11,7 +11,7 @@ export class ResetSuppressedWarningsCommand extends Command {
}
async execute() {
for (const key of Objects.values<string>(SuppressedKeys)) {
for (const key of Objects.values(SuppressedKeys)) {
await this.context.globalState.update(key, false);
}
}

+ 5
- 1
src/system/object.ts Ver ficheiro

@ -6,7 +6,9 @@ export namespace Objects {
return _isEqual(first, second);
}
export function* entries(o: any): IterableIterator<[string, any]> {
export function entries<T>(o: { [key: string]: T }): IterableIterator<[string, T]>;
export function entries<T>(o: { [key: number]: T }): IterableIterator<[string, T]>;
export function* entries<T>(o: any): IterableIterator<[string, T]> {
for (const key in o) {
yield [key, o[key]];
}
@ -56,6 +58,8 @@ export namespace Objects {
}
}
export function values<T>(o: { [key: string]: T }): IterableIterator<T>;
export function values<T>(o: { [key: number]: T }): IterableIterator<T>;
export function* values<T>(o: any): IterableIterator<T> {
for (const key in o) {
yield o[key];

Carregando…
Cancelar
Guardar