is-v8flags.js 325 B

12345678910111213
  1. function isV8flags(flag, v8flags) {
  2. return v8flags.indexOf(replaceSeparatorsFromDashesToUnderscores(flag)) >= 0;
  3. }
  4. function replaceSeparatorsFromDashesToUnderscores(flag) {
  5. var arr = /^(-+)(.*)$/.exec(flag);
  6. if (!arr) {
  7. return flag;
  8. }
  9. return arr[1] + arr[2].replace(/\-/g, '_');
  10. }
  11. module.exports = isV8flags;