(s, o)
| 19154 | return this._gen(this.tokens, []) |
| 19155 | } |
| 19156 | _gen(s, o) { |
| 19157 | var i, a, u, w, x |
| 19158 | switch (s.type) { |
| 19159 | case _.ROOT: |
| 19160 | case _.GROUP: |
| 19161 | if (s.followedBy || s.notFollowedBy) return '' |
| 19162 | for ( |
| 19163 | s.remember && void 0 === s.groupNumber && (s.groupNumber = o.push(null) - 1), |
| 19164 | a = '', |
| 19165 | w = 0, |
| 19166 | x = (i = s.options ? this._randSelect(s.options) : s.stack).length; |
| 19167 | w < x; |
| 19168 | w++ |
| 19169 | ) |
| 19170 | a += this._gen(i[w], o) |
| 19171 | return (s.remember && (o[s.groupNumber] = a), a) |
| 19172 | case _.POSITION: |
| 19173 | return '' |
| 19174 | case _.SET: |
| 19175 | var C = this._expand(s) |
| 19176 | return C.length ? String.fromCharCode(this._randSelect(C)) : '' |
| 19177 | case _.REPETITION: |
| 19178 | for ( |
| 19179 | u = this.randInt(s.min, s.max === 1 / 0 ? s.min + this.max : s.max), |
| 19180 | a = '', |
| 19181 | w = 0; |
| 19182 | w < u; |
| 19183 | w++ |
| 19184 | ) |
| 19185 | a += this._gen(s.value, o) |
| 19186 | return a |
| 19187 | case _.REFERENCE: |
| 19188 | return o[s.value - 1] || '' |
| 19189 | case _.CHAR: |
| 19190 | var j = this.ignoreCase && this._randBool() ? this._toOtherCase(s.value) : s.value |
| 19191 | return String.fromCharCode(j) |
| 19192 | } |
| 19193 | } |
| 19194 | _toOtherCase(s) { |
| 19195 | return s + (97 <= s && s <= 122 ? -32 : 65 <= s && s <= 90 ? 32 : 0) |
| 19196 | } |
no test coverage detected