|
2 | 2 |
|
3 | 3 | const metasync = require('metasync'); |
4 | 4 |
|
5 | | -const async = op => { |
| 5 | +const async = (op) => { |
6 | 6 | switch (op) { |
7 | | - case 'map': return metasync.map; |
8 | | - case 'filter': return metasync.filter; |
9 | | - case 'reduce': return metasync.reduce; |
10 | | - case 'each': return metasync.each; |
11 | | - case 'series': return metasync.series; |
12 | | - case 'find': return metasync.find; |
| 7 | + case 'map': return metasync.map; |
| 8 | + case 'filter': return metasync.filter; |
| 9 | + case 'reduce': return metasync.reduce; |
| 10 | + case 'each': return metasync.each; |
| 11 | + case 'series': return metasync.series; |
| 12 | + case 'find': return metasync.find; |
13 | 13 | } |
14 | 14 | }; |
15 | 15 |
|
@@ -44,20 +44,20 @@ ArrayChain.prototype.execute = function(err) { |
44 | 44 | }; |
45 | 45 |
|
46 | 46 | ['then', 'catch', 'map', 'filter', 'reduce', 'each', 'series', 'find'] |
47 | | - .map(op => { |
| 47 | + .map((op) => { |
48 | 48 | ArrayChain.prototype[op] = function(fn) { |
49 | 49 | this.chain.push({ op, fn }); |
50 | 50 | return this; |
51 | 51 | }; |
52 | 52 | }); |
53 | 53 |
|
54 | 54 | ArrayChain.prototype.fetch = function(fn) { |
55 | | - this.chain.push({ op: 'then', fn: res => fn(null, res) }); |
| 55 | + this.chain.push({ op: 'then', fn: (res) => fn(null, res) }); |
56 | 56 | this.chain.push({ op: 'catch', fn }); |
57 | 57 | this.execute(); |
58 | 58 | return this; |
59 | 59 | }; |
60 | 60 |
|
61 | 61 | module.exports = { |
62 | | - for: array => new ArrayChain(array) |
| 62 | + for: (array) => new ArrayChain(array) |
63 | 63 | }; |
0 commit comments