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.

setDeclarationValue.js 638B

1234567891011121314151617181920212223
  1. 'use strict';
  2. const _ = require('lodash');
  3. /** @typedef {import('postcss').Declaration} Declaration */
  4. /**
  5. * @param {Declaration} decl
  6. * @param {string} value
  7. * @returns {Declaration} The declaration that was passed in.
  8. */
  9. module.exports = function setDeclarationValue(decl, value) {
  10. // Lodash is necessary here because the declaration may not strictly adhere
  11. // to the current version of PostCSS's Declaration interface.
  12. // See also: https://github.com/stylelint/stylelint/pull/5183/files#r588047494
  13. if (_.has(decl, 'raws.value')) {
  14. _.set(decl, 'raws.value.raw', value);
  15. } else {
  16. decl.value = value;
  17. }
  18. return decl;
  19. };