* @param {string | number | bigint | boolean} v * @param {(v: string) => string} encode * @returns {string}
(v, encode)
| 193 | * @returns {string} |
| 194 | */ |
| 195 | function encodeStringified(v, encode) { |
| 196 | if (typeof v === 'string') |
| 197 | return (v.length ? encode(v) : ''); |
| 198 | if (typeof v === 'number' && NumberIsFinite(v)) { |
| 199 | // Values >= 1e21 automatically switch to scientific notation which requires |
| 200 | // escaping due to the inclusion of a '+' in the output |
| 201 | return (MathAbs(v) < 1e21 ? '' + v : encode('' + v)); |
| 202 | } |
| 203 | if (typeof v === 'bigint') |
| 204 | return '' + v; |
| 205 | if (typeof v === 'boolean') |
| 206 | return v ? 'true' : 'false'; |
| 207 | return ''; |
| 208 | } |
| 209 | |
| 210 | /** |
| 211 | * @param {string | number | boolean | null} v |
nothing calls this directly
no test coverage detected
searching dependent graphs…