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.

at-rule.js 2.8KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. "use strict";
  2. function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
  3. function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } it = o[Symbol.iterator](); return it.next.bind(it); }
  4. function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
  5. function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
  6. function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _defaults(subClass, superClass); }
  7. var Prefixer = require('./prefixer');
  8. var AtRule = /*#__PURE__*/function (_Prefixer) {
  9. _inheritsLoose(AtRule, _Prefixer);
  10. function AtRule() {
  11. return _Prefixer.apply(this, arguments) || this;
  12. }
  13. var _proto = AtRule.prototype;
  14. /**
  15. * Clone and add prefixes for at-rule
  16. */
  17. _proto.add = function add(rule, prefix) {
  18. var prefixed = prefix + rule.name;
  19. var already = rule.parent.some(function (i) {
  20. return i.name === prefixed && i.params === rule.params;
  21. });
  22. if (already) {
  23. return undefined;
  24. }
  25. var cloned = this.clone(rule, {
  26. name: prefixed
  27. });
  28. return rule.parent.insertBefore(rule, cloned);
  29. }
  30. /**
  31. * Clone node with prefixes
  32. */
  33. ;
  34. _proto.process = function process(node) {
  35. var parent = this.parentPrefix(node);
  36. for (var _iterator = _createForOfIteratorHelperLoose(this.prefixes), _step; !(_step = _iterator()).done;) {
  37. var prefix = _step.value;
  38. if (!parent || parent === prefix) {
  39. this.add(node, prefix);
  40. }
  41. }
  42. };
  43. return AtRule;
  44. }(Prefixer);
  45. module.exports = AtRule;