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