Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

lru-cache

Package Overview
Dependencies
Maintainers
1
Versions
143
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lru-cache - npm Package Compare versions

Comparing version 7.1.2 to 7.1.3

15

index.js

@@ -114,2 +114,3 @@ const perf = typeof performance === 'object' && performance &&

}
this.keyMap = new Map()

@@ -216,3 +217,3 @@ this.keyList = new Array(max).fill(null)

while (this.calculatedSize > maxSize) {
this.evict()
this.evict(true)
}

@@ -395,3 +396,3 @@ this.calculatedSize += this.sizes[index]

if (this.size === this.max) {
return this.evict()
return this.evict(false)
}

@@ -408,3 +409,3 @@ if (this.free.length !== 0) {

const val = this.valList[this.head]
this.evict()
this.evict(true)
return val

@@ -414,3 +415,3 @@ }

evict () {
evict (free) {
const head = this.head

@@ -420,2 +421,8 @@ const k = this.keyList[head]

this.removeItemSize(head)
// if we aren't about to use the index, then null these out
if (free) {
this.keyList[head] = null
this.valList[head] = null
this.free.push(head)
}
this.head = this.next[head]

@@ -422,0 +429,0 @@ this.keyMap.delete(k)

{
"name": "lru-cache",
"description": "A cache object that deletes the least-recently-used items.",
"version": "7.1.2",
"version": "7.1.3",
"publishConfig": {

@@ -25,3 +25,4 @@ "tag": "v7.1-backport"

"benchmark": "^2.1.4",
"tap": "^15.1.6"
"heapdump": "^0.3.15",
"tap": "^16.0.1"
},

@@ -36,4 +37,7 @@ "license": "ISC",

"tap": {
"coverage-map": "map.js"
"coverage-map": "map.js",
"node-arg": [
"--expose-gc"
]
}
}
SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc