Fixes #94138: Adopt types util and modernize utils to ES5

This commit is contained in:
Alex Dima
2020-04-02 17:44:39 +02:00
parent 72d94dece7
commit b4c08f66c3
2 changed files with 11 additions and 46 deletions

View File

@@ -16,7 +16,7 @@ import { FileSystemProviderErrorCode, markAsFileSystemProviderError } from 'vs/p
import { RemoteAuthorityResolverErrorCode } from 'vs/platform/remote/common/remoteAuthorityResolver';
import type * as vscode from 'vscode';
import { Cache } from './cache';
import { assertIsDefined } from 'vs/base/common/types';
import { assertIsDefined, isStringArray } from 'vs/base/common/types';
import { Schemas } from 'vs/base/common/network';
function es5ClassCompat(target: Function): any {
@@ -2427,18 +2427,7 @@ export class SemanticTokensLegend {
}
function isStrArrayOrUndefined(arg: any): arg is string[] | undefined {
if (typeof arg === 'undefined') {
return true;
}
if (Array.isArray(arg)) {
for (const element of arg) {
if (typeof element !== 'string') {
return false;
}
}
return true;
}
return false;
return ((typeof arg === 'undefined') || isStringArray(arg));
}
export class SemanticTokensBuilder {