You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a complex monorepo using uncompiled typescript via ts-node and ttypescript.
I've found that within the function isEnumerateCallExpressiondeclaration.getSourceFile().fileName === indexTs may evaluate to false when it should be true.
A potential fix for this is to copy the isOurStubModule function from ts-transformer-inline-file and use it, instead, like this:
conststubModuleSource=fs.readFileSync(path.join(__dirname,'index.d.ts'),'utf8');functionisOurStubModule(sourceFile){// Comparing of the file names may not be reliable, it doesn't work e.g. with// yarn's "link" resolution used in this module's end-to-end tests.returnsourceFile.text===stubModuleSource;}functionisEnumerateCallExpression(node,typeChecker){if(!ts.isCallExpression(node)){returnfalse;}varsignature=typeChecker.getResolvedSignature(node);if(typeofsignature==='undefined'){returnfalse;}vardeclaration=signature.declaration;return!!declaration&&isOurStubModule(declaration.getSourceFile())// <----- HERE -----&&!!declaration.name&&declaration.name.getText()==='enumerate';}
(sorry about the JavaScript snippet, I was hacking on directly within my node_modules)
The text was updated successfully, but these errors were encountered:
There was a similar problem in ts-transformer-keys, which has been already resolved.
I fixed ts-transformer-enumerate in the same way and released v0.5.2. Please give it a try and see if the issue is fixed.
I have a complex monorepo using uncompiled typescript via ts-node and ttypescript.
I've found that within the function
isEnumerateCallExpression
declaration.getSourceFile().fileName === indexTs
may evaluate tofalse
when it should betrue
.A potential fix for this is to copy the
isOurStubModule
function fromts-transformer-inline-file
and use it, instead, like this:(sorry about the JavaScript snippet, I was hacking on directly within my node_modules)
The text was updated successfully, but these errors were encountered: