Some util funcs

This commit is contained in:
Vortrex
2022-01-31 12:34:14 -06:00
parent 6d94aa6654
commit b85cccaba6

View File

@@ -1343,4 +1343,20 @@ function getLockedUnlockedEmojiFromBool(boolVal) {
return (boolVal) ? "🔒" : "🔓";
}
// ===========================================================================
String.prototype.format = function() {
let a = this;
for(let i in arguments) {
a = a.replace("{" + String(i) + "}", arguments[i]);
}
return a;
}
// ===========================================================================
function ArrayBufferToString(buffer) {
return String.fromCharCode.apply(null, new Uint8Array(buffer));
}
// ===========================================================================