Sha256: d5981e070a7d55df2fd36c6fb523b3195ad17176db27038b7e9d146309696f23
Contents?: true
Size: 597 Bytes
Versions: 62
Compression:
Stored size: 597 Bytes
Contents
/* */ 'use strict'; var $def = require('./$.def'), toLength = require('./$.to-length'), context = require('./$.string-context'); $def($def.P + $def.F * !require('./$.fails')(function() { 'q'.endsWith(/./); }), 'String', {endsWith: function endsWith(searchString) { var that = context(this, searchString, 'endsWith'), endPosition = arguments[1], len = toLength(that.length), end = endPosition === undefined ? len : Math.min(toLength(endPosition), len), search = String(searchString); return that.slice(end - search.length, end) === search; }});
Version data entries
62 entries across 31 versions & 1 rubygems