refactor
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
import * as regex from "./regex.js";
|
||||
|
||||
const MINI_UID_REGEX = regex.pretty(
|
||||
const MINI_UID_REGEX = regex.compileMultilineRegex(
|
||||
"\.uid\.", // Mini-uids always begin with ".uid."
|
||||
"[a-z0-9]{6,}$", // Terminated by 6 or more random numbers and lowercase letters.
|
||||
);
|
||||
const ID_SANITY_REGEX = regex.pretty(
|
||||
const ID_SANITY_REGEX = regex.compileMultilineRegex(
|
||||
"^:", // All ids start with a colon
|
||||
"([a-z0-9]+\.)*?", // Middle -optional- part :myid.gogle.thing.thang.thong
|
||||
"[a-z0-9_]+$", // The terminating part of the id is numbers, lowercase letters, and -notably- underscores.
|
||||
@@ -33,7 +33,7 @@ export function isIdSane(id) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {string} crypto-unsafe pseudo random numbe"r.
|
||||
* @returns {string} crypto-unsafe pseudo random number.
|
||||
*
|
||||
* Generate a random number, convert it to base36, and return it as a string with 7-8 characters.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user