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" 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; };