Initial commit

This commit is contained in:
Luis Fernando Molina committed 2018-09-03 15:19:57 +02:00
commit f47e08fdcb
2409 files changed
+363607

No files matched your search

+20
View File
@@ -0,0 +1,20 @@
var toString = Object.prototype.toString;
function isRegExp (o) {
return 'object' == typeof o
&& '[object RegExp]' == toString.call(o);
}
module.exports = exports = function (regexp) {
if (!isRegExp(regexp)) {
throw new TypeError('Not a RegExp');
}
var flags = [];
if (regexp.global) flags.push('g');
if (regexp.multiline) flags.push('m');
if (regexp.ignoreCase) flags.push('i');
return new RegExp(regexp.source, flags.join(''));
}