@@ -98,7 +98,10 @@ function getSong() {
9898}
9999
100100function singSong (_song ) {
101- if (! _song) throw new Error (" song is '' empty, FEED ME A SONG!" );
101+ if (! _song) {
102+ throw new Error (" song is '' empty, FEED ME A SONG!" );
103+ }
104+
102105 console .log (_song);
103106}
104107
@@ -128,7 +131,10 @@ function getSong() {
128131}
129132
130133function singSong (_song ) {
131- if (! _song) throw new Error (" song is '' empty, FEED ME A SONG!" );
134+ if (! _song) {
135+ throw new Error (" song is '' empty, FEED ME A SONG!" );
136+ }
137+
132138 console .log (_song);
133139}
134140
@@ -161,7 +167,10 @@ function executeFunctionWithArgs(operation, callback) {
161167}
162168
163169function serialProcedure (operation ) {
164- if (! operation) process .exit (0 ); // finished
170+ if (! operation) {
171+ process .exit (0 ); // finished
172+ }
173+
165174 executeFunctionWithArgs (operation, function (result ) {
166175 // continue AFTER callback
167176 serialProcedure (operations .shift ());
@@ -195,12 +204,20 @@ function dispatch(recipient, callback) {
195204
196205function sendOneMillionEmailsOnly () {
197206 getListOfTenMillionGreatEmails (function (err , bigList ) {
198- if (err) throw err;
207+ if (err) {
208+ throw err;
209+ }
199210
200211 function serial (recipient ) {
201- if (! recipient || successCount >= 1000000 ) return final ();
212+ if (! recipient || successCount >= 1000000 ) {
213+ return final ();
214+ }
215+
202216 dispatch (recipient, function (_err ) {
203- if (! _err) successCount += 1 ;
217+ if (! _err) {
218+ successCount += 1 ;
219+ }
220+
204221 serial (bigList .pop ());
205222 });
206223 }
@@ -241,9 +258,10 @@ function dispatch(recipient, callback) {
241258function final (result ) {
242259 console .log (` Result: ${ result .count } attempts \
243260 & ${ result .success } succeeded emails` );
244- if (result .failed .length )
261+ if (result .failed .length ) {
245262 console .log (` Failed to send to: \
246263 \n ${ result .failed .join (' \n ' )} \n ` );
264+ }
247265}
248266
249267recipients .forEach (function (recipient ) {
0 commit comments