chore: revert change in this branch

This commit is contained in:
Shishkevich D. 2025-03-09 12:35:03 +00:00
parent a059127c07
commit 25d00b5710

View file

@ -81,19 +81,12 @@ class PromiseUtil {
} }
class RandomUtil { class RandomUtil {
static getSeq({ type = "default", hasNumbers = true, hasLowercase = true, hasUppercase = true } = {}) { static getSeq({ hasNumbers = true, hasLowercase = true, hasUppercase = true } = {}) {
let seq = ''; let seq = '';
switch (type) { if (hasNumbers) seq += "0123456789";
case "hex": if (hasLowercase) seq += "abcdefghijklmnopqrstuvwxyz";
seq += "0123456789abcdef"; if (hasUppercase) seq += "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
break;
default:
if (hasNumbers) seq += "0123456789";
if (hasLowercase) seq += "abcdefghijklmnopqrstuvwxyz";
if (hasUppercase) seq += "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
break;
}
return seq; return seq;
} }
@ -116,7 +109,7 @@ class RandomUtil {
static randomShortIds() { static randomShortIds() {
const lengths = [2, 4, 6, 8, 10, 12, 14, 16].sort(() => Math.random() - 0.5); const lengths = [2, 4, 6, 8, 10, 12, 14, 16].sort(() => Math.random() - 0.5);
return lengths.map(len => this.randomSeq(len, { type: "hex" })).join(','); return lengths.map(len => this.randomSeq(len)).join(',');
} }
static randomLowerAndNum(len) { static randomLowerAndNum(len) {