The current inspect will put the entire contents of its key/value set onto the screen, causing voluminous dump and/or hiding the end of the contents, and makes it harder to examine its internals. This makes all the LRU classes inherit the method properly; tastefully limits the output while showing both the head and tail; and has an all: true trap door to get a shallow copy of the cache as a POJO.
LRUCache and family .inspect limits its output -- showing the youngest items, and ellipsis, and the oldest item. Options allow dumping the raw object or controlling the size of output (and the number of items a console.log will mindlessly iterate over).
LRUCache and family all have inspect wired up to the magic 'nodejs.util.inspect.custom' symbol property that drives console.log output
LRUCache and family all have a summaryString method returning eg 'LRUCache[8/200]' for a cache with size 8 and capacity 200, wired to the magic Symbol.toStringTag property that drives string interpolation (partially addresses #129).
The current inspect will put the entire contents of its key/value set onto the screen, causing voluminous dump and/or hiding the end of the contents, and makes it harder to examine its internals. This makes all the LRU classes inherit the method properly; tastefully limits the output while showing both the head and tail; and has an
all: true
trap door to get a shallow copy of the cache as a POJO.