Skip to content

Commit ed3f70f

Browse files
committed
Runtime check that project is a string
In a previous commit, I removed `.toString()` without validating what the Typescript compiler would say. This change does a runtime check that the project variable is an actual string.
1 parent 7c20481 commit ed3f70f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/servicesHost.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -799,7 +799,7 @@ export function makeSolutionBuilderHost(
799799
// The `configFilePath` is the same value that is used as the `project` parameter of
800800
// `getCustomtransformers` below.
801801
const project = options.configFilePath;
802-
if (project) {
802+
if (typeof project === "string") {
803803
// Custom transformers need a reference to the `typescript.Program`, that reference is
804804
// unavailable during the the `getCustomTransformers` callback below.
805805
const transformers = getCustomTransformers(instance.loaderOptions, result.getProgram(), result.getProgram);

0 commit comments

Comments
 (0)