(node, path, meta)
| 256 | }, |
| 257 | |
| 258 | TextNode(node, path, meta) { |
| 259 | if (!meta.sortTextNodes) { |
| 260 | return |
| 261 | } |
| 262 | |
| 263 | let concat = path.find((entry) => { |
| 264 | return entry.parent && entry.parent.type === 'ConcatStatement' |
| 265 | }) |
| 266 | |
| 267 | let siblings = { |
| 268 | prev: concat?.parent.parts[concat.index! - 1], |
| 269 | next: concat?.parent.parts[concat.index! + 1], |
| 270 | } |
| 271 | |
| 272 | node.chars = sortClasses(node.chars, { |
| 273 | env, |
| 274 | ignoreFirst: siblings.prev && !/^\s/.test(node.chars), |
| 275 | ignoreLast: siblings.next && !/\s$/.test(node.chars), |
| 276 | collapseWhitespace: { |
| 277 | start: !siblings.prev, |
| 278 | end: !siblings.next, |
| 279 | }, |
| 280 | }) |
| 281 | }, |
| 282 | |
| 283 | StringLiteral(node, path, meta) { |
| 284 | if (!meta.sortTextNodes) { |
nothing calls this directly
no test coverage detected
searching dependent graphs…