remove regex

This commit is contained in:
Sparticuz 2023-11-16 12:52:30 -05:00
parent c683d75545
commit fc6b69d653
1 changed files with 3 additions and 3 deletions

View File

@ -26,12 +26,12 @@ export const isValidUrl = (input: string) => {
export const isRunningInAwsLambda = () => { export const isRunningInAwsLambda = () => {
if ( if (
process.env["AWS_EXECUTION_ENV"] && process.env["AWS_EXECUTION_ENV"] &&
/^AWS_Lambda_nodejs/.test(process.env["AWS_EXECUTION_ENV"]) === true process.env["AWS_EXECUTION_ENV"].includes("AWS_Lambda_nodejs")
) { ) {
return true; return true;
} else if ( } else if (
process.env["AWS_LAMBDA_JS_RUNTIME"] && process.env["AWS_LAMBDA_JS_RUNTIME"] &&
/^nodejs/.test(process.env["AWS_LAMBDA_JS_RUNTIME"]) === true process.env["AWS_LAMBDA_JS_RUNTIME"].includes("nodejs")
) { ) {
return true; return true;
} }
@ -41,7 +41,7 @@ export const isRunningInAwsLambda = () => {
export const isRunningInAwsLambdaNode20 = () => { export const isRunningInAwsLambdaNode20 = () => {
if ( if (
process.env["AWS_EXECUTION_ENV"] && process.env["AWS_EXECUTION_ENV"] &&
process.env["AWS_EXECUTION_ENV"].includes("nodejs20.x") process.env["AWS_EXECUTION_ENV"].includes("20.x")
) { ) {
return true; return true;
} }