🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

ocache

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ocache - npm Package Compare versions

Comparing version
0.1.3
to
0.1.4
+6
-3
dist/index.mjs

@@ -91,10 +91,12 @@ import { hash } from "ohash";

let entry = {};
let hitIndex = -1;
try {
for (const base of bases) {
for (let i = 0; i < bases.length; i++) {
const result = await useStorage().get(_buildCacheKey(key, {
group,
name
}, base));
}, bases[i]));
if (result) {
entry = result;
hitIndex = i;
break;

@@ -150,5 +152,6 @@ }

} else setOpts = { ttl: opts.maxAge };
const writeBases = hitIndex < 0 ? bases : bases.slice(0, hitIndex + 1);
const promise = (async () => {
try {
await Promise.all(bases.map((b) => useStorage().set(_buildCacheKey(key, {
await Promise.all(writeBases.map((b) => useStorage().set(_buildCacheKey(key, {
group,

@@ -155,0 +158,0 @@ name

{
"name": "ocache",
"version": "0.1.3",
"version": "0.1.4",
"description": "Standalone caching utilities with TTL, SWR, and HTTP response caching",

@@ -5,0 +5,0 @@ "license": "MIT",