@consumidor-positivo/ts-utils - v1.35.1
    Preparing search index...

    Type Alias SafeStorage

    A storage wrapper whose methods never throw. Mirrors the subset of the Web Storage API used most often.

    type SafeStorage = {
        clear: () => void;
        getItem: (key: string) => string | null;
        removeItem: (key: string) => void;
        setItem: (key: string, value: string) => void;
    }
    Index

    Properties

    clear: () => void

    Clears all keys, silently doing nothing when storage is unavailable.

    getItem: (key: string) => string | null

    Reads a key, returning null when the value is absent or storage is unavailable.

    removeItem: (key: string) => void

    Removes a key, silently doing nothing when storage is unavailable.

    setItem: (key: string, value: string) => void

    Writes a key, silently doing nothing when storage is unavailable.