From 7c333430bd9c4d9873433b1d051adbdbee290355 Mon Sep 17 00:00:00 2001 From: Sparticuz Date: Fri, 5 May 2023 14:34:10 -0400 Subject: [PATCH 1/2] add netlify env check --- source/helper.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/source/helper.ts b/source/helper.ts index 1e9d2e1..97cc36d 100644 --- a/source/helper.ts +++ b/source/helper.ts @@ -19,7 +19,9 @@ export const isValidUrl = (input: string) => { /** * Determines if the running instance is inside an AWS Lambda container. - * @returns + * AWS_EXECUTION_ENV is for native Lambda instances + * AWS_LAMBDA_JS_RUNTIME is for netlify instances + * @returns boolean indicating if the running instance is inside a Lambda container */ export const isRunningInAwsLambda = () => { if ( @@ -27,6 +29,11 @@ export const isRunningInAwsLambda = () => { /^AWS_Lambda_nodejs/.test(process.env["AWS_EXECUTION_ENV"]) === true ) { return true; + } else if ( + process.env["AWS_LAMBDA_JS_RUNTIME"] && + /^nodejs/.test(process.env["AWS_LAMBDA_JS_RUNTIME"]) === true + ) { + return true; } return false; }; From 3b51330eebb0847c1814ff1f96b3f025a1b23319 Mon Sep 17 00:00:00 2001 From: Sparticuz Date: Fri, 5 May 2023 14:36:19 -0400 Subject: [PATCH 2/2] Update deps --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0895a48..8e78b4f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,7 +16,7 @@ "@tsconfig/node16": "^1.0.3", "@tsconfig/strictest": "^2.0.1", "@types/follow-redirects": "^1.14.1", - "@types/node": "^18.16.3", + "@types/node": "^18.16.4", "@types/tar-fs": "^2.0.1", "clean-modules": "^2.0.6", "typescript": "^5.0.4" @@ -47,9 +47,9 @@ } }, "node_modules/@types/node": { - "version": "18.16.3", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.16.3.tgz", - "integrity": "sha512-OPs5WnnT1xkCBiuQrZA4+YAV4HEJejmHneyraIaxsbev5yCEr6KMwINNFP9wQeFIw8FWcoTqF3vQsa5CDaI+8Q==", + "version": "18.16.4", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.16.4.tgz", + "integrity": "sha512-LUhvPmAKAbgm+p/K11IWszLZVoZDlMF4NRmqbhEzDz/CnCuehPkZXwZbBCKGJsgjnuVejotBwM7B3Scrq4EqDw==", "dev": true }, "node_modules/@types/tar-fs": { diff --git a/package.json b/package.json index bcbbc4c..a825a82 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,7 @@ "@tsconfig/node16": "^1.0.3", "@tsconfig/strictest": "^2.0.1", "@types/follow-redirects": "^1.14.1", - "@types/node": "^18.16.3", + "@types/node": "^18.16.4", "@types/tar-fs": "^2.0.1", "clean-modules": "^2.0.6", "typescript": "^5.0.4"