summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorKitson Kelly <me@kitsonkelly.com>2019-09-15 22:58:06 +1000
committerRyan Dahl <ry@tinyclouds.org>2019-09-15 08:58:06 -0400
commitc30decab77c4ebeb34ebd1d73b0f45bb26944c79 (patch)
tree9665d533e7a204d0658c25bd72b6f94f4d76b9f1 /js
parent686b86edb1ee4cbac90ecb1c3931174879531207 (diff)
Fix type directive parsing (#2954)
Diffstat (limited to 'js')
-rw-r--r--js/type_directives.ts4
1 files changed, 2 insertions, 2 deletions
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.