2 * @fileoverview A class of identifiers generator for code path segments.
4 * Each rule uses the identifier of code path segments to store additional
5 * information of the code path.
7 * @author Toru Nagashima
12 //------------------------------------------------------------------------------
14 //------------------------------------------------------------------------------
17 * A generator for unique ids.
21 // eslint-disable-next-line jsdoc/require-description
23 * @param {string} prefix Optional. A prefix of generated ids.
26 this.prefix = String(prefix);
32 * @returns {string} A generated id.
35 this.n = 1 + this.n | 0;
37 /* istanbul ignore if */
42 return this.prefix + this.n;
46 module.exports = IdGenerator;