Skip to content

Commit 0773f8f

Browse files
committedOct 18, 2017
Code style tweaks
1 parent c1d97c3 commit 0773f8f

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed
 

‎readme.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -43,17 +43,17 @@ parsePng(fs.readFileSync('unicorn.png')).then(png => {
4343

4444
### parsePng(buffer, [options])
4545

46-
Returns a promise for a PNG instance. See the [pngjs documentation](https://github.com/lukeapage/pngjs#async-api) for more information.
46+
Returns a `Promise` for a PNG instance. See the [pngjs documentation](https://github.com/lukeapage/pngjs#async-api) for more information.
4747

4848
#### buffer
4949

50-
Type: `buffer`
50+
Type: `Buffer`
5151

5252
A PNG image buffer.
5353

5454
#### options
5555

56-
Type: `object`
56+
Type: `Object`
5757

5858
See the [pngjs options](https://github.com/lukeapage/pngjs#options).
5959

‎test.js

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,28 @@
11
import fs from 'fs';
22
import fileType from 'file-type';
33
import getStream from 'get-stream';
4-
import pify from 'pify';
54
import test from 'ava';
65
import m from '.';
76

87
test('parse', async t => {
9-
const data = await m(await pify(fs.readFile)('./fixture.png'));
8+
const data = await m(fs.readFileSync('./fixture.png'));
109
t.is(data.width, 200);
1110
t.is(data.height, 133);
1211
t.is(data.depth, 8);
1312
t.true(Buffer.isBuffer(data.data));
1413
});
1514

1615
test('pack', async t => {
17-
const png = await m(await pify(fs.readFile)('./fixture.png'));
16+
const png = await m(fs.readFileSync('./fixture.png'));
1817
t.deepEqual(fileType(await getStream.buffer(png.pack())), {ext: 'png', mime: 'image/png'});
1918
});
2019

2120
test('parse interlaced png', async t => {
22-
const data = await m(await pify(fs.readFile)('./fixture-interlaced.png'));
21+
const data = await m(fs.readFileSync('./fixture-interlaced.png'));
2322
t.true(data.interlace);
2423
});
2524

2625
test('pack interlaced png', async t => {
27-
const png = await m(await pify(fs.readFile)('./fixture-interlaced.png'));
26+
const png = await m(fs.readFileSync('./fixture-interlaced.png'));
2827
t.deepEqual(fileType(await getStream.buffer(png.pack())), {ext: 'png', mime: 'image/png'});
2928
});

0 commit comments

Comments
 (0)
Please sign in to comment.