Skip to content

Commit

Permalink
refactor: use nullish coalescing
Browse files Browse the repository at this point in the history
  • Loading branch information
dnalborczyk committed Oct 4, 2023
1 parent 0879436 commit 04d8cfb
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/lambda/LambdaFunction.js
Expand Up @@ -71,7 +71,7 @@ export default class LambdaFunction {
// TEMP options.location, for compatibility with serverless-webpack:
// https://github.com/dherault/serverless-offline/issues/787
// TODO FIXME look into better way to work with serverless-webpack
const servicepath = resolve(servicePath, options.location || '')
const servicepath = resolve(servicePath, options.location ?? '')

const { handler, name, package: functionPackage = {} } = functionDefinition

Expand All @@ -81,20 +81,20 @@ export default class LambdaFunction {
this.#handler = handler

this.#memorySize =
functionDefinition.memorySize ||
provider.memorySize ||
functionDefinition.memorySize ??
provider.memorySize ??
DEFAULT_LAMBDA_MEMORY_SIZE

this.#noTimeout = options.noTimeout

this.#region = provider.region

this.#runtime =
functionDefinition.runtime || provider.runtime || DEFAULT_LAMBDA_RUNTIME
functionDefinition.runtime ?? provider.runtime ?? DEFAULT_LAMBDA_RUNTIME

this.#timeout =
(functionDefinition.timeout ||
provider.timeout ||
(functionDefinition.timeout ??
provider.timeout ??
DEFAULT_LAMBDA_TIMEOUT) * 1000

this.#verifySupportedRuntime()
Expand Down

0 comments on commit 04d8cfb

Please sign in to comment.