(preserveNewlines, state)
| 14 | }; |
| 15 | |
| 16 | const initializeSplitLines = (preserveNewlines, state) => { |
| 17 | state.previousChunks = ''; |
| 18 | return { |
| 19 | transform: splitGenerator.bind(undefined, state, preserveNewlines), |
| 20 | final: linesFinal.bind(undefined, state), |
| 21 | }; |
| 22 | }; |
| 23 | |
| 24 | // This imperative logic is much faster than using `String.split()` and uses very low memory. |
| 25 | const splitGenerator = function * (state, preserveNewlines, chunk) { |
no outgoing calls
no test coverage detected