New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@internetarchive/collection-name-cache

Package Overview
Dependencies
Maintainers
17
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.2.7-alpha.1 to 0.2.7-alpha.2

8

dist/src/collection-name-cache.d.ts

@@ -22,2 +22,8 @@ import type { SearchServiceInterface } from '@internetarchive/search-service';

preloadIdentifiers(identifiers: string[]): Promise<void>;
/**
* Adds known identifier-title mappings to the cache.
*
* @param identifierTitleMap
*/
addKnownTitles(identifierTitleMap: Record<string, string>): void;
}

@@ -36,2 +42,4 @@ export declare class CollectionNameCache implements CollectionNameCacheInterface {

preloadIdentifiers(identifiers: string[]): Promise<void>;
/** @inheritdoc */
addKnownTitles(identifierTitleMap: Record<string, string>): void;
private pendingIdentifierQueue;

@@ -38,0 +46,0 @@ private pendingPromises;

@@ -66,2 +66,12 @@ export class CollectionNameCache {

}
/** @inheritdoc */
addKnownTitles(identifierTitleMap) {
Object.entries(identifierTitleMap).forEach(([identifier, title]) => {
const lowercaseIdentifier = identifier.toLowerCase();
this.collectionNameCache[lowercaseIdentifier] = {
name: title,
lastAccess: Date.now(),
};
});
}
async startPendingIdentifierTimer() {

@@ -68,0 +78,0 @@ if (this.fetchTimeout)

2

package.json

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

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

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

@@ -26,2 +26,9 @@ /* eslint-disable camelcase */

preloadIdentifiers(identifiers: string[]): Promise<void>;
/**
* Adds known identifier-title mappings to the cache.
*
* @param identifierTitleMap
*/
addKnownTitles(identifierTitleMap: Record<string, string>): void;
}

@@ -96,2 +103,13 @@

/** @inheritdoc */
addKnownTitles(identifierTitleMap: Record<string, string>): void {
Object.entries(identifierTitleMap).forEach(([identifier, title]) => {
const lowercaseIdentifier = identifier.toLowerCase();
this.collectionNameCache[lowercaseIdentifier] = {
name: title,
lastAccess: Date.now(),
};
});
}
private pendingIdentifierQueue: Set<string> = new Set<string>();

@@ -98,0 +116,0 @@

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