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.

addEmptyLineAfter.js 618B

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