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.

getNextNonSharedLineCommentNode.js 734B

1234567891011121314151617181920212223242526272829303132333435363738
  1. 'use strict';
  2. const _ = require('lodash');
  3. /** @typedef {import('postcss').Node} Node */
  4. /**
  5. * @param {Node | void} node
  6. */
  7. function getNodeLine(node) {
  8. return _.get(node, 'source.start.line');
  9. }
  10. /**
  11. * @param {Node | void} node
  12. * @returns {Node | void}
  13. */
  14. module.exports = function getNextNonSharedLineCommentNode(node) {
  15. if (node === undefined) {
  16. return undefined;
  17. }
  18. /** @type {Node | void} */
  19. const nextNode = node.next();
  20. if (_.get(nextNode, 'type') !== 'comment') {
  21. return nextNode;
  22. }
  23. if (
  24. getNodeLine(node) === getNodeLine(nextNode) ||
  25. (nextNode !== undefined && getNodeLine(nextNode) === getNodeLine(nextNode.next()))
  26. ) {
  27. return getNextNonSharedLineCommentNode(nextNode);
  28. }
  29. return nextNode;
  30. };