(path, options, print)
| 164 | } |
| 165 | |
| 166 | function printChildren(path, options, print) { |
| 167 | const { node } = path; |
| 168 | |
| 169 | if (forceBreakChildren(node)) { |
| 170 | return [ |
| 171 | breakParent, |
| 172 | |
| 173 | ...path.map(() => { |
| 174 | const childNode = path.node; |
| 175 | const prevBetweenLine = !childNode.prev |
| 176 | ? "" |
| 177 | : printBetweenLine(childNode.prev, childNode); |
| 178 | return [ |
| 179 | !prevBetweenLine |
| 180 | ? "" |
| 181 | : [ |
| 182 | prevBetweenLine, |
| 183 | forceNextEmptyLine(childNode.prev) ? hardline : "", |
| 184 | ], |
| 185 | printChild(path, options, print), |
| 186 | ]; |
| 187 | }, "children"), |
| 188 | ]; |
| 189 | } |
| 190 | |
| 191 | const groupIds = node.children.map(() => Symbol("")); |
| 192 | return path.map(({ node: childNode, index: childIndex }) => { |
| 193 | if (isTextLikeNode(childNode)) { |
| 194 | if (childNode.prev && isTextLikeNode(childNode.prev)) { |
| 195 | const prevBetweenLine = printBetweenLine(childNode.prev, childNode); |
| 196 | if (prevBetweenLine) { |
| 197 | if (forceNextEmptyLine(childNode.prev)) { |
| 198 | return [hardline, hardline, printChild(path, options, print)]; |
| 199 | } |
| 200 | return [prevBetweenLine, printChild(path, options, print)]; |
| 201 | } |
| 202 | } |
| 203 | return printChild(path, options, print); |
| 204 | } |
| 205 | |
| 206 | const prevParts = []; |
| 207 | const leadingParts = []; |
| 208 | const trailingParts = []; |
| 209 | const nextParts = []; |
| 210 | |
| 211 | const prevBetweenLine = childNode.prev |
| 212 | ? printBetweenLine(childNode.prev, childNode) |
| 213 | : ""; |
| 214 | |
| 215 | const nextBetweenLine = childNode.next |
| 216 | ? printBetweenLine(childNode, childNode.next) |
| 217 | : ""; |
| 218 | |
| 219 | if (prevBetweenLine) { |
| 220 | if (forceNextEmptyLine(childNode.prev)) { |
| 221 | prevParts.push(hardline, hardline); |
| 222 | } else if (prevBetweenLine === hardline) { |
| 223 | prevParts.push(hardline); |
no test coverage detected
searching dependent graphs…