UNPKG

string.prototype.matchall

Version:

Spec-compliant polyfill for String.prototype.matchAll

15 lines (12 loc) 271 B
'use strict'; var implementation = require('./implementation'); module.exports = function getPolyfill() { if (String.prototype.matchAll) { try { ''.matchAll(RegExp.prototype); } catch (e) { return String.prototype.matchAll; } } return implementation; };