mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-06 14:05:46 +01:00
closes #2593
This commit is contained in:
@@ -365,6 +365,18 @@
|
||||
}
|
||||
return i < 0;
|
||||
};
|
||||
|
||||
String.prototype.endsWith = function(suffix) {
|
||||
if (this.length < suffix.length) {
|
||||
return false;
|
||||
}
|
||||
var len = this.length;
|
||||
var suffixLen = suffix.length;
|
||||
for (var i=1; (i <= suffixLen && this[len - i] === suffix[suffixLen - i]); ++i) {
|
||||
continue;
|
||||
}
|
||||
return i > suffixLen;
|
||||
};
|
||||
}
|
||||
|
||||
if ('undefined' !== typeof window) {
|
||||
|
||||
Reference in New Issue
Block a user