Socket
Socket
Sign inDemoInstall

quick-lru

Package Overview
Dependencies
0
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 6.0.2 to 6.1.0

2

index.d.ts

@@ -27,3 +27,3 @@ export interface Options<KeyType, ValueType> {

export default class QuickLRU<KeyType, ValueType> implements Iterable<[KeyType, ValueType]> {
export default class QuickLRU<KeyType, ValueType> extends Map implements Iterable<[KeyType, ValueType]> {
/**

@@ -30,0 +30,0 @@ The stored item count.

@@ -1,3 +0,5 @@

export default class QuickLRU {
export default class QuickLRU extends Map {
constructor(options = {}) {
super();
if (!(options.maxSize && options.maxSize > 0)) {

@@ -265,2 +267,16 @@ throw new TypeError('`maxSize` must be a number greater than 0');

}
entries() {
return this.entriesAscending();
}
forEach(callbackFunction, thisArgument = this) {
for (const [key, value] of this.entriesAscending()) {
callbackFunction.call(thisArgument, value, key, this);
}
}
[Symbol.toStringTag]() {
return JSON.stringify([...this.entriesAscending()]);
}
}
{
"name": "quick-lru",
"version": "6.0.2",
"version": "6.1.0",
"description": "Simple “Least Recently Used” (LRU) cache",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -37,2 +37,4 @@ # quick-lru [![Coverage Status](https://codecov.io/gh/sindresorhus/quick-lru/branch/main/graph/badge.svg)](https://codecov.io/gh/sindresorhus/quick-lru/branch/main)

It's a [`Map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) subclass.
### options

@@ -126,2 +128,14 @@

#### .entries()
Iterable for all entries, starting with the newest (ascending in recency).
**This method exists for `Map` compatibility. Prefer [.entriesAscending()](#entriesascending) instead.**
#### .forEach(callbackFunction, thisArgument)
Loop over entries calling the `callbackFunction` for each entry (ascending in recency).
**This method exists for `Map` compatibility. Prefer [.entriesAscending()](#entriesascending) instead.**
#### .size

@@ -128,0 +142,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc