secure redirect

pull/223/head
Fabian Jakobs 2015-10-14 14:53:53 +00:00
rodzic 8224fb8c66
commit b0e10d15b5
1 zmienionych plików z 9 dodań i 0 usunięć

9
node_modules/c9/string.js wygenerowano vendored
Wyświetl plik

@ -43,5 +43,14 @@ exports.repeat = function(str, times) {
exports.count = function(str, substr){
return str.split(substr).length - 1;
};
exports.endsWith = function(subjectString, searchString, position) {
if (typeof position !== 'number' || !isFinite(position) || Math.floor(position) !== position || position > subjectString.length) {
position = subjectString.length;
}
position -= searchString.length;
var lastIndex = subjectString.indexOf(searchString, position);
return lastIndex !== -1 && lastIndex === position;
};
});