polyfill-regexp-matchall.js 358 B

1234567891011
  1. 'use strict';
  2. var hasSymbols = require('has-symbols')();
  3. var regexpMatchAll = require('./regexp-matchall');
  4. module.exports = function getRegExpMatchAllPolyfill() {
  5. if (!hasSymbols || typeof Symbol.matchAll !== 'symbol' || typeof RegExp.prototype[Symbol.matchAll] !== 'function') {
  6. return regexpMatchAll;
  7. }
  8. return RegExp.prototype[Symbol.matchAll];
  9. };