Skip to content

Commit

Permalink
Upgrade xregexp to v3.2.0, remove 'x' flag workaround (#348)
Browse files Browse the repository at this point in the history
slevithan/xregexp#162 has been fixed in
`xregexp` v3.2.0, so we don't have to work around it anymore.
  • Loading branch information
josephfrazier authored Apr 17, 2017
1 parent 995353f commit f9934c3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
"semver": "^5.3.0",
"semver-regex": "^1.0.0",
"uuid": "^3.0.1",
"xregexp": "^3.1.1"
"xregexp": "^3.2.0"
},
"devDependencies": {
"babel-core": "^6.22.1",
Expand Down
4 changes: 1 addition & 3 deletions packages/helper-grammar-regex-collection/regex.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@ function interpolate(substitution) {
// http://xregexp.com/api/#build
export default function (literals, ...substitutions) {
const flags = 'xngm';
// the 'x' flag doesn't seem to work if we pass it outside the pattern
// so put it inside as well
let buildPattern = flags.includes('x') ? '(?x)' : '';
let buildPattern = '';
const subpatterns = [];

// make `substitutions` the same length as `literals`
Expand Down
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5537,9 +5537,9 @@ [email protected]:
version "1.5.3"
resolved "https://registry.yarnpkg.com/xmlhttprequest-ssl/-/xmlhttprequest-ssl-1.5.3.tgz#185a888c04eca46c3e4070d99f7b49de3528992d"

xregexp@^3.1.1:
version "3.1.1"
resolved "https://registry.yarnpkg.com/xregexp/-/xregexp-3.1.1.tgz#8ee18d75ef5c7cb3f9967f8d29414a6ca5b1a184"
xregexp@^3.2.0:
version "3.2.0"
resolved "https://registry.yarnpkg.com/xregexp/-/xregexp-3.2.0.tgz#cb3601987bfe2695b584000c18f1c4a8c322878e"

xtend@^4.0.0, xtend@^4.0.1:
version "4.0.1"
Expand Down

0 comments on commit f9934c3

Please sign in to comment.