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

async-cache-dedupe

Package Overview
Dependencies
Maintainers
2
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

async-cache-dedupe - npm Package Compare versions

Comparing version 1.4.1 to 1.4.2

2

package.json
{
"name": "async-cache-dedupe",
"version": "1.4.1",
"version": "1.4.2",
"description": "An async deduping cache",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -283,3 +283,3 @@ 'use strict'

// clear the dedupe once done
this.dedupes.set(key, undefined)
this.dedupes.delete(key)
return result

@@ -289,3 +289,3 @@ })

this.onError(err)
this.dedupes.set(key, undefined)
this.dedupes.delete(key)
// TODO option to remove key from storage on error?

@@ -303,3 +303,3 @@ // we may want to relay on cache if the original function got error

const key = this.getKey(value)
this.dedupes.set(key, undefined)
this.dedupes.delete(key)
await this.storage.remove(this.getStorageKey(key))

@@ -306,0 +306,0 @@ return

@@ -151,3 +151,3 @@ 'use strict'

test('works with custom serialize', async (t) => {
t.plan(2)
t.plan(3)

@@ -169,2 +169,3 @@ const cache = new Cache({ storage: createStorage() })

t.same([...cache[kValues].fetchSomething.dedupes.keys()], ['42', '24'])
const res = await Promise.all([p1, p2])

@@ -177,3 +178,4 @@

t.same([...cache[kValues].fetchSomething.dedupes.keys()], ['42', '24'])
// Ensure we clean up dedupes
t.same([...cache[kValues].fetchSomething.dedupes.keys()], [])
})

@@ -180,0 +182,0 @@

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