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

@internetarchive/collection-name-cache

Package Overview
Dependencies
Maintainers
15
Versions
96
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@internetarchive/collection-name-cache - npm Package Compare versions

Comparing version 0.0.1-alpha.2 to 0.0.1-alpha.3

9

dist/src/collection-name-cache.js

@@ -12,3 +12,3 @@ /* eslint-disable camelcase */

this.defaultLoadInterval = 250; // ms
this.pendingIdentifierQueue = [];
this.pendingIdentifierQueue = new Set();
this.pendingPromises = {};

@@ -42,3 +42,3 @@ this.collectionNameCache = {};

var _a;
this.pendingIdentifierQueue.push(lowercaseIdentifier);
this.pendingIdentifierQueue.add(lowercaseIdentifier);
const currentPromises = (_a = this.pendingPromises[lowercaseIdentifier]) !== null && _a !== void 0 ? _a : [];

@@ -60,3 +60,3 @@ const resultHandler = async (name) => {

continue;
this.pendingIdentifierQueue.push(identifier);
this.pendingIdentifierQueue.add(identifier);
}

@@ -77,3 +77,3 @@ await this.loadPendingIdentifiers();

await this.loadFromCache();
const pendingIdentifiers = this.pendingIdentifierQueue.splice(0, 100);
const pendingIdentifiers = Array.from(this.pendingIdentifierQueue).splice(0, 100);
if (pendingIdentifiers.length === 0)

@@ -102,2 +102,3 @@ return;

};
this.pendingIdentifierQueue.delete(lowercaseIdentifier);
const currentPromises = this.pendingPromises[lowercaseIdentifier];

@@ -104,0 +105,0 @@ if (currentPromises) {

@@ -10,3 +10,3 @@ {

"author": "Internet Archive",
"version": "0.0.1-alpha.2",
"version": "0.0.1-alpha.3",
"main": "dist/index.js",

@@ -13,0 +13,0 @@ "module": "dist/index.js",

@@ -65,3 +65,3 @@ /* eslint-disable camelcase */

return new Promise(resolve => {
this.pendingIdentifierQueue.push(lowercaseIdentifier);
this.pendingIdentifierQueue.add(lowercaseIdentifier);
const currentPromises = this.pendingPromises[lowercaseIdentifier] ?? [];

@@ -86,3 +86,3 @@ const resultHandler: CollectionNameResolver = async (

if (this.collectionNameCache[identifier]) continue;
this.pendingIdentifierQueue.push(identifier);
this.pendingIdentifierQueue.add(identifier);
}

@@ -92,3 +92,3 @@ await this.loadPendingIdentifiers();

private pendingIdentifierQueue: string[] = [];
private pendingIdentifierQueue: Set<string> = new Set<string>();

@@ -141,3 +141,6 @@ private pendingPromises: { [identifier: string]: CollectionNameResolver[] } =

await this.loadFromCache();
const pendingIdentifiers = this.pendingIdentifierQueue.splice(0, 100);
const pendingIdentifiers = Array.from(this.pendingIdentifierQueue).splice(
0,
100
);
if (pendingIdentifiers.length === 0) return;

@@ -170,2 +173,3 @@

};
this.pendingIdentifierQueue.delete(lowercaseIdentifier);
const currentPromises = this.pendingPromises[lowercaseIdentifier];

@@ -172,0 +176,0 @@ if (currentPromises) {

Sorry, the diff of this file is not supported yet

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