Skip to content

Commit

Permalink
chore(lint): fix unicorn/no-negated-condition
Browse files Browse the repository at this point in the history
  • Loading branch information
dnalborczyk committed Jan 2, 2023
1 parent 016bd42 commit d151b0a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 14 deletions.
1 change: 0 additions & 1 deletion .eslintrc.cjs
Expand Up @@ -76,7 +76,6 @@ module.exports = {
'unicorn/no-array-reduce': 'off',
'unicorn/no-await-expression-member': 'off',
'unicorn/no-lonely-if': 'off',
'unicorn/no-negated-condition': 'off',
'unicorn/no-new-array': 'off',
'unicorn/no-null': 'off',
'unicorn/no-static-only-class': 'off',
Expand Down
12 changes: 6 additions & 6 deletions src/events/http/HttpServer.js
Expand Up @@ -328,9 +328,9 @@ export default class HttpServer {
'method.request.header.Authorization',
identityValidationExpression:
serverlessAuthorizerOptions?.identityValidationExpression || '(.*)',
payloadVersion: !endpoint.isHttpApi
? '1.0'
: serverlessAuthorizerOptions?.payloadVersion || '2.0',
payloadVersion: endpoint.isHttpApi
? serverlessAuthorizerOptions?.payloadVersion || '2.0'
: '1.0',
resultTtlInSeconds:
serverlessAuthorizerOptions?.resultTtlInSeconds || '300',
}
Expand Down Expand Up @@ -502,9 +502,9 @@ export default class HttpServer {
: ''

const schemas =
endpoint?.request?.schemas !== undefined
? endpoint.request.schemas[contentType]
: ''
endpoint?.request?.schemas === undefined
? ''
: endpoint.request.schemas[contentType]

// https://hapijs.com/api#route-configuration doesn't seem to support selectively parsing
// so we have to do it ourselves
Expand Down
14 changes: 7 additions & 7 deletions src/lambda/handler-runner/docker-runner/DockerContainer.js
Expand Up @@ -95,13 +95,7 @@ export default class DockerContainer {
if (this.#layers.length > 0) {
log.verbose(`Found layers, checking provider type`)

if (this.#provider.name.toLowerCase() !== 'aws') {
log.warning(
`Provider ${
this.#provider.name
} is Unsupported. Layers are only supported on aws.`,
)
} else {
if (this.#provider.name.toLowerCase() === 'aws') {
let layerDir = this.#dockerOptions.layersDir

if (!layerDir) {
Expand Down Expand Up @@ -142,6 +136,12 @@ export default class DockerContainer {
)
}
dockerArgs.push('-v', `${layerDir}:/opt:ro,delegated`)
} else {
log.warning(
`Provider ${
this.#provider.name
} is Unsupported. Layers are only supported on aws.`,
)
}
}

Expand Down

0 comments on commit d151b0a

Please sign in to comment.