From f6f40fdf7afecf1cd3e5abe99bd54cc3fa9a1eb3 Mon Sep 17 00:00:00 2001 From: Daniel Nalborczyk Date: Sat, 23 Jul 2022 22:55:32 -0400 Subject: [PATCH] refactor: remove #getEnv --- src/lambda/LambdaFunction.js | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/src/lambda/LambdaFunction.js b/src/lambda/LambdaFunction.js index 2b9f6c6cb..d8e7fc350 100644 --- a/src/lambda/LambdaFunction.js +++ b/src/lambda/LambdaFunction.js @@ -92,11 +92,12 @@ export default class LambdaFunction { this.#verifySupportedRuntime() - const env = this.#getEnv( - provider.environment, - functionDefinition.environment, - handler, - ) + const env = { + ...this.#getAwsEnvVars(handler), + ...provider.environment, + ...functionDefinition.environment, + IS_OFFLINE: 'true', + } this.#artifact = functionDefinition.package?.artifact @@ -194,15 +195,6 @@ export default class LambdaFunction { } } - #getEnv(providerEnv, functionDefinitionEnv, handler) { - return { - ...this.#getAwsEnvVars(handler), - ...providerEnv, - ...functionDefinitionEnv, - IS_OFFLINE: 'true', - } - } - setClientContext(clientContext) { this.#clientContext = clientContext }