summaryrefslogtreecommitdiff
path: root/node_modules/postcss-merge-longhand/src/lib/minifyTrbl.js
blob: 29d8a8b379038e4cabd6af813f268a28ce0396d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
'use strict';
const parseTrbl = require('./parseTrbl.js');

/** @type {(v: string | [string, string, string, string]) => string} */
module.exports = (v) => {
  const value = parseTrbl(v);

  if (value[3] === value[1]) {
    value.pop();

    if (value[2] === value[0]) {
      value.pop();

      if (value[0] === value[1]) {
        value.pop();
      }
    }
  }

  return value.join(' ');
};