123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- "use strict";
- class IdGenerator {
-
- constructor(prefix) {
- this.prefix = String(prefix);
- this.n = 0;
- }
-
- next() {
- this.n = 1 + this.n | 0;
-
- if (this.n < 0) {
- this.n = 1;
- }
- return this.prefix + this.n;
- }
- }
- module.exports = IdGenerator;
|