Skip to content

Commit 432ccb9

Browse files
phatedactions-user
authored andcommitted
chore: Run prettier
1 parent bf4ba5a commit 432ccb9

File tree

3 files changed

+52
-42
lines changed

3 files changed

+52
-42
lines changed

README.md

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -21,27 +21,33 @@ Will run call the function on `nextTick`. This will cause all functions to be as
2121
```js
2222
var asyncSettle = require('async-settle');
2323

24-
asyncSettle(function(done){
25-
// do async things
26-
done(null, 2);
27-
}, function(error, result){
28-
// `error` will ALWAYS be null on execution of the first function.
29-
// `result` will ALWAYS be a settled object with the result or error of the first function.
30-
});
24+
asyncSettle(
25+
function (done) {
26+
// do async things
27+
done(null, 2);
28+
},
29+
function (error, result) {
30+
// `error` will ALWAYS be null on execution of the first function.
31+
// `result` will ALWAYS be a settled object with the result or error of the first function.
32+
}
33+
);
3134
```
3235

3336
### Failed completion
3437

3538
```js
3639
var asyncSettle = require('async-settle');
3740

38-
asyncSettle(function(done){
39-
// do async things
40-
done(new Error('Some Error Occurred'));
41-
}, function(error, result){
42-
// `error` will ALWAYS be null on execution of the first function.
43-
// `result` will ALWAYS be a settled object with the result or error of the first function.
44-
});
41+
asyncSettle(
42+
function (done) {
43+
// do async things
44+
done(new Error('Some Error Occurred'));
45+
},
46+
function (error, result) {
47+
// `error` will ALWAYS be null on execution of the first function.
48+
// `result` will ALWAYS be a settled object with the result or error of the first function.
49+
}
50+
);
4551
```
4652

4753
## API
@@ -76,7 +82,6 @@ Settled values have two properties, `state` and `value`.
7682

7783
MIT
7884

79-
8085
<!-- prettier-ignore-start -->
8186
[downloads-image]: https://img.shields.io/npm/dm/async-settle.svg?style=flat-square
8287
[npm-url]: https://www.npmjs.com/package/async-settle

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
var asyncDone = require('async-done');
44

55
function settle(fn, done) {
6-
asyncDone(fn, function(error, result) {
6+
asyncDone(fn, function (error, result) {
77
var settled = {};
88

99
if (error != null) {

test/index.js

Lines changed: 31 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4,35 +4,40 @@ var expect = require('expect');
44

55
var settle = require('../');
66

7-
describe('asyncSettle', function() {
8-
9-
it('should transform success into settled success values', function(done) {
7+
describe('asyncSettle', function () {
8+
it('should transform success into settled success values', function (done) {
109
var val = 'value to be settled';
11-
settle(function(done) {
12-
done(null, val);
13-
}, function(err, result) {
14-
expect(result).toEqual(
15-
expect.objectContaining({
16-
state: 'success',
17-
value: val,
18-
})
19-
);
20-
done(err);
21-
});
10+
settle(
11+
function (done) {
12+
done(null, val);
13+
},
14+
function (err, result) {
15+
expect(result).toEqual(
16+
expect.objectContaining({
17+
state: 'success',
18+
value: val,
19+
})
20+
);
21+
done(err);
22+
}
23+
);
2224
});
2325

24-
it('should transform errors into settled success values', function(done) {
26+
it('should transform errors into settled success values', function (done) {
2527
var error = new Error('Error to be settled');
26-
settle(function(done) {
27-
done(error);
28-
}, function(err, result) {
29-
expect(result).toEqual(
30-
expect.objectContaining({
31-
state: 'error',
32-
value: error,
33-
})
34-
);
35-
done(err);
36-
});
28+
settle(
29+
function (done) {
30+
done(error);
31+
},
32+
function (err, result) {
33+
expect(result).toEqual(
34+
expect.objectContaining({
35+
state: 'error',
36+
value: error,
37+
})
38+
);
39+
done(err);
40+
}
41+
);
3742
});
3843
});

0 commit comments

Comments
 (0)