4
0

rawNodeString.mjs 307 B

123456789101112131415161718
  1. /**
  2. * Stringify PostCSS node including its raw "before" string.
  3. *
  4. * @param {import('postcss').Node} node
  5. *
  6. * @returns {string}
  7. */
  8. export default function rawNodeString(node) {
  9. let result = '';
  10. if (node.raws.before) {
  11. result += node.raws.before;
  12. }
  13. result += node.toString();
  14. return result;
  15. }