not-a-regexp.js 242 B

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