Checks whether a given Web Storage (localStorage/sessionStorage) is
actually available and writable - false in private-browsing modes that
disable storage, or once quota is exhausted.
Ported from dspace-relaunch's storageAvailable (itself adapted from the
MDN reference implementation) - found unused there during the frontend
tooling audit, but a genuinely useful guard to have alongside LocalStorage
in this package, since nothing currently protects against constructing one
in an environment where storage doesn't work.
Checks whether a given Web Storage (
localStorage/sessionStorage) is actually available and writable -falsein private-browsing modes that disable storage, or once quota is exhausted.Ported from
dspace-relaunch'sstorageAvailable(itself adapted from the MDN reference implementation) - found unused there during the frontend tooling audit, but a genuinely useful guard to have alongsideLocalStoragein this package, since nothing currently protects against constructing one in an environment where storage doesn't work.