MCPcopy Create free account
hub / github.com/sindresorhus/execa / initializeSplitLines

Function initializeSplitLines

lib/transform/split.js:16–22  ·  view source on GitHub ↗
(preserveNewlines, state)

Source from the content-addressed store, hash-verified

14};
15
16const 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.
25const splitGenerator = function * (state, preserveNewlines, chunk) {

Callers 2

getSplitLinesGeneratorFunction · 0.85
splitLinesItemSyncFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected