core-js
Version:
Standard library
8 lines (7 loc) • 310 B
JavaScript
// helper for String#{startsWith, endsWith, includes}
var defined = require('./$.defined')
, cof = require('./$.cof');
module.exports = function(that, searchString, NAME){
if(cof(searchString) == 'RegExp')throw TypeError('String#' + NAME + " doesn't accept regex!");
return String(defined(that));
};