@@ -69,11 +69,11 @@ var defaultConfig = {
6969exports . parseEvent = function ( data ) {
7070 // Validate characteristics of a SES event record.
7171 if ( ! data . event ||
72- ! data . event . hasOwnProperty ( 'Records' ) ||
73- data . event . Records . length !== 1 ||
74- ! data . event . Records [ 0 ] . hasOwnProperty ( 'eventSource' ) ||
75- data . event . Records [ 0 ] . eventSource !== 'aws:ses' ||
76- data . event . Records [ 0 ] . eventVersion !== '1.0' ) {
72+ ! Object . hasOwn ( data . event , 'Records' ) ||
73+ data . event . Records . length !== 1 ||
74+ ! Object . hasOwn ( data . event . Records [ 0 ] , 'eventSource' ) ||
75+ data . event . Records [ 0 ] . eventSource !== 'aws:ses' ||
76+ data . event . Records [ 0 ] . eventVersion !== '1.0' ) {
7777 data . log ( {
7878 message : "parseEvent() received invalid SES message:" ,
7979 level : "error" , event : JSON . stringify ( data . event )
@@ -101,7 +101,7 @@ exports.transformRecipients = function(data) {
101101 if ( data . config . allowPlusSign ) {
102102 origEmailKey = origEmailKey . replace ( / \+ .* ?@ / , '@' ) ;
103103 }
104- if ( data . config . forwardMapping . hasOwnProperty ( origEmailKey ) ) {
104+ if ( Object . hasOwn ( data . config . forwardMapping , origEmailKey ) ) {
105105 newRecipients = newRecipients . concat (
106106 data . config . forwardMapping [ origEmailKey ] ) ;
107107 data . originalRecipient = origEmail ;
@@ -116,16 +116,16 @@ exports.transformRecipients = function(data) {
116116 origEmailUser = origEmailKey . slice ( 0 , pos ) ;
117117 }
118118 if ( origEmailDomain &&
119- data . config . forwardMapping . hasOwnProperty ( origEmailDomain ) ) {
119+ Object . hasOwn ( data . config . forwardMapping , origEmailDomain ) ) {
120120 newRecipients = newRecipients . concat (
121121 data . config . forwardMapping [ origEmailDomain ] ) ;
122122 data . originalRecipient = origEmail ;
123123 } else if ( origEmailUser &&
124- data . config . forwardMapping . hasOwnProperty ( origEmailUser ) ) {
124+ Object . hasOwn ( data . config . forwardMapping , origEmailUser ) ) {
125125 newRecipients = newRecipients . concat (
126126 data . config . forwardMapping [ origEmailUser ] ) ;
127127 data . originalRecipient = origEmail ;
128- } else if ( data . config . forwardMapping . hasOwnProperty ( "@" ) ) {
128+ } else if ( Object . hasOwn ( data . config . forwardMapping , "@" ) ) {
129129 newRecipients = newRecipients . concat (
130130 data . config . forwardMapping [ "@" ] ) ;
131131 data . originalRecipient = origEmail ;
@@ -337,13 +337,13 @@ exports.sendMessage = function(data) {
337337 */
338338exports . handler = function ( event , context , callback , overrides ) {
339339 var steps = overrides && overrides . steps ? overrides . steps :
340- [
341- exports . parseEvent ,
342- exports . transformRecipients ,
343- exports . fetchMessage ,
344- exports . processMessage ,
345- exports . sendMessage
346- ] ;
340+ [
341+ exports . parseEvent ,
342+ exports . transformRecipients ,
343+ exports . fetchMessage ,
344+ exports . processMessage ,
345+ exports . sendMessage
346+ ] ;
347347 var data = {
348348 event : event ,
349349 callback : callback ,
0 commit comments