scripts/wee-store.js
function _storageFactory(type) {
	let storage;

	if (type === 'local') {
		storage = window.localStorage;
	} else if (type === 'session') {
		storage = window.sessionStorage;
	}

	return {
		getItem(key) {
			return JSON.parse(storage.getItem(key));
		},
		setItem(key, value) {
			value = JSON.stringify(value);

			return storage.setItem(key, value);
		},
		removeItem(key) {
			return storage.removeItem(key);
		}
	};
}
function _storageFactory(type) {
	let storage;

	if (type === 'local') {
		storage = window.localStorage;
	} else if (type === 'session') {
		storage = window.sessionStorage;
	}

	return {
		getItem(key) {
			return JSON.parse(storage.getItem(key));
		},
		setItem(key, value) {
			value = JSON.stringify(value);

			return storage.setItem(key, value);
		},
		removeItem(key) {
			return storage.removeItem(key);
		}
	};
}
function _storageFactory ( type ) { let storage ; if ( type === 'local' ) { storage = window . localStorage ; } else if ( type === 'session' ) { storage = window . sessionStorage ; } return { getItem ( key ) { return JSON . parse ( storage . getItem ( key ) ) ; } , setItem ( key , value ) { value = JSON . stringify ( value ) ; return storage . setItem ( key , value ) ; } , removeItem ( key ) { return storage . removeItem ( key ) ; } } ; }
Create wrapper for browser storage api

@param {string} type
@returns {*}
@private
Create wrapper for browser storage api