Skip to content

Commit 22ecc66

Browse files
committed
Set default value for 'start' option instead
1 parent 01bbd94 commit 22ecc66

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

from.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class BlobDataItem {
2323
constructor(options) {
2424
this.size = options.size;
2525
this.path = options.path;
26-
this.start = options.start;
26+
this.start = options.start || 0;
2727
this.mtime = options.mtime;
2828
}
2929

@@ -34,7 +34,7 @@ class BlobDataItem {
3434
path: this.path,
3535
start,
3636
mtime: this.mtime,
37-
size: start ? end - start : end
37+
size: end - start
3838
});
3939
}
4040

@@ -45,7 +45,7 @@ class BlobDataItem {
4545

4646
return createReadStream(this.path, {
4747
start: this.start,
48-
end: (this.start ? this.start + this.size : this.size) - 1
48+
end: this.start + this.size - 1
4949
});
5050
}
5151

0 commit comments

Comments
 (0)