MCPcopy
hub / github.com/jestjs/jest / dedentLines

Function dedentLines

packages/jest-snapshot/src/dedentLines.ts:130–148  ·  view source on GitHub ↗
(input: Array<string>)

Source from the content-addressed store, hash-verified

128// * text has more than one adjacent line
129// * markup does not close
130export const dedentLines = (input: Array<string>): Array<string> | null => {
131 const output: Array<string> = [];
132
133 while (output.length < input.length) {
134 const line = input[output.length];
135
136 if (hasUnmatchedDoubleQuoteMarks(line)) {
137 return null;
138 } else if (isFirstLineOfTag(line)) {
139 if (!dedentMarkup(input, output)) {
140 return null;
141 }
142 } else {
143 output.push(dedentLine(line));
144 }
145 }
146
147 return output;
148};

Callers 2

printSnapshotAndReceivedFunction · 0.90

Calls 4

isFirstLineOfTagFunction · 0.85
dedentMarkupFunction · 0.85
dedentLineFunction · 0.85

Tested by

no test coverage detected