- 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
memoryStorage
to be the default fallback forsessionStorage
- Allow storing secure cookies (HTTPS). The property
secure
is available through theoptions
parameter forsetItem()
andremoveItem()
- Added the
options
parameter 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
domain
orpath
were set in the cookie. setItem
: prevents converting strings values to JSON to avoid extra quotes.
- Added the
domain
to thecookieStorage
options.
- 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
setItem
andgetItem
. Read more about interceptors.
- #2: Getting an error when retrieving nonexistent item from
cookieStorage
WebStorage
instances 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
length
to theWebStorage
instances.
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) : void
setItem (key: string, value: any, expires: number, path: string) : void
- Added the static method
WebStorage.interceptors()
- Added
eslint-config-google
. - Added
eslint-loader
to webpack. - Added
clean-webpack-plugin
to webpack.
- Added webpack as module bundler
- Webpack outputs the library as UMD module (global:
proxyStorage
)