Skip to content

Commit 41dc2ba

Browse files
committed
fix: correctly identify imports with resolution-mode (YousefED#582)
Used fix provided by @jer-sen
1 parent 264ab45 commit 41dc2ba

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

typescript-json-schema.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export { Program, CompilerOptions, Symbol } from "typescript";
99

1010
const vm = require("vm");
1111

12-
const REGEX_FILE_NAME_OR_SPACE = /(\bimport\(".*?"\)|".*?")\.| /g;
12+
const REGEX_FILE_NAME_OR_SPACE = /(\bimport\(".*?"(, \{ assert: \{ "resolution-mode": "(import|require)" \} \})?\)|".*?")\.| /g;
1313
const REGEX_TSCONFIG_NAME = /^.*\.json$/;
1414
const REGEX_TJS_JSDOC = /^-([\w]+)\s+(\S|\S[\s\S]*\S)\s*$/g;
1515
const REGEX_GROUP_JSDOC = /^[.]?([\w]+)\s+(\S|\S[\s\S]*\S)\s*$/g;

0 commit comments

Comments
 (0)