1 | var toString = require('../lang/toString');
|
2 | /**
|
3 | * Checks if string ends with specified suffix.
|
4 | */
|
5 | function endsWith(str, suffix) {
|
6 | str = toString(str);
|
7 | suffix = toString(suffix);
|
8 |
|
9 | return str.indexOf(suffix, str.length - suffix.length) !== -1;
|
10 | }
|
11 |
|
12 | module.exports = endsWith;
|
13 |
|