Sha256: 81983b9c811def3268db6cbb0e3f92b4c238905d3c4032c4c1e335095ef8901a
Contents?: true
Size: 387 Bytes
Versions: 15
Compression:
Stored size: 387 Bytes
Contents
'use strict'; var callBound = require('call-bind/callBound'); var isRegex = require('is-regex'); var $exec = callBound('RegExp.prototype.exec'); var $TypeError = require('es-errors/type'); module.exports = function regexTester(regex) { if (!isRegex(regex)) { throw new $TypeError('`regex` must be a RegExp'); } return function test(s) { return $exec(regex, s) !== null; }; };
Version data entries
15 entries across 15 versions & 1 rubygems