@polargold/pg-frontend-core
    Preparing search index...

    Function isStorageAvailable

    • 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.

      Parameters

      • type: "localStorage" | "sessionStorage"

      Returns boolean