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.

declarationValueIndex.js 502B

1234567891011121314151617181920212223242526
  1. 'use strict';
  2. const _ = require('lodash');
  3. /**
  4. * Get the index of a declaration's value
  5. *
  6. * @param {import('postcss').Declaration} decl
  7. *
  8. * @returns {number}
  9. */
  10. module.exports = function (decl) {
  11. return [
  12. _.get(decl, 'raws.prop.prefix'),
  13. _.get(decl, 'raws.prop.raw', decl.prop),
  14. _.get(decl, 'raws.prop.suffix'),
  15. _.get(decl, 'raws.between', ':'),
  16. _.get(decl, 'raws.value.prefix'),
  17. ].reduce((count, str) => {
  18. if (str) {
  19. return count + str.length;
  20. }
  21. return count;
  22. }, 0);
  23. };