@middy/util
Advanced tools
Comparing version 2.0.0-alpha.0 to 2.0.0-alpha.1
14
index.js
@@ -0,1 +1,3 @@ | ||
"use strict"; | ||
const { | ||
@@ -57,3 +59,3 @@ Agent | ||
const canPrefetch = options => { | ||
return !options?.awsClientAssumeRole && !options?.disablePrefetch; | ||
return !(options !== null && options !== void 0 && options.awsClientAssumeRole) && !(options !== null && options !== void 0 && options.disablePrefetch); | ||
}; // Internal Context | ||
@@ -81,2 +83,4 @@ | ||
for (const internalKey of values) { | ||
var _valuePromise; | ||
// 'internal.key.sub_value' -> { [key]: internal.key.sub_value } | ||
@@ -87,7 +91,7 @@ const pathOptionKey = internalKey.split('.'); | ||
if (typeof valuePromise?.then !== 'function') { | ||
if (typeof ((_valuePromise = valuePromise) === null || _valuePromise === void 0 ? void 0 : _valuePromise.then) !== 'function') { | ||
valuePromise = Promise.resolve(valuePromise); | ||
} | ||
promises.push(valuePromise.then(value => pathOptionKey.reduce((p, c) => p?.[c], value))); | ||
promises.push(valuePromise.then(value => pathOptionKey.reduce((p, c) => p === null || p === void 0 ? void 0 : p[c], value))); | ||
} // ensure promise has resolved by the time it's needed | ||
@@ -136,3 +140,5 @@ // If one of the promises throws it will bubble up to @middy/core | ||
const clearCache = (keys = null) => { | ||
keys = keys ?? Object.keys(cache); | ||
var _keys; | ||
keys = (_keys = keys) !== null && _keys !== void 0 ? _keys : Object.keys(cache); | ||
if (!Array.isArray(keys)) keys = [keys]; | ||
@@ -139,0 +145,0 @@ |
{ | ||
"name": "@middy/util", | ||
"version": "2.0.0-alpha.0", | ||
"version": "2.0.0-alpha.1", | ||
"description": "🛵 The stylish Node.js middleware engine for AWS Lambda (util package)", | ||
@@ -15,2 +15,3 @@ "type": "commonjs", | ||
"types": "index.d.ts", | ||
"files": [], | ||
"scripts": { | ||
@@ -45,3 +46,3 @@ "test": "npm run test:typings && npm run test:unit", | ||
"homepage": "https://github.com/middyjs/middy#readme", | ||
"gitHead": "e047c0d3db00aa11b39f2d3e193458ea021a58a0" | ||
"gitHead": "f8b0f418477cdbff47da693963bf1ea918b39d04" | ||
} |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
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
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
0
3
8521
4
129