Merge pull request #98 from Sparticuz/fix/netlify
This commit is contained in:
commit
b21fdacfc3
|
|
@ -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": {
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue