@earth-app/collegedb
    Preparing search index...

    Class InMemoryKVStorage

    In-memory implementation of KVStorage.

    Implements every method on the contract plus a few NuxtHub-flavored aliases (set, del, keys, getItem, setItem, removeItem, getKeys) so the same instance can be wrapped by createNuxtHubKVProvider without any additional adapter glue.

    Implements

    Index
    • Drops every entry from the store. Test utility only — production implementations should not expose this affordance.

      Returns void

    • Retrieves a value by key. When type is json, the value should be parsed.

      Type Parameters

      • T = unknown

      Parameters

      • key: string
      • type: "json"

      Returns Promise<T | null>

    • Parameters

      • key: string
      • Optionaltype: "text"

      Returns Promise<string | null>

    • Type Parameters

      • T = unknown

      Parameters

      • key: string

      Returns Promise<T | null>

    • Parameters

      • prefix: string = ''

      Returns Promise<string[]>

    • Lists keys, optionally filtered by prefix.

      Parameters

      • Optionaloptions: { cursor?: string; limit?: number; prefix?: string }

      Returns Promise<KVListResult>

    • Stores a value by key.

      Parameters

      • key: string
      • value: string
      • Optionaloptions: { expirationTtl?: number }

      Returns Promise<void>

    • Parameters

      • key: string
      • value: unknown
      • Optionaloptions: { ttl?: number }

      Returns Promise<void>

    • Parameters

      • key: string
      • value: unknown

      Returns Promise<void>

    • Returns the number of non-expired entries currently in the store. Useful for asserting on cleanup behavior in tests.

      Returns number