Skip to content

Commit 1f5258c

Browse files
committed
chore: Update dependencies
Signed-off-by: Richie Bendall <[email protected]>
1 parent f336a8d commit 1f5258c

File tree

6 files changed

+4430
-64
lines changed

6 files changed

+4430
-64
lines changed

.travis.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
language: node_js
22
node_js:
3-
- "8"
4-
- "10"
5-
- "12"
3+
- "lts/*"
64
- "node"
75
script:
6+
- npm run lint
87
- npm run coverage
98
cache:
109
directories:

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ fetch-blob
77
[![coverage status][codecov-image]][codecov-url]
88
[![install size][install-size-image]][install-size-url]
99

10-
A Blob implementation on node.js, originally from node-fetch
10+
A Blob implementation in Node.js, originally from node-fetch.
1111

1212
## Usage
1313

blob.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
// Based on https://github.com/tmpvar/jsdom/blob/aa85b2abf07766ff7bf5c1f6daafb3726f2f2db5/lib/jsdom/living/blob.js
22
// (MIT licensed)
33

4-
const Stream = require('stream');
5-
6-
// Fix for "Readable" isn't a named export issue
7-
const {Readable} = Stream;
4+
const {Readable} = require('stream');
85

96
const BUFFER = Symbol('buffer');
107
const TYPE = Symbol('type');

package.json

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,34 @@
11
{
22
"name": "fetch-blob",
33
"version": "1.0.5",
4-
"description": "A Blob implementation on node.js, originally from node-fetch",
4+
"description": "A Blob implementation in Node.js, originally from node-fetch.",
55
"main": "blob.js",
66
"scripts": {
7-
"test": "ava",
7+
"lint": "xo",
8+
"test": "xo && ava",
89
"report": "nyc ava",
910
"coverage": "nyc --reporter json --reporter text ava && codecov -f coverage/coverage-final.json"
1011
},
11-
"repository": {
12-
"type": "git",
13-
"url": "git+https://github.com/bitinn/fetch-blob.git"
14-
},
12+
"repository": "https://github.com/node-fetch/fetch-blob.git",
1513
"keywords": [
1614
"blob",
1715
"node-fetch"
1816
],
17+
"engines": {
18+
"node": ">=6"
19+
},
1920
"author": "David Frank",
2021
"license": "MIT",
2122
"bugs": {
22-
"url": "https://github.com/bitinn/fetch-blob/issues"
23+
"url": "https://github.com/node-fetch/fetch-blob/issues"
2324
},
24-
"homepage": "https://github.com/bitinn/fetch-blob#readme",
25+
"homepage": "https://github.com/node-fetch/fetch-blob#readme",
2526
"devDependencies": {
26-
"ava": "^1.4.1",
27+
"ava": "^3.3.0",
2728
"codecov": "^3.6.1",
2829
"get-stream": "^5.1.0",
2930
"node-fetch": "^2.6.0",
30-
"nyc": "^14.1.1"
31+
"nyc": "^15.0.0",
32+
"xo": "^0.26.0"
3133
}
3234
}

test.js

Lines changed: 40 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,87 +1,81 @@
1-
2-
import test from 'ava';
3-
import Blob from './blob';
4-
import util from 'util';
5-
import stream from 'stream';
6-
import getStream from 'get-stream';
7-
import { Response } from 'node-fetch';
8-
9-
const TextDecoder = util.TextDecoder;
10-
const Readable = stream.Readable;
1+
const test = require('ava');
2+
const Blob = require('./blob');
3+
const getStream = require('get-stream');
4+
const {Response} = require('node-fetch');
115

126
test('Blob ctor', t => {
13-
let data = 'a=1';
14-
let blob = new Blob([data]);
7+
const data = 'a=1';
8+
const blob = new Blob([data]); // eslint-disable-line no-unused-vars
159
t.pass();
1610
});
1711

1812
test('Blob size', t => {
19-
let data = 'a=1';
20-
let blob = new Blob([data]);
13+
const data = 'a=1';
14+
const blob = new Blob([data]);
2115
t.is(blob.size, data.length);
2216
});
2317

2418
test('Blob type', t => {
25-
let data = 'a=1';
26-
let type = 'text/plain';
27-
let blob = new Blob([data], { type });
19+
const data = 'a=1';
20+
const type = 'text/plain';
21+
const blob = new Blob([data], {type});
2822
t.is(blob.type, type);
2923
});
3024

3125
test('Blob text()', async t => {
32-
let data = 'a=1';
33-
let type = 'text/plain';
34-
let blob = new Blob([data], { type });
26+
const data = 'a=1';
27+
const type = 'text/plain';
28+
const blob = new Blob([data], {type});
3529
t.is(await blob.text(), data);
3630
});
3731

3832
test('Blob arrayBuffer()', async t => {
39-
let data = 'a=1';
40-
let type = 'text/plain';
41-
let blob = new Blob([data], { type });
33+
const data = 'a=1';
34+
const type = 'text/plain';
35+
const blob = new Blob([data], {type});
4236

43-
let decoder = new TextDecoder('utf-8');
44-
let buffer = await blob.arrayBuffer();
37+
const decoder = new TextDecoder('utf-8');
38+
const buffer = await blob.arrayBuffer();
4539
t.is(decoder.decode(buffer), data);
4640
});
4741

4842
test('Blob stream()', async t => {
49-
let data = 'a=1';
50-
let type = 'text/plain';
51-
let blob = new Blob([data], { type });
52-
let result = await getStream(blob.stream());
43+
const data = 'a=1';
44+
const type = 'text/plain';
45+
const blob = new Blob([data], {type});
46+
const result = await getStream(blob.stream());
5347
t.is(result, data);
5448
});
5549

5650
test('Blob toString()', t => {
57-
let data = 'a=1';
58-
let type = 'text/plain';
59-
let blob = new Blob([data], { type });
51+
const data = 'a=1';
52+
const type = 'text/plain';
53+
const blob = new Blob([data], {type});
6054
t.is(blob.toString(), '[object Blob]');
6155
});
6256

6357
test('Blob slice()', async t => {
64-
let data = 'a=1';
65-
let type = 'text/plain';
66-
let blob = new Blob([data], { type });
67-
let blob2 = blob.slice(0, 1);
58+
const data = 'a=1';
59+
const type = 'text/plain';
60+
const blob = new Blob([data], {type});
61+
const blob2 = blob.slice(0, 1);
6862
t.is(await blob2.text(), data.slice(0, 1));
6963
});
7064

7165
test('Blob works with node-fetch Response.blob()', async t => {
72-
let data = 'a=1';
73-
let type = 'text/plain';
74-
let blob = new Blob([data], { type });
75-
let res = new Response(blob);
76-
let blob2 = await res.blob();
66+
const data = 'a=1';
67+
const type = 'text/plain';
68+
const blob = new Blob([data], {type});
69+
const res = new Response(blob);
70+
const blob2 = await res.blob();
7771
t.is(await blob2.text(), data);
7872
});
7973

8074
test('Blob works with node-fetch Response.text()', async t => {
81-
let data = 'a=1';
82-
let type = 'text/plain';
83-
let blob = new Blob([data], { type });
84-
let res = new Response(blob);
85-
let text = await res.text();
75+
const data = 'a=1';
76+
const type = 'text/plain';
77+
const blob = new Blob([data], {type});
78+
const res = new Response(blob);
79+
const text = await res.text();
8680
t.is(text, data);
8781
});

0 commit comments

Comments
 (0)