- Changed the import path for router types from '@kevisual/router' to './route.ts' in src/router-define.ts. - Added a new lock file (bun.lock) to manage dependencies. - Introduced a new utility function in src/utils/random.ts to generate random IDs using the nanoid library.
8 lines
231 B
TypeScript
8 lines
231 B
TypeScript
import { customAlphabet } from 'nanoid';
|
|
|
|
const nanoid = customAlphabet('abcdefghijklmnopqrstuvwxyz', 16);
|
|
|
|
export const randomId = (length: number = 8, affix: string = '') => {
|
|
return affix + nanoid(length);
|
|
}
|
|
export { nanoid }; |