From ef3504ba08c5a0abd315086e07671dabe723a048 Mon Sep 17 00:00:00 2001 From: Tomoaki Abe Date: Thu, 10 Dec 2020 00:58:22 +0900 Subject: [PATCH] use starsWith instead of indexOf (#545) It is better to use startsWith. --- lib/main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/main.js b/lib/main.js index 383b9dfd..c17baf2e 100644 --- a/lib/main.js +++ b/lib/main.js @@ -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'