X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=node_modules%2Fcore-js%2Fmodules%2Fes6.string.starts-with.js;fp=node_modules%2Fcore-js%2Fmodules%2Fes6.string.starts-with.js;h=017805f019941ebb4065e94eb8144b6f0ad09f33;hp=0000000000000000000000000000000000000000;hb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;hpb=57c063afa3f66b07c4bbddc2d6129a96d90f0aad diff --git a/node_modules/core-js/modules/es6.string.starts-with.js b/node_modules/core-js/modules/es6.string.starts-with.js new file mode 100644 index 000000000..017805f01 --- /dev/null +++ b/node_modules/core-js/modules/es6.string.starts-with.js @@ -0,0 +1,18 @@ +// 21.1.3.18 String.prototype.startsWith(searchString [, position ]) +'use strict'; +var $export = require('./_export') + , toLength = require('./_to-length') + , context = require('./_string-context') + , STARTS_WITH = 'startsWith' + , $startsWith = ''[STARTS_WITH]; + +$export($export.P + $export.F * require('./_fails-is-regexp')(STARTS_WITH), 'String', { + startsWith: function startsWith(searchString /*, position = 0 */){ + var that = context(this, searchString, STARTS_WITH) + , index = toLength(Math.min(arguments.length > 1 ? arguments[1] : undefined, that.length)) + , search = String(searchString); + return $startsWith + ? $startsWith.call(that, search, index) + : that.slice(index, index + search.length) === search; + } +}); \ No newline at end of file