Skip to content

Commit

Permalink
refactor: use destructuring
Browse files Browse the repository at this point in the history
  • Loading branch information
dnalborczyk committed May 31, 2022
1 parent 0914e7a commit f8c6533
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions tests/manual/websocket/RouteSelection/handler.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict'

const AWS = require('aws-sdk')
const { ApiGatewayManagementApi } = require('aws-sdk')

const { parse, stringify } = JSON

Expand All @@ -23,7 +23,7 @@ function newAWSApiGatewayManagementApi(event) {
const endpoint = `${event.requestContext.domainName}/${event.requestContext.stage}`
const apiVersion = '2018-11-29'

return new AWS.ApiGatewayManagementApi({ apiVersion, endpoint })
return new ApiGatewayManagementApi({ apiVersion, endpoint })
}

exports.echo = async function echo(event, context) {
Expand Down
8 changes: 4 additions & 4 deletions tests/manual/websocket/main/handler.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
'use strict'

const { env } = require('node:process')
const AWS = require('aws-sdk')
const { ApiGatewayManagementApi, DynamoDB } = require('aws-sdk')

const { parse, stringify } = JSON

const ddb = (() => {
if (env.IS_OFFLINE)
return new AWS.DynamoDB.DocumentClient({
return new DynamoDB.DocumentClient({
endpoint: 'http://localhost:8000',
region: 'localhost',
})

return new AWS.DynamoDB.DocumentClient()
return new DynamoDB.DocumentClient()
})()

const successfullResponse = {
Expand All @@ -34,7 +34,7 @@ function newAWSApiGatewayManagementApi(event) {
const endpoint = `${event.requestContext.domainName}/${event.requestContext.stage}`
const apiVersion = '2018-11-29'

return new AWS.ApiGatewayManagementApi({ apiVersion, endpoint })
return new ApiGatewayManagementApi({ apiVersion, endpoint })
}

exports.connect = async function connect(event, context) {
Expand Down

0 comments on commit f8c6533

Please sign in to comment.