From 436d84bdb5fcc57730e526d76f80f00bf2e698d2 Mon Sep 17 00:00:00 2001 From: Matt Godbolt Date: Sat, 1 Apr 2023 20:38:08 -0500 Subject: [PATCH] Fix unset versionFlags (#4922) Closes #4921 ``` > a = ("")?.split("|") [ '' ] > a = (undefined)?.split("|") undefined > a = ("a|b")?.split("|") [ 'a', 'b' ] ``` --- lib/compiler-finder.ts | 2 +- types/compiler.interfaces.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/compiler-finder.ts b/lib/compiler-finder.ts index 8c3731a06..ba99d17e8 100644 --- a/lib/compiler-finder.ts +++ b/lib/compiler-finder.ts @@ -258,7 +258,7 @@ export class CompilerFinder { .split(':') .filter(a => a !== ''), options: actualOptions, - versionFlag: props('versionFlag', '').split('|'), + versionFlag: props('versionFlag')?.split('|'), versionRe: props('versionRe'), explicitVersion: props('explicitVersion'), compilerType: props('compilerType', ''), diff --git a/types/compiler.interfaces.ts b/types/compiler.interfaces.ts index b8b94fb0d..54accb3ac 100644 --- a/types/compiler.interfaces.ts +++ b/types/compiler.interfaces.ts @@ -36,7 +36,7 @@ export type CompilerInfo = { baseName: string; alias: string[]; options: string; - versionFlag?: string[]; + versionFlag: string[] | undefined; versionRe?: string; explicitVersion?: string; compilerType: string;