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.

isStandardSyntaxSelector.js 737B

1234567891011121314151617181920212223242526272829303132333435363738
  1. 'use strict';
  2. const hasInterpolation = require('../utils/hasInterpolation');
  3. /**
  4. * Check whether a selector is standard
  5. *
  6. * @param {string} selector
  7. * @returns {boolean}
  8. */
  9. module.exports = function (selector) {
  10. // SCSS or Less interpolation
  11. if (hasInterpolation(selector)) {
  12. return false;
  13. }
  14. // SCSS placeholder selectors
  15. if (selector.startsWith('%')) {
  16. return false;
  17. }
  18. // Less :extend()
  19. if (/:extend(\(.*?\))?/.test(selector)) {
  20. return false;
  21. }
  22. // Less mixin with resolved nested selectors (e.g. .foo().bar or .foo(@a, @b)[bar])
  23. if (/\.[\w-]+\(.*\).+/i.test(selector)) {
  24. return false;
  25. }
  26. // ERB template tags
  27. if (selector.includes('<%') || selector.includes('%>')) {
  28. return false;
  29. }
  30. return true;
  31. };