File tree Expand file tree Collapse file tree 3 files changed +19
-17
lines changed Expand file tree Collapse file tree 3 files changed +19
-17
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ class Blob {
24
24
* @param {(ArrayBufferLike | ArrayBufferView | Blob | Buffer | string)[] } blobParts
25
25
* @param {{ type?: string } } [options]
26
26
*/
27
- constructor ( blobParts = [ ] , options = { type : '' } ) {
27
+ constructor ( blobParts = [ ] , options = { } ) {
28
28
let size = 0 ;
29
29
30
30
const parts = blobParts . map ( element => {
@@ -41,6 +41,7 @@ class Blob {
41
41
buffer = Buffer . from ( typeof element === 'string' ? element : String ( element ) ) ;
42
42
}
43
43
44
+ // eslint-disable-next-line unicorn/explicit-length-check
44
45
size += buffer . length || buffer . size || 0 ;
45
46
return buffer ;
46
47
} ) ;
Original file line number Diff line number Diff line change 30
30
"url" : " https://github.com/node-fetch/fetch-blob/issues"
31
31
},
32
32
"homepage" : " https://github.com/node-fetch/fetch-blob#readme" ,
33
- "devDependencies" : {
34
- "ava" : " ^3.8.2" ,
35
- "c8" : " ^7.2.0" ,
36
- "codecov" : " ^3.7.0" ,
37
- "domexception" : " ^2.0.1" ,
38
- "get-stream" : " ^5.1.0" ,
39
- "node-fetch" : " ^2.6.0" ,
40
- "typescript" : " ^3.9.5" ,
41
- "xo" : " ^0.32.0"
42
- },
43
33
"xo" : {
44
34
"rules" : {
45
35
"unicorn/import-index" : " off" ,
46
36
"import/extensions" : [
47
37
" error" ,
48
38
" always" ,
49
- { "ignorePackages" : true }
39
+ {
40
+ "ignorePackages" : true
41
+ }
50
42
]
51
43
},
52
44
"overrides" : [
59
51
}
60
52
]
61
53
},
62
- "peerDependencies" : {
63
- "domexception" : " ^2.0.1"
64
- },
65
54
"peerDependenciesMeta" : {
66
55
"domexception" : {
67
56
"optional" : true
68
57
}
58
+ },
59
+ "devDependencies" : {
60
+ "ava" : " ^3.15.0" ,
61
+ "c8" : " ^7.7.1" ,
62
+ "codecov" : " ^3.8.1" ,
63
+ "domexception" : " ^2.0.1" ,
64
+ "get-stream" : " ^6.0.1" ,
65
+ "node-fetch" : " ^2.6.1" ,
66
+ "typescript" : " ^4.2.4" ,
67
+ "xo" : " ^0.38.2"
69
68
}
70
69
}
Original file line number Diff line number Diff line change @@ -153,7 +153,9 @@ test('blob part backed up by filesystem', async t => {
153
153
154
154
test ( 'Reading after modified should fail' , async t => {
155
155
const blob = blobFrom ( './LICENSE' ) ;
156
- await new Promise ( resolve => setTimeout ( resolve , 100 ) ) ;
156
+ await new Promise ( resolve => {
157
+ setTimeout ( resolve , 100 ) ;
158
+ } ) ;
157
159
const now = new Date ( ) ;
158
160
// Change modified time
159
161
fs . utimesSync ( './LICENSE' , now , now ) ;
@@ -163,7 +165,7 @@ test('Reading after modified should fail', async t => {
163
165
164
166
test ( 'Blob-ish class is an instance of Blob' , t => {
165
167
class File {
166
- stream ( ) { }
168
+ stream ( ) { }
167
169
168
170
get [ Symbol . toStringTag ] ( ) {
169
171
return 'File' ;
You can’t perform that action at this time.
0 commit comments