From b85cccaba6ed866ba7685635d88a5a76ad13c547 Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Mon, 31 Jan 2022 12:34:14 -0600 Subject: [PATCH] Some util funcs --- scripts/shared/utilities.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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