_is-regexp.js 289 B

123456789
  1. // 7.2.8 IsRegExp(argument)
  2. var isObject = require('./_is-object');
  3. var cof = require('./_cof');
  4. var MATCH = require('./_wks')('match');
  5. module.exports = function (it) {
  6. var isRegExp;
  7. return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : cof(it) == 'RegExp');
  8. };