Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export async function makeId(len = 12): Promise {
const id = await nanoid(len);
const result = badIdRegex.exec(id);
if (result && result[0].length) {
const chars = generate('1234567890abcdef', result[0].length);
return id.replace(badIdRegex, chars);
}
return id;
}export async function makeId(len = 12): Promise {
const id = await nanoid(len);
const result = badIdRegex.exec(id);
if (result && result[0].length) {
const chars = generate('1234567890abcdef', result[0].length);
return id.replace(badIdRegex, chars);
}
return id;
}export function newMsgId(): Promise {
return nanoid(10);
}