packages/graphstore-dev/src/firebase/jparser.js
function cleanItem(value) {

        var newvalue = null;

        if (Array.isArray(value)) {

            if (value.indexOf("consumer") > -1) {
                value.forEach(function (key2) {
                    ids[key2] = "roles";
                });
            }

            newvalue = [];

            value.forEach(function (item) {
                newvalue.push(cleanItem(item));
            })

            return newvalue;
        }

        if ((typeof value !== "object") || (value == null)) {
            return value;
        }

        Object.keys(value).forEach(function (key) {

            if (key == "orgs") {
                Object.keys(value[key]).forEach(function (key2) {
                    ids[key2] = "orgs";
                });
            }

            if (key == "_temp") {
                return;
            } else if (key == "encData" || key == "signature" || key == "encPrivateKey" || key == "publicKey") {
                newvalue = newvalue || {};
                if (typeof newvalue !== "object") throw new Error("Not Object" + key)
                newvalue[key] = "..."
            } else {
                newvalue = newvalue || {};
                if (typeof newvalue !== "object") throw new Error("Not Object" + key)
                newvalue[key] = cleanItem(value[key])
            }
        });

        return newvalue;
    }
function cleanItem(value) {

        var newvalue = null;

        if (Array.isArray(value)) {

            if (value.indexOf("consumer") > -1) {
                value.forEach(function (key2) {
                    ids[key2] = "roles";
                });
            }

            newvalue = [];

            value.forEach(function (item) {
                newvalue.push(cleanItem(item));
            })

            return newvalue;
        }

        if ((typeof value !== "object") || (value == null)) {
            return value;
        }

        Object.keys(value).forEach(function (key) {

            if (key == "orgs") {
                Object.keys(value[key]).forEach(function (key2) {
                    ids[key2] = "orgs";
                });
            }

            if (key == "_temp") {
                return;
            } else if (key == "encData" || key == "signature" || key == "encPrivateKey" || key == "publicKey") {
                newvalue = newvalue || {};
                if (typeof newvalue !== "object") throw new Error("Not Object" + key)
                newvalue[key] = "..."
            } else {
                newvalue = newvalue || {};
                if (typeof newvalue !== "object") throw new Error("Not Object" + key)
                newvalue[key] = cleanItem(value[key])
            }
        });

        return newvalue;
    }
function cleanItem ( value ) { var newvalue = null ; if ( Array . isArray ( value ) ) { if ( value . indexOf ( "consumer" ) > - 1 ) { value . forEach ( function ( key2 ) { ids [ key2 ] = "roles" ; } ) ; } newvalue = [ ] ; value . forEach ( function ( item ) { newvalue . push ( cleanItem ( item ) ) ; } ) return newvalue ; } if ( ( typeof value !== "object" ) || ( value == null ) ) { return value ; } Object . keys ( value ) . forEach ( function ( key ) { if ( key == "orgs" ) { Object . keys ( value [ key ] ) . forEach ( function ( key2 ) { ids [ key2 ] = "orgs" ; } ) ; } if ( key == "_temp" ) { return ; } else if ( key == "encData" || key == "signature" || key == "encPrivateKey" || key == "publicKey" ) { newvalue = newvalue || { } ; if ( typeof newvalue !== "object" ) throw new Error ( "Not Object" + key ) newvalue [ key ] = "..." } else { newvalue = newvalue || { } ; if ( typeof newvalue !== "object" ) throw new Error ( "Not Object" + key ) newvalue [ key ] = cleanItem ( value [ key ] ) } } ) ; return newvalue ; }
REMOVE _temp and clean encrypted data
REMOVE _temp and clean encrypted data