Skip to content

Commit

Permalink
style: remove method parenthesis spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
juliendargelos authored Apr 30, 2024
1 parent ad95237 commit 950177a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/duration-estimator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,29 @@ export class DurationEstimator {
public length: number
public time?: number

public constructor (length = 10) {
public constructor(length = 10) {
this.length = length
}

public get speed (): number {
public get speed(): number {
const length = this.samples.length
return length
? this.samples.reduce((speed, sample) => speed + sample) / length
: 0
}

public get estimation (): number {
public get estimation(): number {
return (1 - this.progress) / this.speed
}

public reset (): this {
public reset(): this {
this.progress = 0
this.time = undefined
this.samples.splice(0)
return this
}

public update (progress: number): this {
public update(progress: number): this {
if (this.time === undefined) {
this.progress = progress
this.time = Date.now()
Expand All @@ -44,7 +44,7 @@ export class DurationEstimator {
return this
}

public estimate (progress: number): number {
public estimate(progress: number): number {
return this.update(progress).estimation
}
}

0 comments on commit 950177a

Please sign in to comment.