(array)
| 430 | const joinTextTokens = (textTokens) => { |
| 431 | // Function to deeply flatten an array |
| 432 | const flattenDeep = (array) => { |
| 433 | // Make sure the input is actually an array; otherwise, wrap it in one |
| 434 | if (!Array.isArray(array)) return [array] |
| 435 | |
| 436 | return array.reduce( |
| 437 | (acc, val) => |
| 438 | Array.isArray(val) ? acc.concat(flattenDeep(val)) : acc.concat(val), |
| 439 | [], |
| 440 | ) |
| 441 | } |
| 442 | |
| 443 | // Make sure the initial input is treated as an array if it is not |
| 444 | const flattened = flattenDeep( |
no outgoing calls
no test coverage detected
searching dependent graphs…