tasks/cssstats.js
function sortFontSizes(fontSizes) {
        var r = {};
        var temp = [];
        var size = 0;
        var biggest = 0;

        for (var prop in fontSizes) {
            if (fontSizes.hasOwnProperty(prop)) {

                size++;

                var val = prop.replace(/[^0-9.\/]/g, '').replace(/\/[0-9]/g, '');

                if (prop.indexOf('%') > -1) {
                    val = 16 / 100 * val;
                }

                if (prop.indexOf('em') > -1
                    || prop.indexOf('rem') > -1
                    || prop.indexOf('vw') > -1
                    || prop.indexOf('vh') > -1) {
                    val = 16 * val;
                }

                if (val === '') {
                    val = prop;
                }

                biggest = val > biggest ? val : biggest;

                if (/[0-9.]/g.test(val)) {
                    temp.push({
                                  viewSizePx:  val,
                                  viewSizeStr: '',
                                  cssSize:     prop,
                                  amount:      fontSizes[prop]
                              });
                } else {
                    temp.push({
                                  viewSizePx:  0,
                                  viewSizeStr: val,
                                  cssSize:     prop,
                                  amount:      fontSizes[prop]
                              });
                }


            }
        }


        r = temp.sort(function (a, b) {
            return b.viewSizePx - a.viewSizePx;
        });

        return r;
    }
function sortFontSizes(fontSizes) {
        var r = {};
        var temp = [];
        var size = 0;
        var biggest = 0;

        for (var prop in fontSizes) {
            if (fontSizes.hasOwnProperty(prop)) {

                size++;

                var val = prop.replace(/[^0-9.\/]/g, '').replace(/\/[0-9]/g, '');

                if (prop.indexOf('%') > -1) {
                    val = 16 / 100 * val;
                }

                if (prop.indexOf('em') > -1
                    || prop.indexOf('rem') > -1
                    || prop.indexOf('vw') > -1
                    || prop.indexOf('vh') > -1) {
                    val = 16 * val;
                }

                if (val === '') {
                    val = prop;
                }

                biggest = val > biggest ? val : biggest;

                if (/[0-9.]/g.test(val)) {
                    temp.push({
                                  viewSizePx:  val,
                                  viewSizeStr: '',
                                  cssSize:     prop,
                                  amount:      fontSizes[prop]
                              });
                } else {
                    temp.push({
                                  viewSizePx:  0,
                                  viewSizeStr: val,
                                  cssSize:     prop,
                                  amount:      fontSizes[prop]
                              });
                }


            }
        }


        r = temp.sort(function (a, b) {
            return b.viewSizePx - a.viewSizePx;
        });

        return r;
    }
function sortFontSizes ( fontSizes ) { var r = { } ; var temp = [ ] ; var size = 0 ; var biggest = 0 ; for ( var prop in fontSizes ) { if ( fontSizes . hasOwnProperty ( prop ) ) { size ++ ; var val = prop . replace ( / [^0-9.\/] / g , '' ) . replace ( / \/[0-9] / g , '' ) ; if ( prop . indexOf ( '%' ) > - 1 ) { val = 16 / 100 * val ; } if ( prop . indexOf ( 'em' ) > - 1 || prop . indexOf ( 'rem' ) > - 1 || prop . indexOf ( 'vw' ) > - 1 || prop . indexOf ( 'vh' ) > - 1 ) { val = 16 * val ; } if ( val === '' ) { val = prop ; } biggest = val > biggest ? val : biggest ; if ( / [0-9.] / g . test ( val ) ) { temp . push ( { viewSizePx : val , viewSizeStr : '' , cssSize : prop , amount : fontSizes [ prop ] } ) ; } else { temp . push ( { viewSizePx : 0 , viewSizeStr : val , cssSize : prop , amount : fontSizes [ prop ] } ) ; } } } r = temp . sort ( function ( a , b ) { return b . viewSizePx - a . viewSizePx ; } ) ; return r ; }
sorts the font sizes from big too small

@param fontSizes
@returns {{}}
sorts the font sizes from big too small