lib.js
function (obj) {
        var clone = _.clone(obj);
        if (obj.style) {
            var style = obj.style;
            clone.style = {
                "font-family": style.fontFamily,
                "font-size": style.fontSize + "px",
                "font-weight": (style.mask & bin(4)) ? "bold" : "normal",
                "font-style": (style.mask & bin(5)) ? "italic" : "normal",
                "text-decoration": (((style.mask & bin(6)) ? "underline " : "") + ((style.mask & bin(7)) ? "line-through" : "")),
                "text-align": style.textAlign,
                "color": style.color,
                "background-color": style.backgroundColor,
                "border": [style.borderWidth + "px", style.borderStyle, style.borderColor].join(" "),
                "padding": style.padding.join("px ") + "px"
            };
            _.extend(clone.style, checkBorder(style.mask));
        }
        // init style if null
        clone.style || (clone.style = {});
        return clone;
    }
function (obj) {
        var clone = _.clone(obj);
        if (obj.style) {
            var style = obj.style;
            clone.style = {
                "font-family": style.fontFamily,
                "font-size": style.fontSize + "px",
                "font-weight": (style.mask & bin(4)) ? "bold" : "normal",
                "font-style": (style.mask & bin(5)) ? "italic" : "normal",
                "text-decoration": (((style.mask & bin(6)) ? "underline " : "") + ((style.mask & bin(7)) ? "line-through" : "")),
                "text-align": style.textAlign,
                "color": style.color,
                "background-color": style.backgroundColor,
                "border": [style.borderWidth + "px", style.borderStyle, style.borderColor].join(" "),
                "padding": style.padding.join("px ") + "px"
            };
            _.extend(clone.style, checkBorder(style.mask));
        }
        // init style if null
        clone.style || (clone.style = {});
        return clone;
    }
function ( obj ) { var clone = _ . clone ( obj ) ; if ( obj . style ) { var style = obj . style ; clone . style = { "font-family" : style . fontFamily , "font-size" : style . fontSize + "px" , "font-weight" : ( style . mask & bin ( 4 ) ) ? "bold" : "normal" , "font-style" : ( style . mask & bin ( 5 ) ) ? "italic" : "normal" , "text-decoration" : ( ( ( style . mask & bin ( 6 ) ) ? "underline " : "" ) + ( ( style . mask & bin ( 7 ) ) ? "line-through" : "" ) ) , "text-align" : style . textAlign , "color" : style . color , "background-color" : style . backgroundColor , "border" : [ style . borderWidth + "px" , style . borderStyle , style . borderColor ] . join ( " " ) , "padding" : style . padding . join ( "px " ) + "px" } ; _ . extend ( clone . style , checkBorder ( style . mask ) ) ; } // init style if null clone . style || ( clone . style = { } ) ; return clone ; }
Replace object.style with real style
@param obj
@return {*}
Replace object . style with real style