Skip to content

Commit

Permalink
Simplify, use destructuring and default parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
dnalborczyk committed Jan 12, 2020
1 parent 80bf2a5 commit 18d8457
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/ServerlessOffline.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,10 +212,13 @@ export default class ServerlessOffline {
}

_mergeOptions() {
const { service } = this.#serverless
const {
provider,
service: { custom = {} },
} = this.#serverless

// custom options
const { [CUSTOM_OPTION]: customOptions } = service.custom || {}
const customOptions = custom[CUSTOM_OPTION]

// merge options
// order of Precedence: command line options, custom options, defaults.
Expand Down Expand Up @@ -247,9 +250,7 @@ export default class ServerlessOffline {
origin: this.#options.corsAllowOrigin,
}

serverlessLog(
`Starting Offline: ${service.provider.stage}/${service.provider.region}.`,
)
serverlessLog(`Starting Offline: ${provider.stage}/${provider.region}.`)
debugLog('options:', this.#options)
}

Expand Down

0 comments on commit 18d8457

Please sign in to comment.