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 {
2424 * @param {(ArrayBufferLike | ArrayBufferView | Blob | Buffer | string)[] } blobParts
2525 * @param {{ type?: string } } [options]
2626 */
27- constructor ( blobParts = [ ] , options = { type : '' } ) {
27+ constructor ( blobParts = [ ] , options = { } ) {
2828 let size = 0 ;
2929
3030 const parts = blobParts . map ( element => {
@@ -41,6 +41,7 @@ class Blob {
4141 buffer = Buffer . from ( typeof element === 'string' ? element : String ( element ) ) ;
4242 }
4343
44+ // eslint-disable-next-line unicorn/explicit-length-check
4445 size += buffer . length || buffer . size || 0 ;
4546 return buffer ;
4647 } ) ;
Original file line number Diff line number Diff line change 3030 "url" : " https://github.com/node-fetch/fetch-blob/issues"
3131 },
3232 "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- },
4333 "xo" : {
4434 "rules" : {
4535 "unicorn/import-index" : " off" ,
4636 "import/extensions" : [
4737 " error" ,
4838 " always" ,
49- { "ignorePackages" : true }
39+ {
40+ "ignorePackages" : true
41+ }
5042 ]
5143 },
5244 "overrides" : [
5951 }
6052 ]
6153 },
62- "peerDependencies" : {
63- "domexception" : " ^2.0.1"
64- },
6554 "peerDependenciesMeta" : {
6655 "domexception" : {
6756 "optional" : true
6857 }
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"
6968 }
7069}
Original file line number Diff line number Diff line change @@ -153,7 +153,9 @@ test('blob part backed up by filesystem', async t => {
153153
154154test ( 'Reading after modified should fail' , async t => {
155155 const blob = blobFrom ( './LICENSE' ) ;
156- await new Promise ( resolve => setTimeout ( resolve , 100 ) ) ;
156+ await new Promise ( resolve => {
157+ setTimeout ( resolve , 100 ) ;
158+ } ) ;
157159 const now = new Date ( ) ;
158160 // Change modified time
159161 fs . utimesSync ( './LICENSE' , now , now ) ;
@@ -163,7 +165,7 @@ test('Reading after modified should fail', async t => {
163165
164166test ( 'Blob-ish class is an instance of Blob' , t => {
165167 class File {
166- stream ( ) { }
168+ stream ( ) { }
167169
168170 get [ Symbol . toStringTag ] ( ) {
169171 return 'File' ;
You can’t perform that action at this time.
0 commit comments