Skip to content

Commit

Permalink
refactor: use private methods (#1425)
Browse files Browse the repository at this point in the history
  • Loading branch information
dnalborczyk authored May 18, 2022
1 parent a332dbf commit f04e57c
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/events/http/Http.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ export default class Http {
return this.#httpServer.stop(timeout)
}

_create(functionKey, rawHttpEventDefinition, handler) {
#createEvent(functionKey, rawHttpEventDefinition, handler) {
const httpEvent = new HttpEventDefinition(rawHttpEventDefinition)

this.#httpServer.createRoutes(functionKey, httpEvent, handler)
}

create(events) {
events.forEach(({ functionKey, handler, http }) => {
this._create(functionKey, http, handler)
this.#createEvent(functionKey, http, handler)
})

this.#httpServer.writeRoutesTerminal()
Expand Down
4 changes: 2 additions & 2 deletions src/events/websocket/WebSocket.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export default class WebSocket {
])
}

_create(functionKey, rawWebSocketEventDefinition) {
#createEvent(functionKey, rawWebSocketEventDefinition) {
const webSocketEvent = new WebSocketEventDefinition(
rawWebSocketEventDefinition,
)
Expand All @@ -58,7 +58,7 @@ export default class WebSocket {

create(events) {
events.forEach(({ functionKey, websocket }) => {
this._create(functionKey, websocket)
this.#createEvent(functionKey, websocket)
})
}
}
4 changes: 2 additions & 2 deletions src/lambda/Lambda.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ export default class Lambda {
)
}

_create(functionKey, functionDefinition) {
#createEvent(functionKey, functionDefinition) {
this.#lambdas.set(functionKey, functionDefinition)
this.#lambdaFunctionNamesKeys.set(functionDefinition.name, functionKey)
}

create(lambdas) {
lambdas.forEach(({ functionKey, functionDefinition }) => {
this._create(functionKey, functionDefinition)
this.#createEvent(functionKey, functionDefinition)
})
}

Expand Down
2 changes: 1 addition & 1 deletion src/lambda/handler-runner/go-runner/GoRunner.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ export default class GoRunner {
// refresh go.mod
sync('go', ['mod', 'tidy'])
chdir(this.#codeDir)
} catch (e) {
} catch {
// @ignore
}

Expand Down

0 comments on commit f04e57c

Please sign in to comment.