nose-pluto/app/src/shared/utils.ts
Chris Wanstrath 1c3dd16517 reeeeeboooot
2025-09-22 14:55:32 -07:00

9 lines
272 B
TypeScript

// How many times does `char` appear in `str`?
export function countChar(str: string, char: string): number {
return str.split(char).length - 1
}
// Generate a 6 character random ID
export function randomID(): string {
return Math.random().toString(36).slice(7)
}