Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/vitest-dev/vitest. Next generation testing framework powered by Vite. vitest.dev
test testing-tools vite
Something went wrong. Try again.
TypeScript
123456789101112// port from nanoid// https://github.com/ai/nanoidconst urlAlphabet = 'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict'export function nanoid(size = 21): string { let id = '' let i = size while (i--) { id += urlAlphabet[(Math.random() * 64) | 0] } return id}