diff --git a/scripts/shared/utilities.js b/scripts/shared/utilities.js index 53bb44a9..476746e8 100644 --- a/scripts/shared/utilities.js +++ b/scripts/shared/utilities.js @@ -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)); +} + // =========================================================================== \ No newline at end of file