Erant-OldApp/cms/components/idGenerator.ts

7 lines
143 B
TypeScript
Raw Normal View History

2022-12-03 17:37:32 +00:00
const gen = (function* () {
let index = -1
while (true) yield index++
})()
export default (pre: string = '') => `${pre}${gen.next().value}`