source: trip-planner-front/node_modules/postcss-merge-longhand/dist/lib/minifyWsc.js@ e29cc2e

Last change on this file since e29cc2e was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 981 bytes
Line 
1"use strict";
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6exports.default = void 0;
7
8var _parseWsc = _interopRequireDefault(require("./parseWsc"));
9
10var _minifyTrbl = _interopRequireDefault(require("./minifyTrbl"));
11
12var _validateWsc = require("./validateWsc");
13
14function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
16const defaults = ['medium', 'none', 'currentcolor'];
17
18var _default = v => {
19 const values = (0, _parseWsc.default)(v);
20
21 if (!(0, _validateWsc.isValidWsc)(values)) {
22 return (0, _minifyTrbl.default)(v);
23 }
24
25 const value = [...values, ''].reduceRight((prev, cur, i, arr) => {
26 if (cur === undefined || cur.toLowerCase() === defaults[i] && (!i || (arr[i - 1] || '').toLowerCase() !== cur.toLowerCase())) {
27 return prev;
28 }
29
30 return cur + ' ' + prev;
31 }).trim();
32 return (0, _minifyTrbl.default)(value || 'none');
33};
34
35exports.default = _default;
36module.exports = exports.default;
Note: See TracBrowser for help on using the repository browser.