Skip to content

Commit d8164f2

Browse files
committed
Fix code style
1 parent 88ce7bc commit d8164f2

File tree

8 files changed

+18
-18
lines changed

8 files changed

+18
-18
lines changed

JavaScript/1-catch.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ const sum = (a, b) => new Promise((resolve, reject) => {
99
});
1010

1111
sum(7, 'A')
12-
.then(data => {
12+
.then((data) => {
1313
console.log({ data });
1414
})
15-
.catch(err => {
15+
.catch((err) => {
1616
console.log({ message: err.message });
1717
});

JavaScript/2-then.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,22 @@ const sum = (a, b) => new Promise((resolve, reject) => {
1010

1111
sum(7, 'A')
1212
.then(
13-
data => {
13+
(data) => {
1414
console.log({ data });
1515
},
16-
err => {
16+
(err) => {
1717
console.log({ messageThen: err.message });
1818
throw new Error('Oh, no!');
1919
}
2020
)
21-
.catch(err => {
21+
.catch((err) => {
2222
console.log({ messageCatch1: err.message });
2323
throw new Error('Oh, noo!');
2424
})
25-
.then(() => {}, err => {
25+
.then(() => {}, (err) => {
2626
console.log({ messageThen2: err.message });
2727
throw new Error('Oh, nooo!');
2828
})
29-
.catch(err => {
29+
.catch((err) => {
3030
console.log({ messageCatch2: err.message });
3131
});

JavaScript/3-finally.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ const sum = (a, b) => new Promise((resolve, reject) => {
99
});
1010

1111
sum(7, 'A')
12-
.then(data => {
12+
.then((data) => {
1313
console.log({ data });
1414
})
15-
.catch(err => {
15+
.catch((err) => {
1616
console.log({ messageCatch: err.message });
1717
})
1818
.finally(() => {

JavaScript/4-unhandled.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const sum = (a, b) => new Promise((resolve, reject) => {
99
});
1010

1111
sum(7, 'A')
12-
.then(data => {
12+
.then((data) => {
1313
console.log({ data });
1414
});
1515

JavaScript/5-warning.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ const sum = (a, b) => new Promise((resolve, reject) => {
88
}
99
});
1010

11-
process.on('warning', warning => {
11+
process.on('warning', (warning) => {
1212
console.log({ warning });
1313
});
1414

1515
sum(7, 'A')
16-
.then(data => {
16+
.then((data) => {
1717
console.log(data);
1818
});

JavaScript/6-intercepted.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ process.on('unhandledRejection', (reason, promise) => {
1313
});
1414

1515
sum(7, 'A')
16-
.then(data => {
16+
.then((data) => {
1717
console.log({ data });
1818
});

JavaScript/7-handled.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,21 @@ process.on('unhandledRejection', (reason, promise) => {
1212
console.log({ unhandledRejection: { reason, promise } });
1313
});
1414

15-
process.on('rejectionHandled', promise => {
15+
process.on('rejectionHandled', (promise) => {
1616
console.log({ rejectionHandled: { promise } });
1717
});
1818

1919
const p1 = sum(7, 'A')
20-
.then(data => {
20+
.then((data) => {
2121
console.log(data);
2222
});
2323

24-
p1.catch(err => {
24+
p1.catch((err) => {
2525
console.log({ catch1: err });
2626
});
2727

2828
setTimeout(() => {
29-
p1.catch(err => {
29+
p1.catch((err) => {
3030
console.log({ catch2: err });
3131
});
3232
}, 0);

JavaScript/8-multiple.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ process.on('multipleResolves', (type, promise, reason) => {
1313
});
1414

1515
sum(7, 3)
16-
.then(res1 => {
16+
.then((res1) => {
1717
console.log({ res1 });
1818
});

0 commit comments

Comments
 (0)