Skip to content

Commit c23a1c5

Browse files
committed
fix(regex): [static] allow spaces after semicolons
- https://regex101.com/r/wlYQUN/31 Signed-off-by: Lexus Drumgold <unicornware@flexdevelopment.llc>
1 parent 1a5db78 commit c23a1c5

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

__tests__/ts/v4/tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@
3030
"outDir": "../../../dist",
3131
"paths": {
3232
"#src": ["src/index"],
33-
"#src/*": ["src/*"]
33+
"#src/*": ["src/*"],
34+
"#tests/*": ["__tests__/*"]
3435
},
3536
"preserveConstEnums": true,
3637
"preserveSymlinks": false,

src/import-static.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,6 @@
112112
* @const {RegExp} STATIC_IMPORT_REGEX
113113
*/
114114
const STATIC_IMPORT_REGEX: RegExp =
115-
/(?<=^|[\n;]|\n[\t ]+)import\s*(?<type>type(?=\s+))?(?:[\s"']*(?<imports>[\w\t\n\r "$'*,/{}-]+?)\s+from\s*)?["']\s*(?<specifier>(?:(?<='\s*)[^']*[^\s'](?=\s*'))|(?:(?<="\s*)[^"]*[^\s"](?=\s*")))\s*["'](?:\s+assert\s+(?<assertion>{[\w\t\n\r "':]+?}))?(?=[\s;]*)/g
115+
/(?<=^|[\n;](?:[\t ]*(?:\w+ )?)?)import\s*(?<type>type(?=\s+))?(?:[\s"']*(?<imports>[\w\t\n\r "$'*,/{}-]+?)\s+from\s*)?["']\s*(?<specifier>(?:(?<='\s*)[^']*[^\s'](?=\s*'))|(?:(?<="\s*)[^"]*[^\s"](?=\s*")))\s*["'](?:\s+assert\s+(?<assertion>{[\w\t\n\r "':]+?}))?(?=[\s;]*)/g
116116

117117
export default STATIC_IMPORT_REGEX

0 commit comments

Comments
 (0)