Name: lru-ts
Owner: Wire Swiss GmbH
Description: LRU cache in TypeScript, adapted from https://github.com/rsms/js-lru
Forked from: TrueLink/lru-ts
Created: 2016-10-28 11:35:47.0
Updated: 2017-10-07 16:31:59.0
Pushed: 2017-02-09 14:24:33.0
Homepage: null
Size: 38
Language: TypeScript
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
This module is deprecated. Please use wire-webapp-lru-cache.
LRU cache in TypeScript, adapted from https://github.com/TrueLink/lru-ts
--p tsconfig.node.json
rt LRUCache from "lru-ts";
cache: LRUCache = new LRUCache(123);
c = new LRUCache(3);
t('adam', 29);
t('john', 26);
t('angela', 24);
String(); // -> "adam:29 < john:26 < angela:24"
t('john'); // -> 26
ow 'john' is the most recently used entry, since we just requested it
String(); // -> "adam:29 < angela:24 < john:26"
t('zorro', 141); // -> {key:adam, value:29}
ecause we only have room for 3 entries, put-ing 'zorro' purged 'adam'
String(); // -> "angela:24 < john:26 < zorro:141"