Repository navigation
Releases
Releases · alexrqs/whateverStorage
v1.2.1
Changed
- Linting and formatting migrated from ESLint (airbnb-base) + Prettier to Ultracite on Biome.
npm run lintnow runsultracite check; a newlint:fixscript applies fixes. Config lives inbiome.jsonc(single quotes and no semicolons preserved). - Source and tests reformatted to the Ultracite style, with small behavior-neutral refactors to satisfy its rules: bare
catchfor unused error bindings,for...ofinstead offorEach/spread-accumulatingreduceincookieJar, hoisted regex inparseTimeUnit,Date.now()in tests, alphabetized object keys.
No changes to the published API.
Full changelog: v1.2.0...v1.2.1
v1.2.0
Added
- Test suite for
cookieJar,parseExpireDate,parseTimeUnitand the storage wrapper (ava). - Named export
whateverStoragefactory alongside the default export, so custom storage backends can be wrapped. db.cookie.removeItem(key, { domain, path })now accepts the same options assetItem.- README: API notes, expires format documentation, badges and license section.
- CHANGELOG.md.
Changed
- Source split into testable modules.
- Cookie values are now URI-encoded, so values containing
;or=survive the round trip. - Cookies no longer force
domain=window.location.hostnameby default; omittingdomaincreates a host-only cookie (and no longer crashes outside a browser). - All development dependencies modernized: Babel 7 stable, ava 6, eslint 8 + airbnb-base 15, prettier 3. Removed unused husky/pretty-quick and obsolete babel-preset-primavera.
prepublishscript replaced withprepublishOnly; addedlintscript.- package.json metadata fixed: license corrected to MIT (matching the LICENSE file), description, keywords, author, repository and
fileswhitelist added.
Fixed
db.cookie.clear()never removed cookies: it destructured the first character of each cookie string instead of the cookie name.db.cookie.getItem()threwSyntaxErrorfor missing cookies — it now returnsnull.db.cookie.getItem()threw on non-JSON cookies set by other code — the raw value is now returned as-is.db.cookie.removeItem()omitted the cookiepath, so browsers often failed to actually delete the cookie.- Invalid
expiresstrings (e.g.'banana') produced anInvalid Datecookie expiry — they now fall back to the 1 minute default. parseTimeUnitreturned the wrong duration for uppercase plurals (e.g.'DAYS').getItemon local/session storage no longer throws when the stored value is not valid JSON.
Note: version 1.1.2 was staged in package.json but never published or tagged; its work (tests, module split, parser optimization) is included in this release.
Full changelog: v1.1.1...v1.2.0