Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

addEmptyLineBefore.js 566B

1234567891011121314151617181920212223242526
  1. 'use strict';
  2. /** @typedef {import('postcss').ChildNode} ChildNode */
  3. /**
  4. * Add an empty line before a node. Mutates the node.
  5. *
  6. * @param {ChildNode} node
  7. * @param {'\n' | '\r\n'} newline
  8. * @returns {ChildNode}
  9. */
  10. function addEmptyLineBefore(node, newline) {
  11. if (node.raws.before === undefined) {
  12. return node;
  13. }
  14. if (!/\r?\n/.test(node.raws.before)) {
  15. node.raws.before = newline.repeat(2) + node.raws.before;
  16. } else {
  17. node.raws.before = node.raws.before.replace(/(\r?\n)/, `${newline}$1`);
  18. }
  19. return node;
  20. }
  21. module.exports = addEmptyLineBefore;