New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

node-fetch-cache

Package Overview
Dependencies
Maintainers
1
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-fetch-cache - npm Package Compare versions

Comparing version
4.0.8
to
4.0.9
+7
-3
dist/index.cjs

@@ -336,2 +336,9 @@ 'use strict';

const ejectSelfFromCache = async () => fetchCustomization.cache.remove(cacheKey);
const cachedValue = await fetchCustomization.cache.get(cacheKey);
if (cachedValue) {
return new NFCResponse(cachedValue.bodyStream, cachedValue.metaData, ejectSelfFromCache, true);
}
if (hasOnlyIfCachedOption(resource, init)) {
return NFCResponse.cacheMissResponse(getUrlFromRequestArguments(resource));
}
return locko.doWithLock(cacheKey, async () => {

@@ -342,5 +349,2 @@ const cachedValue = await fetchCustomization.cache.get(cacheKey);

}
if (hasOnlyIfCachedOption(resource, init)) {
return NFCResponse.cacheMissResponse(getUrlFromRequestArguments(resource));
}
const fetchResponse = await fetch(resource, init);

@@ -347,0 +351,0 @@ const serializedMeta = NFCResponse.serializeMetaFromNodeFetchResponse(fetchResponse);

@@ -22,2 +22,9 @@ import fetch, { Request as NodeFetchRequest } from 'node-fetch';

const ejectSelfFromCache = async () => fetchCustomization.cache.remove(cacheKey);
const cachedValue = await fetchCustomization.cache.get(cacheKey);
if (cachedValue) {
return new NFCResponse(cachedValue.bodyStream, cachedValue.metaData, ejectSelfFromCache, true);
}
if (hasOnlyIfCachedOption(resource, init)) {
return NFCResponse.cacheMissResponse(getUrlFromRequestArguments(resource));
}
return locko.doWithLock(cacheKey, async () => {

@@ -28,5 +35,2 @@ const cachedValue = await fetchCustomization.cache.get(cacheKey);

}
if (hasOnlyIfCachedOption(resource, init)) {
return NFCResponse.cacheMissResponse(getUrlFromRequestArguments(resource));
}
const fetchResponse = await fetch(resource, init);

@@ -33,0 +37,0 @@ const serializedMeta = NFCResponse.serializeMetaFromNodeFetchResponse(fetchResponse);

{
"name": "node-fetch-cache",
"version": "4.0.8",
"version": "4.0.9",
"description": "node-fetch with caching.",

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