Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit e638d91

Browse files
Fix code style
1 parent a82f4d4 commit e638d91

File tree

6 files changed

+11
-11
lines changed

6 files changed

+11
-11
lines changed

‎JavaScript/6-do-maybe.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ const { Just } = require('./helpers/maybe');
44

55
const doMonad = require('./helpers/do-notation');
66

7-
Just(5).then(x => (
7+
Just(5).then((x) => (
88
Just(x + 3)
9-
).then(x => (
9+
).then((x) => (
1010
Just(x * 4)
1111
)).then(console.log));
1212

‎JavaScript/8-catch-promise.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ doMonad(function* () {
1212
const data = yield getJSON(baseUrl + resource);
1313
console.log(data);
1414
}
15-
}).catch(err => {
15+
}).catch((err) => {
1616
console.log(err);
1717
});

‎JavaScript/a-generator.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class Multiplier {
3232

3333
* genMethod(a) {
3434
yield this.value;
35-
this.value =this.value* a;
35+
this.value *= a;
3636
return this.value;
3737
}
3838
}
@@ -47,7 +47,7 @@ const m2 = {
4747

4848
* genMethod(a) {
4949
yield this.value;
50-
this.value =this.value* a;
50+
this.value *= a;
5151
return this.value;
5252
}
5353
};

‎JavaScript/helpers/do-notation.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
'use strict';
22

3-
module.exports = generator => {
3+
module.exports = (generator) => {
44
const sequence = generator();
55

6-
const step = value => {
6+
const step = (value) => {
77
const result = sequence.next(value);
88
if (result.done) return result.value;
99
return result.value.then(step);

‎JavaScript/helpers/get-json.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
const http = require('http');
44

5-
module.exports = url => new Promise((resolve, reject) => {
6-
http.get(url, res => {
5+
module.exports = (url) => new Promise((resolve, reject) => {
6+
http.get(url, (res) => {
77
const code = res.statusCode;
88
if (code !== 200) {
99
reject(new Error(`HTTP status code ${code}`));
@@ -13,7 +13,7 @@ module.exports = url => new Promise((resolve, reject) => {
1313
res.on('error', reject);
1414

1515
const chunks = [];
16-
res.on('data', chunk => {
16+
res.on('data', (chunk) => {
1717
chunks.push(chunk);
1818
});
1919

‎JavaScript/helpers/server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ const server = http.createServer((req, res) => {
4040
return;
4141
}
4242

43-
handler(req, result => {
43+
handler(req, (result) => {
4444
const json = JSON.stringify(result);
4545
res.writeHead(200, { 'Content-Type': 'application/json' });
4646
res.end(json);

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /