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.2 to 0.2.7-alpha.3

7

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

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

/**
* Adds known identifier-title mappings to the cache.
* Adds a set of known identifier-title mappings to the cache,
* without sending a request for them.
*
* @param identifierTitleMap
*/
addKnownTitles(identifierTitleMap: Record<string, string>): void;
addKnownTitles(identifierTitleMap: Record<string, string>): Promise<void>;
}

@@ -43,3 +44,3 @@ export declare class CollectionNameCache implements CollectionNameCacheInterface {

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

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

@@ -67,3 +67,5 @@ export class CollectionNameCache {

/** @inheritdoc */
addKnownTitles(identifierTitleMap) {
async addKnownTitles(identifierTitleMap) {
if (!this.cacheLoaded)
await this.loadFromCache();
Object.entries(identifierTitleMap).forEach(([identifier, title]) => {

@@ -76,2 +78,3 @@ const lowercaseIdentifier = identifier.toLowerCase();

});
await this.persistCache();
}

@@ -78,0 +81,0 @@ async startPendingIdentifierTimer() {

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

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

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

@@ -28,7 +28,8 @@ /* eslint-disable camelcase */

/**
* Adds known identifier-title mappings to the cache.
* Adds a set of known identifier-title mappings to the cache,
* without sending a request for them.
*
* @param identifierTitleMap
*/
addKnownTitles(identifierTitleMap: Record<string, string>): void;
addKnownTitles(identifierTitleMap: Record<string, string>): Promise<void>;
}

@@ -104,3 +105,4 @@

/** @inheritdoc */
addKnownTitles(identifierTitleMap: Record<string, string>): void {
async addKnownTitles(identifierTitleMap: Record<string, string>): Promise<void> {
if (!this.cacheLoaded) await this.loadFromCache();
Object.entries(identifierTitleMap).forEach(([identifier, title]) => {

@@ -113,2 +115,4 @@ const lowercaseIdentifier = identifier.toLowerCase();

});
await this.persistCache();
}

@@ -115,0 +119,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