dist/cache/BaseCache.js
/**
     * Delete keys from data if necessary based on RainCache structureDefs options and return the cleaned data
     * @param data The data to possibly delete object entries from
     */
Delete keys from data if necessary based on RainCache structureDefs options and return the cleaned data
@param data The data to possibly delete object entries from
Delete keys from data if necessary based on RainCache structureDefs options and return the cleaned data @param data The data to possibly delete object entries from
structurize(data) {
        if (this.namespace === "base")
            throw new Error("Do not call structurize in BaseCache instances. Only extensions.");
        let ns = this.namespace;
        if (this.namespace === "permissionoverwrite")
            ns = "permOverwrite";
        else if (this.namespace === "voicestates")
            ns = "voiceState";
        const structDefs = this.rain.options.structureDefs;
        if (!structDefs)
            throw new Error("Did you delete the structureDefs property from your RainCache instance?");
        const options = structDefs[ns] || { whitelist: [], blacklist: [] };
        const keys = Object.keys(data);
        if (options.whitelist.length) {
            for (const key of keys) {
                if (!options.whitelist.includes(key))
                    delete data[key];
            }
        }
        else {
            if (options.blacklist.length) {
                for (const key of keys) {
                    if (options.blacklist.includes(key))
                        delete data[key];
                }
            }
        }
        return data;
    }
structurize ( data ) { if ( this . namespace === "base" ) throw new Error ( "Do not call structurize in BaseCache instances. Only extensions." ) ; let ns = this . namespace ; if ( this . namespace === "permissionoverwrite" ) ns = "permOverwrite" ; else if ( this . namespace === "voicestates" ) ns = "voiceState" ; const structDefs = this . rain . options . structureDefs ; if ( ! structDefs ) throw new Error ( "Did you delete the structureDefs property from your RainCache instance?" ) ; const options = structDefs [ ns ] || { whitelist : [ ] , blacklist : [ ] } ; const keys = Object . keys ( data ) ; if ( options . whitelist . length ) { for ( const key of keys ) { if ( ! options . whitelist . includes ( key ) ) delete data [ key ] ; } } else { if ( options . blacklist . length ) { for ( const key of keys ) { if ( options . blacklist . includes ( key ) ) delete data [ key ] ; } } } return data ; }
Delete keys from data if necessary based on RainCache structureDefs options and return the cleaned data
 @param data The data to possibly delete object entries from
Delete keys from data if necessary based on RainCache structureDefs options and return the cleaned data @param data The data to possibly delete object entries from