Skip to content

Commit

Permalink
Runtime check that project is a string
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
feosuna1 committed Nov 26, 2022
1 parent 7c20481 commit ed3f70f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/servicesHost.ts
Expand Up @@ -799,7 +799,7 @@ export function makeSolutionBuilderHost(
// The `configFilePath` is the same value that is used as the `project` parameter of
// `getCustomtransformers` below.
const project = options.configFilePath;
if (project) {
if (typeof project === "string") {
// Custom transformers need a reference to the `typescript.Program`, that reference is
// unavailable during the the `getCustomTransformers` callback below.
const transformers = getCustomTransformers(instance.loaderOptions, result.getProgram(), result.getProgram);
Expand Down

0 comments on commit ed3f70f

Please sign in to comment.