- Added an optional parameter to
getItem(key, noParse)method to determine if the value shouldn't be parsed withJSON.parse
- Upgraded to Webpack 3, ESLint 4.
- Refactored and decoupled inner modules.
- Allow
memoryStorageto be the default fallback forsessionStorage
- Allow storing secure cookies (HTTPS). The property
secureis available through theoptionsparameter forsetItem()andremoveItem()
- Added the
optionsparameter to the API methodremoveItem(), in order to allow passing metadata to the cookie to delete. When using"cookieStorage"the new signature is:instance.removeItem(key, options) - When calling
setItem(), checks if the cookie was created, or deletes it if the domain or path are not valid.
- #4: Removing cookies are failing when the
domainorpathwere set in the cookie. setItem: prevents converting strings values to JSON to avoid extra quotes.
- Added the
domainto thecookieStorageoptions.
- Project migrated to Webpack 2.
- #3: Error trying to get an item from storage.
This version bumps to major because the old method .isAvaliable is renamed to .isAvailable
- Validates the availability of the storage mechanism when a new instance is created. If the requested storage is not available, then the first available storage is used.
- Interceptors now interact with the values in the API methods
setItemandgetItem. Read more about interceptors.
- #2: Getting an error when retrieving nonexistent item from
cookieStorage
WebStorageinstances are singletons by storage mechanism, in order to keep consistency of the data stored.
- #1: Storages have no existing elements when they are instantiated the first time.
- Added keys and
lengthto theWebStorageinstances.
The method setItem has changed its signature when the storage mechanism is set to "cookieStorage"
See more documentation here.
setItem (key: string, value: any, options: object) : voidsetItem (key: string, value: any, expires: number, path: string) : void- Added the static method
WebStorage.interceptors()
- Added
eslint-config-google. - Added
eslint-loaderto webpack. - Added
clean-webpack-pluginto webpack.
- Added webpack as module bundler
- Webpack outputs the library as UMD module (global:
proxyStorage)