Security update to Drupal 8.4.6
[yaffs-website] / node_modules / underscore.string / endsWith.js
1 var makeString = require('./helper/makeString');
2 var toPositive = require('./helper/toPositive');
3
4 module.exports = function endsWith(str, ends, position) {
5   str = makeString(str);
6   ends = '' + ends;
7   if (typeof position == 'undefined') {
8     position = str.length - ends.length;
9   } else {
10     position = Math.min(toPositive(position), str.length) - ends.length;
11   }
12   return position >= 0 && str.indexOf(ends, position) === position;
13 };