$.string-context.js 311 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. };