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.

variable.js 930B

12345678910111213141516171819202122232425262728293031323334
  1. /* eslint no-param-reassign: off */
  2. const afterPattern = /:$/;
  3. const beforePattern = /^:(\s+)?/;
  4. // const bracketsPattern = /\{/;
  5. module.exports = (node) => {
  6. const { name, params = '' } = node;
  7. // situations like @page :last { color: red } should default to the built-in AtRule
  8. // LESS variables are @name : value; < note that for them to be valid LESS vars, they must end in
  9. // a semicolon.
  10. if (node.name.slice(-1) !== ':') {
  11. return;
  12. }
  13. if (afterPattern.test(name)) {
  14. const [match] = name.match(afterPattern);
  15. node.name = name.replace(match, '');
  16. node.raws.afterName = match + (node.raws.afterName || '');
  17. node.variable = true;
  18. node.value = node.params;
  19. }
  20. if (beforePattern.test(params)) {
  21. const [match] = params.match(beforePattern);
  22. node.value = params.replace(match, '');
  23. node.raws.afterName = (node.raws.afterName || '') + match;
  24. node.variable = true;
  25. }
  26. };