src/pyjamas.js
/**
     * Encodes each key in the target if it is defined and defined in the
     * prototype of the object
     *
     * @param keys      {object} Object with the keys of the target to encode
     * @param target    {object} Object to encode
     * @param [version] {string} Version string of output
     *
     * @return {object} Encoded object
     * @private
     */
Encodes each key in the target if it is defined and defined in the
prototype of the object

@param keys      {object} Object with the keys of the target to encode
@param target    {object} Object to encode
@param [version] {string} Version string of output

@return {object} Encoded object
@private
Encodes each key in the target if it is defined and defined in the prototype of the object @param keys { object } Object with the keys of the target to encode @param target { object } Object to encode @param [ version ] { string } Version string of output @return { object } Encoded object @private
function encodeEach (keys, target, version) {
        var key, output = {};
        if (Array.isArray(target)) {
            return target.map(function (x) { return encodeEach(x, x); });
        }
        else if (target instanceof Object) {
            for (key in keys) {
                if(target.hasOwnProperty(key)           &&
                    'undefined' !== typeof target[key]  &&
                    'function'  !== typeof target[key]  ) {
                    output[key] = encode(target[key]);
                }
            }
            if (version) {
                output.version = version;
            }
            return output;
        }
        return target;
    }
function encodeEach ( keys , target , version ) { var key , output = { } ; if ( Array . isArray ( target ) ) { return target . map ( function ( x ) { return encodeEach ( x , x ) ; } ) ; } else if ( target instanceof Object ) { for ( key in keys ) { if ( target . hasOwnProperty ( key ) && 'undefined' !== typeof target [ key ] && 'function' !== typeof target [ key ] ) { output [ key ] = encode ( target [ key ] ) ; } } if ( version ) { output . version = version ; } return output ; } return target ; }
Encodes each key in the target if it is defined and defined in the
 prototype of the object
Encodes each key in the target if it is defined and defined in the prototype of the object