animation.js 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. 'use strict';
  2. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  4. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  5. var Declaration = require('../declaration');
  6. var Animation = function (_Declaration) {
  7. _inherits(Animation, _Declaration);
  8. function Animation() {
  9. _classCallCheck(this, Animation);
  10. return _possibleConstructorReturn(this, _Declaration.apply(this, arguments));
  11. }
  12. /**
  13. * Don’t add prefixes for modern values.
  14. */
  15. Animation.prototype.check = function check(decl) {
  16. return !decl.value.split(/\s+/).some(function (i) {
  17. var lower = i.toLowerCase();
  18. return lower === 'reverse' || lower === 'alternate-reverse';
  19. });
  20. };
  21. return Animation;
  22. }(Declaration);
  23. Object.defineProperty(Animation, 'names', {
  24. enumerable: true,
  25. writable: true,
  26. value: ['animation', 'animation-direction']
  27. });
  28. module.exports = Animation;