Skip to content

Commit e496e0a

Browse files
authored
Add const to requireRegex (#237)
1 parent 43dbab1 commit e496e0a

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Breaking changes:
99
New features:
1010

1111
Bugfixes:
12+
- Support use of JS `const` keyword in `requireRegex` (#237 by @ptrfrncsmrph)
1213

1314
Other improvements:
1415

client/src/Try/Loader.purs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ type Dependency =
4545
}
4646

4747
requireRegex :: Regex
48-
requireRegex = unsafeRegex """^var\s+\S+\s*=\s*require\(["']([^"']*)["']\)""" noFlags
48+
requireRegex = unsafeRegex """^(?:const|var)\s+\S+\s*=\s*require\(["']([^"']*)["']\)""" noFlags
4949

5050
dirname :: String -> String
5151
dirname path = fromMaybe "" do

0 commit comments

Comments
 (0)