UNPKG

minecraft-text

Version:

Parse Minecraft text into many formats including HTML.

22 lines 1.03 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const static_1 = require("./static"); function obfuscate(text) { const obfuscated = []; text.split("").map(char => { if (static_1.CharSizes.WIDE.indexOf(char) > -1) return obfuscated.push(static_1.CharSizes.WIDE[Math.floor(Math.random() * static_1.CharSizes.WIDE.length)]); if (static_1.CharSizes.MID.indexOf(char) > -1) return obfuscated.push(static_1.CharSizes.MID[Math.floor(Math.random() * static_1.CharSizes.MID.length)]); if (static_1.CharSizes.THIN.indexOf(char) > -1) return obfuscated.push(static_1.CharSizes.THIN[Math.floor(Math.random() * static_1.CharSizes.THIN.length)]); obfuscated.push(char); }); return obfuscated.join(""); } exports.default = obfuscate; (function () { if (typeof window === "undefined") return console.warn("Not running in the browser. Obfuscated text will not be re-obfuscated."); }()); //# sourceMappingURL=obfuscate.js.map