fix: avoid reading files when the size is empty (#134)

* fix: avoid reading files when the size is empty

* also use stat.size for checking if it is modified

* bump minor version number

* Don't push empty chunks into the array (creates faster reads)

* reverted back to avoid making a if check
This commit is contained in:
Jimmy Wärting
2022-03-10 15:11:10 +01:00
committed by GitHub
parent dc29588366
commit f077471a23
4 changed files with 21 additions and 5 deletions
+6
View File
@@ -189,6 +189,12 @@ promise_test(async () => {
assert_equals(await (await fileFrom('./LICENSE')).text(), license.toString())
}, 'blob part backed up by filesystem slice correctly')
promise_test(async () => {
fs.writeFileSync('temp', '')
await blobFromSync('./temp').text()
fs.unlinkSync('./temp')
}, 'can read empty files')
test(async () => {
const blob = blobFromSync('./LICENSE')
await new Promise(resolve => setTimeout(resolve, 2000))