1 var baseClamp = require(
'./_baseClamp'),
2 baseToString = require(
'./_baseToString'),
3 toInteger = require(
'./toInteger'),
4 toString = require(
'./toString');
29 function endsWith(
string, target, position) {
30 string = toString(
string);
31 target = baseToString(target);
33 var length =
string.length;
34 position = position === undefined
36 : baseClamp(toInteger(position), 0, length);
39 position -= target.length;
40 return position >= 0 &&
string.slice(position, end) == target;
43 module.exports = endsWith;