Skip to content

Commit 8443f69

Browse files
Update dependencies
1 parent deb4923 commit 8443f69

File tree

4 files changed

+388
-340
lines changed

4 files changed

+388
-340
lines changed

.prettierrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"semi": false,
3+
"singleQuote": true,
4+
"trailingComma": "es5"
5+
}

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@
1717
],
1818
"dependencies": {
1919
"potrace": "2.1.8",
20-
"sharp": "0.28.1"
20+
"sharp": "0.29.3"
2121
},
2222
"devDependencies": {
23-
"@ava/babel": "1.0.1",
23+
"@ava/babel": "2.0.0",
2424
"ava": "3.15.0"
2525
},
2626
"ava": {

test.js

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,37 @@
1-
import test from "ava";
2-
import path from "path";
3-
const fs = require("fs");
4-
const outlineStroke = require("./");
1+
import test from 'ava'
2+
const fs = require('fs')
3+
const outlineStroke = require('./')
54

65
const src = `
7-
<svg xmlns="http://www.w3.org/2000/svg" width="506.3" height="506.3" viewBox="0 0 506.3 506.3"><g fill="none" stroke="#202020" stroke-width="16.333" stroke-miterlimit="10"><path d="M122.5 122.5h375.7v375.7H122.5z"/><path d="M122.5 383.8H8.2V8.2h375.6v114.3M310.3 204.2v212.3M416.5 310.3H204.2"/></g></svg>`;
6+
<svg xmlns="http://www.w3.org/2000/svg" width="506.3" height="506.3" viewBox="0 0 506.3 506.3"><g fill="none" stroke="#202020" stroke-width="16.333" stroke-miterlimit="10"><path d="M122.5 122.5h375.7v375.7H122.5z"/><path d="M122.5 383.8H8.2V8.2h375.6v114.3M310.3 204.2v212.3M416.5 310.3H204.2"/></g></svg>`
87

98
const expected = `<svg xmlns="http://www.w3.org/2000/svg" width="506" height="506" viewBox="0 0 506 506" version="1.1">
109
<path d="M 0 196 L 0 392 57 392 L 114 392 114 449 L 114 506 309.835 506 L 505.671 506 506.335 419.750 C 506.700 372.313, 506.890 258.350, 506.758 166.500 C 506.625 74.650, 506.397 25.263, 506.250 56.750 L 505.984 114 448.992 114 L 392 114 392 57 L 392 0 196 0 L 0 0 0 196 M 0.490 196.500 C 0.490 304.300, 0.607 348.252, 0.750 294.170 C 0.893 240.089, 0.893 151.889, 0.750 98.170 C 0.607 44.452, 0.490 88.700, 0.490 196.500 M 16.667 16.667 C 16.300 17.033, 16 97.808, 16 196.167 L 16 375 65 375 L 114 375 114 244.500 L 114 114 244.500 114 L 375 114 375 65 L 375 16 196.167 16 C 97.808 16, 17.033 16.300, 16.667 16.667 M 131 310.500 L 131 490 310.500 490 L 490 490 490 310.500 L 490 131 310.500 131 L 131 131 131 310.500 M 302 253 L 302 302 253 302 L 204 302 204 310 L 204 318 253 318 L 302 318 302 367 L 302 416 310 416 L 318 416 318 367 L 318 318 367 318 L 416 318 416 310 L 416 302 367 302 L 318 302 318 253 L 318 204 310 204 L 302 204 302 253" stroke="none" fill="black" fill-rule="evenodd"/>
11-
</svg>`;
10+
</svg>`
1211

1312
const expectedWithParams = `<svg xmlns="http://www.w3.org/2000/svg" width="506" height="506" viewBox="0 0 506 506" version="1.1">
1413
<rect x="0" y="0" width="100%" height="100%" fill="#a1a5a5" />
1514
<path d="M 0 196 L 0 392 57 392 L 114 392 114 449 L 114 506 309.835 506 L 505.671 506 506.335 419.750 C 506.700 372.313, 506.890 258.350, 506.758 166.500 C 506.625 74.650, 506.397 25.263, 506.250 56.750 L 505.984 114 448.992 114 L 392 114 392 57 L 392 0 196 0 L 0 0 0 196 M 0.490 196.500 C 0.490 304.300, 0.607 348.252, 0.750 294.170 C 0.893 240.089, 0.893 151.889, 0.750 98.170 C 0.607 44.452, 0.490 88.700, 0.490 196.500 M 16.667 16.667 C 16.300 17.033, 16 97.808, 16 196.167 L 16 375 65 375 L 114 375 114 244.500 L 114 114 244.500 114 L 375 114 375 65 L 375 16 196.167 16 C 97.808 16, 17.033 16.300, 16.667 16.667 M 131 310.500 L 131 490 310.500 490 L 490 490 490 310.500 L 490 131 310.500 131 L 131 131 131 310.500 M 302 253 L 302 302 253 302 L 204 302 204 310 L 204 318 253 318 L 302 318 302 367 L 302 416 310 416 L 318 416 318 367 L 318 318 367 318 L 416 318 416 310 L 416 302 367 302 L 318 302 318 253 L 318 204 310 204 L 302 204 302 253" stroke="none" fill="#bada55" fill-rule="evenodd"/>
16-
</svg>`;
15+
</svg>`
1716

18-
test("Converts from string", async (t) => {
19-
const res = await outlineStroke(src);
20-
t.is(res, expected);
21-
});
17+
test('Converts from string', async (t) => {
18+
const res = await outlineStroke(src)
19+
t.is(res, expected)
20+
})
2221

23-
test.cb("Converts from Buffer", (t) => {
24-
fs.readFile("./src.svg", (err, data) => {
22+
test.cb('Converts from Buffer', (t) => {
23+
fs.readFile('./src.svg', (err, data) => {
2524
outlineStroke(data).then((res) => {
26-
t.is(res, expected);
27-
t.end();
28-
});
29-
});
30-
});
25+
t.is(res, expected)
26+
t.end()
27+
})
28+
})
29+
})
3130

32-
test("Apply params (color)", async (t) => {
31+
test('Apply params (color)', async (t) => {
3332
const res = await outlineStroke(src, {
34-
color: "#bada55",
35-
background: "#a1a5a5",
36-
});
37-
t.is(res, expectedWithParams);
38-
});
33+
color: '#bada55',
34+
background: '#a1a5a5',
35+
})
36+
t.is(res, expectedWithParams)
37+
})

0 commit comments

Comments
 (0)