vendor/kinetic-v5.1.0.js
function() {
            var type = Kinetic.Util,
                obj = {},
                attrs = this.getAttrs(),
                key, val, getter, defaultValue;

            obj.attrs = {};

            // serialize only attributes that are not function, image, DOM, or objects with methods
            for(key in attrs) {
                val = attrs[key];
                if (!type._isFunction(val) && !type._isElement(val) && !(type._isObject(val) && type._hasMethods(val))) {
                    getter = this[key];
                    // remove attr value so that we can extract the default value from the getter
                    delete attrs[key];
                    defaultValue = getter ? getter.call(this) : null;
                    // restore attr value
                    attrs[key] = val;
                    if (defaultValue !== val) {
                        obj.attrs[key] = val;
                    }
                }
            }

            obj.className = this.getClassName();
            return obj;
        }
function() {
            var type = Kinetic.Util,
                obj = {},
                attrs = this.getAttrs(),
                key, val, getter, defaultValue;

            obj.attrs = {};

            // serialize only attributes that are not function, image, DOM, or objects with methods
            for(key in attrs) {
                val = attrs[key];
                if (!type._isFunction(val) && !type._isElement(val) && !(type._isObject(val) && type._hasMethods(val))) {
                    getter = this[key];
                    // remove attr value so that we can extract the default value from the getter
                    delete attrs[key];
                    defaultValue = getter ? getter.call(this) : null;
                    // restore attr value
                    attrs[key] = val;
                    if (defaultValue !== val) {
                        obj.attrs[key] = val;
                    }
                }
            }

            obj.className = this.getClassName();
            return obj;
        }
function ( ) { var type = Kinetic . Util , obj = { } , attrs = this . getAttrs ( ) , key , val , getter , defaultValue ; obj . attrs = { } ; // serialize only attributes that are not function, image, DOM, or objects with methods for ( key in attrs ) { val = attrs [ key ] ; if ( ! type . _isFunction ( val ) && ! type . _isElement ( val ) && ! ( type . _isObject ( val ) && type . _hasMethods ( val ) ) ) { getter = this [ key ] ; // remove attr value so that we can extract the default value from the getter delete attrs [ key ] ; defaultValue = getter ? getter . call ( this ) : null ; // restore attr value attrs [ key ] = val ; if ( defaultValue !== val ) { obj . attrs [ key ] = val ; } } } obj . className = this . getClassName ( ) ; return obj ; }
convert Node into an object for serialization.  Returns an object.
@method
@memberof Kinetic.Node.prototype
@returns {Object}
convert Node into an object for serialization . Returns an object .