CssMin icon indicating copy to clipboard operation
CssMin copied to clipboard

'+ +' not correctly minified

Open Bartheyrman22 opened this issue 6 years ago • 0 comments

'+ +' not correctly minified and becomes '++'. See minified code below.

Environment: php 7.2 natxet/CssMin 3.0.4

Original function:

function getBordersSize(styles, axis) {
    var sideA = axis === 'x' ? 'Left' : 'Top';
    var sideB = sideA === 'Left' ? 'Right' : 'Bottom';

    return +styles['border' + sideA + 'Width'].split('px')[0] + +styles['border' + sideB + 'Width'].split('px')[0];
}

A minified function:

function getBordersSize(styles,axis){var sideA=axis==='x'?'Left':'Top';var sideB=sideA==='Left'?'Right':'Bottom';return+styles['border'+sideA+'Width'].split('px')[0]++styles['border'+sideB+'Width'].split('px')[0];}

Best regards, Bart Heyrman

Bartheyrman22 avatar Dec 12 '18 17:12 Bartheyrman22