Skip to content

Commit

Permalink
fix: update regex to do not match new line in specifier group
Browse files Browse the repository at this point in the history
  • Loading branch information
younggglcy committed Mar 17, 2024
1 parent 2a19079 commit 503d2e3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/esm-shim/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ const require = cjsModule.createRequire(import.meta.url);
`;

export const ESMStaticImportRegex =
/(?<=\s|^|;)import\s*([\s"']*(?<imports>[\w\t\n\r $*,/{}]+)from\s*)?["']\s*(?<specifier>(?<="\s*)[^"]*[^\s"](?=\s*")|(?<='\s*)[^']*[^\s'](?=\s*'))\s*["'][\s;]*/gm;
/(?<=\s|^|;)import\s*([\s"']*(?<imports>[\w\t\n\r $*,/{}]+)from\s*)?["']\s*(?<specifier>(?<="\s*)[^"\n]*[^\s"](?=\s*")|(?<='\s*)[^'\n]*[^\s'](?=\s*'))\s*["'][\s;]*/gm;

0 comments on commit 503d2e3

Please sign in to comment.