Skip to content
Myr

refactor(aws-lambda): Object.hasOwn is recommended (#2831)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Refer. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwn

authored by TATSUNO “Taz” Yasuhiro · committed by GitHub · parent dfbc6c4 · Browse files · 1 file+2 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+2 added−2 removed

  • other:+2 added−2 removed

1 file+2 added−2 removed

modified:src/adapter/aws-lambda/handler.ts+2 added-2 removed
471 unmodified lines
472 return v1Processor473}474475const isProxyEventALB = (event: LambdaEvent): event is ALBProxyEvent => {476 return Object.prototype.hasOwnProperty.call(event.requestContext, 'elb')476 return Object.hasOwn(event.requestContext, 'elb')477}478479const isProxyEventV2 = (event: LambdaEvent): event is APIGatewayProxyEventV2 => {480 return Object.prototype.hasOwnProperty.call(event, 'rawPath')480 return Object.hasOwn(event, 'rawPath')481}482483export const isContentTypeBinary = (contentType: string) => {484 return !/^(text\/(plain|html|css|javascript|csv).*|application\/(.*json|.*xml).*|image\/svg\+xml.*)$/.test(
10 unmodified lines