@middy/util
Advanced tools
Comparing version 2.0.0-alpha.4 to 2.0.0-alpha.5
12
index.js
@@ -116,3 +116,5 @@ "use strict"; | ||
if (cached && (cache.expiry >= Date.now() || options.cacheExpiry < 0)) { | ||
return cached.value; | ||
return { ...cached, | ||
cache: true | ||
}; | ||
} | ||
@@ -122,2 +124,3 @@ } | ||
const value = fetch(handler); | ||
const expiry = Date.now() + options.cacheExpiry; | ||
@@ -127,7 +130,10 @@ if (options.cacheExpiry) { | ||
value, | ||
expiry: Date.now() + options.cacheExpiry | ||
expiry | ||
}; | ||
} | ||
return value; | ||
return { | ||
value, | ||
expiry | ||
}; | ||
}; | ||
@@ -134,0 +140,0 @@ |
{ | ||
"name": "@middy/util", | ||
"version": "2.0.0-alpha.4", | ||
"version": "2.0.0-alpha.5", | ||
"description": "🛵 The stylish Node.js middleware engine for AWS Lambda (util package)", | ||
@@ -47,3 +47,3 @@ "type": "commonjs", | ||
"homepage": "https://github.com/middyjs/middy#readme", | ||
"gitHead": "b8e513464499578c28b154327be8d710324a5a16" | ||
"gitHead": "2e69ea2322abcdcf88adde11fda4d04e4c038b54" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8606
135