Convert two arrays to readonly (#17685)

This commit is contained in:
Andy
2017-08-08 10:54:18 -07:00
committed by GitHub
parent e1802f4966
commit f69ce5c0c8
3 changed files with 8 additions and 8 deletions

View File

@@ -326,8 +326,8 @@ namespace ts.server {
typingsInstaller: ITypingsInstaller;
eventHandler?: ProjectServiceEventHandler;
throttleWaitMilliseconds?: number;
globalPlugins?: string[];
pluginProbeLocations?: string[];
globalPlugins?: ReadonlyArray<string>;
pluginProbeLocations?: ReadonlyArray<string>;
allowLocalPluginLoads?: boolean;
}

View File

@@ -15,8 +15,8 @@ namespace ts.server {
typingSafeListLocation: string;
npmLocation: string | undefined;
telemetryEnabled: boolean;
globalPlugins: string[];
pluginProbeLocations: string[];
globalPlugins: ReadonlyArray<string>;
pluginProbeLocations: ReadonlyArray<string>;
allowLocalPluginLoads: boolean;
}
@@ -760,10 +760,10 @@ namespace ts.server {
const typingSafeListLocation = findArgument(Arguments.TypingSafeListLocation);
const npmLocation = findArgument(Arguments.NpmLocation);
function parseStringArray(argName: string): string[] {
function parseStringArray(argName: string): ReadonlyArray<string> {
const arg = findArgument(argName);
if (arg === undefined) {
return emptyArray as string[]; // TODO: https://github.com/Microsoft/TypeScript/issues/16312
return emptyArray;
}
return arg.split(",").filter(name => name !== "");
}

View File

@@ -255,8 +255,8 @@ namespace ts.server {
eventHandler?: ProjectServiceEventHandler;
throttleWaitMilliseconds?: number;
globalPlugins?: string[];
pluginProbeLocations?: string[];
globalPlugins?: ReadonlyArray<string>;
pluginProbeLocations?: ReadonlyArray<string>;
allowLocalPluginLoads?: boolean;
}