Skip to content

Commit

Permalink
use starsWith instead of indexOf (#545)
Browse files Browse the repository at this point in the history
It is better to use startsWith.
  • Loading branch information
abetomo authored Dec 9, 2020
1 parent f27f628 commit ef3504b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,7 @@ they may not work as expected in the Lambda environment.
}

_getStartingPosition (eventSource) {
if (eventSource.EventSourceArn.indexOf('arn:aws:sqs:') === 0) {
if (eventSource.EventSourceArn.startsWith('arn:aws:sqs:')) {
return null
}
return eventSource.StartingPosition ? eventSource.StartingPosition : 'LATEST'
Expand Down

0 comments on commit ef3504b

Please sign in to comment.