Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • Props

Index

Properties

delimiter?: string

the delimiter used to separate keys in the recent list

default

"\0"

fallback?: boolean

if true, use a memory-backed fallback store, if a check test of localStorage fails

localStorage?: Storage

only used for testing

maxSize?: number

how many most recently used keys are tracked – i.e. the number of tracked recently used objects.

default

64

parseExistingJSON?: boolean

if true, attempt to parse already existing JSON in localStorage

recentKey?: string

the key used to store the list of recently used keys

typePrefixDelimiter?: string

a common string delimiting the type prefix and the value, could be an empty string.

default

"\0"

typePrefixes?: TypePrefixes

custom type prefixes

Methods

  • deserializer(ser: string): any
  • corresponding to serializer custom de-serializer

    default

    JSON.parse

    Parameters

    • ser: string

    Returns any

  • isCandidate(key: string, recent: string[]): boolean
  • A function preventing certain keys from being removed – i.e. only if it returns true, that key is a candidate for removal. Use it to prevent keys from being removed if they are "more important" than others.

    Parameters

    • key: string
    • recent: string[]

    Returns boolean

  • serializer(data: any): string
  • bring your own custom object serializer – must have corresponding a counterpart deserializer

    default

    JSON.stringify

    Parameters

    • data: any

    Returns string

Generated using TypeDoc