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.

28 lines
794 B

4 years ago
  1. 'use strict';
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.default = getValue;
  6. var _postcssValueParser = require('postcss-value-parser');
  7. function getValue(values) {
  8. return (0, _postcssValueParser.stringify)({
  9. nodes: values.reduce((nodes, arg, index) => {
  10. arg.forEach((val, idx) => {
  11. if (idx === arg.length - 1 && index === values.length - 1 && val.type === 'space') {
  12. return;
  13. }
  14. nodes.push(val);
  15. });
  16. if (index !== values.length - 1) {
  17. nodes[nodes.length - 1].type = 'div';
  18. nodes[nodes.length - 1].value = ',';
  19. }
  20. return nodes;
  21. }, [])
  22. });
  23. }
  24. module.exports = exports['default'];