11 lines
210 B
TypeScript
11 lines
210 B
TypeScript
let counter = 0
|
|
|
|
export function generateId(prefix: string) {
|
|
void prefix
|
|
counter += 1
|
|
|
|
const now = Date.now().toString()
|
|
const suffix = counter.toString().padStart(3, "0")
|
|
return `${now}${suffix}`
|
|
}
|