Sha256: d267d33ae24f246dcaa2841bfa6112a3e4cedafeabdc59712956d8da7b042ec4
Contents?: true
Size: 566 Bytes
Versions: 24
Compression:
Stored size: 566 Bytes
Contents
'use strict'; /** @typedef {import('postcss').ChildNode} ChildNode */ /** * Add an empty line before a node. Mutates the node. * * @param {ChildNode} node * @param {'\n' | '\r\n'} newline * @returns {ChildNode} */ function addEmptyLineBefore(node, newline) { if (node.raws.before === undefined) { return node; } if (!/\r?\n/.test(node.raws.before)) { node.raws.before = newline.repeat(2) + node.raws.before; } else { node.raws.before = node.raws.before.replace(/(\r?\n)/, `${newline}$1`); } return node; } module.exports = addEmptyLineBefore;
Version data entries
24 entries across 24 versions & 1 rubygems