* feat: add eslint-plugin-tsdoc * feat(doc): update current jsdoc to tsdoc specification * chore: update deps * feat: update warn to error for jsdoc and tsdoc * chore(doc): lint
10 lines
300 B
TypeScript
10 lines
300 B
TypeScript
import { customAlphabet } from 'nanoid';
|
|
|
|
/**
|
|
* Generate secure URL-friendly unique ID.
|
|
*
|
|
* @param size - Size of the ID. The default size is 12.
|
|
* @returns A random string.
|
|
*/
|
|
export const generateRandomId = customAlphabet('abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789', 12);
|