fix: ts2json
not working on Windows
This commit is contained in:
parent
59c325ff6c
commit
2a8823c5f7
@ -225,7 +225,8 @@ export default function(filename, options = {}) {
|
|||||||
let program = ts.createProgram([filename], options)
|
let program = ts.createProgram([filename], options)
|
||||||
let checker = program.getTypeChecker()
|
let checker = program.getTypeChecker()
|
||||||
const sourceFiles = program.getSourceFiles()
|
const sourceFiles = program.getSourceFiles()
|
||||||
let sourceFile = sourceFiles.find(file => file.fileName === filename)
|
const filenameUnix = filename.replaceAll('\\', '/')
|
||||||
|
let sourceFile = sourceFiles.find(file => file.fileName === filenameUnix)
|
||||||
|
|
||||||
ts.forEachChild(sourceFile, visit(node, checker))
|
ts.forEachChild(sourceFile, visit(node, checker))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user