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

    Class LocalStorage

    Namespaced wrapper around window.localStorage.

    Replaces the app-level StorageHelper class duplicated across luv-autoq-frontend, ama-deep, data-sheet-portal and bws-checkout-service-spa, and folds in LocalStorageError's typed reason field (previously only available via the separate useLocalStorage composable in luv-ui-tools/bws-ui-tools).

    Behavior change vs. the ported StorageHelper: write() here only rejects undefined, not every falsy value. The original StorageHelper.write() used if (!value) throw ..., which also rejected 0, false and "" - a latent bug (confirmed by the app-level test suite explicitly asserting write(0) throws). This class instead matches the already-correct useLocalStorage composable's contract, so storing e.g. a numeric filter value of 0 or a boolean flag of false no longer incorrectly throws.

    Index
    key: string
    • Clears the entire localStorage, not just this instance's own key - matches the ported StorageHelper.clear() behavior exactly.

      Returns void