From 6fe1820833a441006e414e246770665bc315c35b Mon Sep 17 00:00:00 2001 From: Sparticuz Date: Thu, 16 Nov 2023 12:44:56 -0500 Subject: [PATCH] use contains on AWS_EXECUTION_ENV --- source/helper.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/helper.ts b/source/helper.ts index 76dc716..c7fe1c8 100644 --- a/source/helper.ts +++ b/source/helper.ts @@ -40,8 +40,8 @@ export const isRunningInAwsLambda = () => { export const isRunningInAwsLambdaNode20 = () => { if ( - process.env["AWS_LAMBDA_JS_RUNTIME"] && - /^nodejs20.x/.test(process.env["AWS_LAMBDA_JS_RUNTIME"]) === true + process.env["AWS_EXECUTION_ENV"] && + process.env["AWS_EXECUTION_ENV"].contains("nodejs20.x") ) { return true; }