(value, reducers)
| 35 | * @param {Record<string, (value: any) => any>} [reducers] |
| 36 | */ |
| 37 | export async function stringifyAsync(value, reducers) { |
| 38 | const stringified = run(true, value, reducers); |
| 39 | |
| 40 | if (typeof stringified === 'string') { |
| 41 | return stringified; |
| 42 | } |
| 43 | |
| 44 | let out = '['; |
| 45 | |
| 46 | for (let i = 0; i < stringified.length; i += 1) { |
| 47 | let value = stringified[i]; |
| 48 | |
| 49 | if (typeof value !== 'string') { |
| 50 | await value; |
| 51 | value = stringified[i]; |
| 52 | |
| 53 | if (i === 0 && value < 0) { |
| 54 | return `${value}`; |
| 55 | } |
| 56 | } |
| 57 | |
| 58 | out += value; |
| 59 | |
| 60 | if (i < stringified.length - 1) { |
| 61 | out += ','; |
| 62 | } |
| 63 | } |
| 64 | |
| 65 | out += ']'; |
| 66 | |
| 67 | return out; |
| 68 | } |
| 69 | |
| 70 | /** |
| 71 | * @param {boolean} async |
no test coverage detected
searching dependent graphs…