Last change
on this file since 76712b2 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
981 bytes
|
Rev | Line | |
---|
[6a3a178] | 1 | "use strict";
|
---|
| 2 |
|
---|
| 3 | Object.defineProperty(exports, "__esModule", {
|
---|
| 4 | value: true
|
---|
| 5 | });
|
---|
| 6 | exports.default = void 0;
|
---|
| 7 |
|
---|
| 8 | var _parseWsc = _interopRequireDefault(require("./parseWsc"));
|
---|
| 9 |
|
---|
| 10 | var _minifyTrbl = _interopRequireDefault(require("./minifyTrbl"));
|
---|
| 11 |
|
---|
| 12 | var _validateWsc = require("./validateWsc");
|
---|
| 13 |
|
---|
| 14 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
---|
| 15 |
|
---|
| 16 | const defaults = ['medium', 'none', 'currentcolor'];
|
---|
| 17 |
|
---|
| 18 | var _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 |
|
---|
| 35 | exports.default = _default;
|
---|
| 36 | module.exports = exports.default; |
---|
Note:
See
TracBrowser
for help on using the repository browser.