Skip to content

@databases/[email protected]

Compare
Choose a tag to compare
@ForbesLindesay ForbesLindesay released this 20 Feb 13:57
66c0122

New Features

  • You can pass multiple keys to cachedFn.cache.delete(...keys) now for both dedupeAsync and dedupeSync. If the underlying cache/map accepts a ... spread parameter, the array of keys will be passed directly to the undelrying map. Otherwise .delete will be called multiple times on the underlying map. (#319)

  • A new method has been added for cachedFn.cache.deletePrefix(prefix) for both dedupeAsync and dedupeSync. (#319)

    If the map used as the cache is a MultiKeyMap, deletePrefix takes any sub-path for the key. e.g. MultiKeyMap<[string, number, string]> would result in a deletePrefix function that accepts [string] | [string, number] as the key.

    If the map used as the cache has a deletePrefix method, the prefix is passed directly to that method.

    If the keys are serialized to a string, deletePrefix accepts a string and will delete keys where the serialized value matches that string.