- Generate minified versions for ESM and CommonJS exported bubdles.
- Replace Mocha with Jest as testing framework.
- Replace Travis CI with Github actions.
-
driver
option in initialization configuration is now of typeString
and available values can be "localStorage" or "sessionStorage".In version 1.x it used to be the
localStorage
orsessionStorage
object which resulted in throwing exception if Storage was not available due to privacy settings (eg. some browsers disable cookies and storage). See issue #2.As of version 2.x the library internally checks if Storage is available and fallbacks to
noop
storage otherwise.v1.x.x
WebStorage.createInstance({ driver: window.localStorage })
v2.x.x
WebStorage.createInstance({ driver: 'localStorage' })
-
WebStorage.isAvailable
static method, as of v2.x, accepts "localStorage" or "sessionStorage" strings as arguments. -
On initialization the library throws if
driver
option is anything other than "localStorage" or "sessionStorage" and ifkeyPrefix
option is not of typeString
.
- Keep
devDependencies
up to date.
- Replace
Webpack
withRollup
for bundling the library.
- Add static method
WebStorage.createInstance([options])
as an alternative way to create a new instance.
- Initial realease