src/store.js
function get(key) {
            try {
                if (key !== undefined) {
                    var result = encodeObjectString(STORE.getItem(storeName + key));
                    return result !== null ? result : false;
                } else {
                    var resultAll = {};

                    Object.keys(STORE).map(function(key) {
                        if (key.indexOf(storeName) === 0 && key.indexOf(EXPIRE_KEY) === -1) {
                            var varKey = key.replace(storeName, '');
                            resultAll[varKey] = get(varKey);
                        }
                    });

                    return resultAll;
                }
            } catch(error) {
                console.error(error)
                return false;
            }
        }
function get(key) {
            try {
                if (key !== undefined) {
                    var result = encodeObjectString(STORE.getItem(storeName + key));
                    return result !== null ? result : false;
                } else {
                    var resultAll = {};

                    Object.keys(STORE).map(function(key) {
                        if (key.indexOf(storeName) === 0 && key.indexOf(EXPIRE_KEY) === -1) {
                            var varKey = key.replace(storeName, '');
                            resultAll[varKey] = get(varKey);
                        }
                    });

                    return resultAll;
                }
            } catch(error) {
                console.error(error)
                return false;
            }
        }
function get ( key ) { try { if ( key !== undefined ) { var result = encodeObjectString ( STORE . getItem ( storeName + key ) ) ; return result !== null ? result : false ; } else { var resultAll = { } ; Object . keys ( STORE ) . map ( function ( key ) { if ( key . indexOf ( storeName ) === 0 && key . indexOf ( EXPIRE_KEY ) === - 1 ) { var varKey = key . replace ( storeName , '' ) ; resultAll [ varKey ] = get ( varKey ) ; } } ) ; return resultAll ; } } catch ( error ) { console . error ( error ) return false ; } }
Get the value stored under the given key, or the whole store
@param  {string} [key] Index defined in @set
@return {mixed}        Stored value
Get the value stored under the given key or the whole store