Socket
Socket
Sign inDemoInstall

@middy/util

Package Overview
Dependencies
Maintainers
3
Versions
133
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@middy/util - npm Package Compare versions

Comparing version 4.5.5 to 4.6.0

9

index.js

@@ -79,3 +79,4 @@ export const createPrefetchClient = (options)=>{

export const processCache = (options, fetch = ()=>undefined, request)=>{
const { cacheExpiry, cacheKey } = options;
let { cacheKey, cacheKeyExpiry, cacheExpiry } = options;
cacheExpiry = cacheKeyExpiry?.[cacheKey] ?? cacheExpiry;
if (cacheExpiry) {

@@ -103,5 +104,7 @@ const cached = getCache(cacheKey);

const value = fetch(request);
const expiry = Date.now() + cacheExpiry;
const now = Date.now();
const expiry = cacheExpiry > 86400000 ? cacheExpiry : now + cacheExpiry;
const duration = cacheExpiry > 86400000 ? cacheExpiry - now : cacheExpiry;
if (cacheExpiry) {
const refresh = cacheExpiry > 0 ? setInterval(()=>processCache(options, fetch, request), cacheExpiry) : undefined;
const refresh = duration > 0 ? setInterval(()=>processCache(options, fetch, request), duration) : undefined;
cache[cacheKey] = {

@@ -108,0 +111,0 @@ value,

{
"name": "@middy/util",
"version": "4.5.5",
"version": "4.6.0",
"description": "🛵 The stylish Node.js middleware engine for AWS Lambda (util package)",

@@ -64,3 +64,3 @@ "type": "module",

"@aws-sdk/client-ssm": "^3.0.0",
"@middy/core": "4.5.5",
"@middy/core": "4.6.0",
"@types/aws-lambda": "^8.10.76",

@@ -75,3 +75,3 @@ "@types/node": "^20.0.0",

},
"gitHead": "e8458a63a1b10932c30556cd8e2bdc4775858d0b"
"gitHead": "34e52521a81a224e3d97de6171604c49e676f0d4"
}

Sorry, the diff of this file is not supported yet

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