MCPcopy
hub / github.com/Automattic/juice / stringifyNodes

Function stringifyNodes

lib/utils.js:300–311  ·  view source on GitHub ↗
(nodeList)

Source from the content-addressed store, hash-verified

298}
299
300function stringifyNodes(nodeList) {
301 const out = postcss.root();
302 // Tell PostCSS to emit a trailing `;` after the last child — relevant for
303 // bodyless at-rules like `@layer foo;` and the closing decl of a rule.
304 out.raws.semicolon = true;
305 nodeList.forEach((n, i) => {
306 const clone = n.clone();
307 normalizeRaws(clone, 0, i === 0);
308 out.append(clone);
309 });
310 return out.toString();
311}
312
313export function normalizeLineEndings(text) {
314 return text.replace(/\r\n/g, '\n').replace(/\n/g, '\r\n');

Callers 2

getPreservedTextFunction · 0.85

Calls 1

normalizeRawsFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…