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

Function getAppendNewlineGenerator

lib/transform/split.js:75–77  ·  view source on GitHub ↗
({binary, preserveNewlines, readableObjectMode, state})

Source from the content-addressed store, hash-verified

73// Unless `preserveNewlines: true` is used, we strip the newline of each line.
74// This re-adds them after the user `transform` code has run.
75export const getAppendNewlineGenerator = ({binary, preserveNewlines, readableObjectMode, state}) => binary || preserveNewlines || readableObjectMode
76 ? undefined
77 : {transform: appendNewlineGenerator.bind(undefined, state)};
78
79const appendNewlineGenerator = function * ({isWindowsNewline = false}, chunk) {
80 const {unixNewline, windowsNewline, LF, concatBytes} = typeof chunk === 'string' ? linesStringInfo : linesUint8ArrayInfo;

Callers 1

addInternalGeneratorsFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected