From c30decab77c4ebeb34ebd1d73b0f45bb26944c79 Mon Sep 17 00:00:00 2001 From: Kitson Kelly Date: Sun, 15 Sep 2019 22:58:06 +1000 Subject: Fix type directive parsing (#2954) --- js/type_directives.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'js') diff --git a/js/type_directives.ts b/js/type_directives.ts index 4817738c7..b457d2394 100644 --- a/js/type_directives.ts +++ b/js/type_directives.ts @@ -39,9 +39,9 @@ const typeDirectiveRegEx = /@deno-types\s*=\s*(["'])((?:(?=(\\?))\3.)*?)\1/gi; * import * as foo from "./foo.js" * export { a, b, c } from "./bar.js" * - * [See Diagram](https://bit.ly/2lK0izL) + * [See Diagram](http://bit.ly/2lOsp0K) */ -const importExportRegEx = /(?:import|export)\s+(?:[\s\S]*?from\s+)?(["'])((?:(?=(\\?))\3.)*?)\1/; +const importExportRegEx = /(?:import|export)(?:\s+|\s+[\s\S]*?from\s+)?(["'])((?:(?=(\\?))\3.)*?)\1/; /** Parses out any Deno type directives that are part of the source code, or * returns `undefined` if there are not any. -- cgit v1.2.3