code: 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);
  		}
  	};
  }
docs: Create wrapper for browser storage api
  
  @param {string} type
  @returns {*}
  @private