Remove typings and replace missing methods with vscodes (#8217)

* remove typings and replace missing methods with vscodes

* fix strict-null-checks

* fix tests
This commit is contained in:
Anthony Dresser
2019-11-05 13:03:20 -08:00
committed by GitHub
parent 4645a8ba6b
commit 22a427f934
184 changed files with 634 additions and 43388 deletions

View File

@@ -5,7 +5,8 @@
import { IModelStore, IComponentDescriptor, IComponent } from './interfaces';
import { Deferred } from 'sql/base/common/promise';
import { entries } from 'sql/base/common/objects';
import { entries } from 'sql/base/common/collections';
import { find } from 'vs/base/common/arrays';
class ComponentDescriptor implements IComponentDescriptor {
constructor(public readonly id: string, public readonly type: string) {
@@ -65,7 +66,7 @@ export class ModelStore implements IModelStore {
}
validate(component: IComponent): Thenable<boolean> {
let componentId = entries(this._componentMappings).find(([id, mappedComponent]) => component === mappedComponent)[0];
let componentId = find(entries(this._componentMappings), ([id, mappedComponent]) => component === mappedComponent)[0];
return Promise.all(this._validationCallbacks.map(callback => callback(componentId))).then(validations => validations.every(validation => validation === true));
}