1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | const static_1 = require("./static");
|
4 | function obfuscate(text) {
|
5 | const obfuscated = [];
|
6 | text.split("").map(char => {
|
7 | if (static_1.CharSizes.WIDE.indexOf(char) > -1)
|
8 | return obfuscated.push(static_1.CharSizes.WIDE[Math.floor(Math.random() * static_1.CharSizes.WIDE.length)]);
|
9 | if (static_1.CharSizes.MID.indexOf(char) > -1)
|
10 | return obfuscated.push(static_1.CharSizes.MID[Math.floor(Math.random() * static_1.CharSizes.MID.length)]);
|
11 | if (static_1.CharSizes.THIN.indexOf(char) > -1)
|
12 | return obfuscated.push(static_1.CharSizes.THIN[Math.floor(Math.random() * static_1.CharSizes.THIN.length)]);
|
13 | obfuscated.push(char);
|
14 | });
|
15 | return obfuscated.join("");
|
16 | }
|
17 | exports.default = obfuscate;
|
18 | (function () {
|
19 | if (typeof window === "undefined")
|
20 | return console.warn("Not running in the browser. Obfuscated text will not be re-obfuscated.");
|
21 | }());
|
22 |
|
\ | No newline at end of file |