Ohm-Management - Projektarbeit B-ME
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

index.js 463B

1234567891011121314151617181920
  1. var toString = Object.prototype.toString;
  2. function isRegExp (o) {
  3. return 'object' == typeof o
  4. && '[object RegExp]' == toString.call(o);
  5. }
  6. module.exports = exports = function (regexp) {
  7. if (!isRegExp(regexp)) {
  8. throw new TypeError('Not a RegExp');
  9. }
  10. var flags = [];
  11. if (regexp.global) flags.push('g');
  12. if (regexp.multiline) flags.push('m');
  13. if (regexp.ignoreCase) flags.push('i');
  14. return new RegExp(regexp.source, flags.join(''));
  15. }