Skip to content

Commit

Permalink
refactor: set default for rangeStart
Browse files Browse the repository at this point in the history
  • Loading branch information
casparneumann-cap committed Oct 18, 2023
1 parent 29b522e commit cc7a537
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,12 @@ export class TemporaryFileStorage implements ITemporaryFileStorage {
public async getFileStream(
filename: string,
user: IUser,
rangeStart?: number | undefined,
rangeStart = 0,
rangeEnd?: number | undefined
): Promise<Readable> {
this.checkFilename(filename);
const tempFile = await this.repo.findByUserAndFilename(user.id, filename);
const path = this.getFilePath(user.id, filename);
if (rangeStart === undefined) {
rangeStart = 0;
}
if (rangeEnd === undefined) {
rangeEnd = tempFile.size - 1;
}
Expand Down

0 comments on commit cc7a537

Please sign in to comment.