_string-context.js 309 B

12345678
  1. // helper for String#{startsWith, endsWith, includes}
  2. var isRegExp = require('./_is-regexp')
  3. , defined = require('./_defined');
  4. module.exports = function(that, searchString, NAME){
  5. if(isRegExp(searchString))throw TypeError('String#' + NAME + " doesn't accept regex!");
  6. return String(defined(that));
  7. };