not-a-regexp.js 274 B

12345678910
  1. var global = require('../internals/global');
  2. var isRegExp = require('../internals/is-regexp');
  3. var TypeError = global.TypeError;
  4. module.exports = function (it) {
  5. if (isRegExp(it)) {
  6. throw TypeError("The method doesn't accept regular expressions");
  7. } return it;
  8. };