slevithan / xregexp

Extended JavaScript regular expressions
http://xregexp.com/
MIT License
3.31k stars 278 forks source link

Pin babel runtime and transformation plugin #263

Closed josephfrazier closed 5 years ago

josephfrazier commented 5 years ago

This should be a quick/dirty fix for https://github.com/slevithan/xregexp/issues/262

slevithan commented 5 years ago

@josephfrazier, should I release this as v4.2.3?

josephfrazier commented 5 years ago

I believe so, yes. I tested it by doing the build, and then cd'ing to a temporary directory, running npm install ~/workspace/xregexp (where my checkout is), then running the test code from #262:

const XRegExp = require('xregexp');

const date = XRegExp(
  `(?<year>  [0-9]{4} ) -?  # year
   (?<month> [0-9]{2} ) -?  # month
   (?<day>   [0-9]{2} )     # day`, 'x');

let match = XRegExp.exec('2017-02-22', date);

console.log(match.year);

You can compare it with npm i xregexp@4.2.2 to confirm that the test fails in that case (as reported in #262)