Skip to content

Commit

Permalink
Accomodate new linting rule; use valueOf for all enum members
Browse files Browse the repository at this point in the history
  • Loading branch information
Kagamihara Nadeshiko authored and axmmisaka committed Oct 15, 2023
1 parent 62f6a05 commit b3efed6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/time.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ export class TimeValue {
let seconds = this.seconds + other.seconds;
let nanoseconds = this.nanoseconds + other.nanoseconds;

if (nanoseconds >= TimeUnit.sec) {
if (nanoseconds >= TimeUnit.sec.valueOf()) {
// Carry the second.
seconds += 1;
nanoseconds -= TimeUnit.sec;
Expand Down Expand Up @@ -170,7 +170,7 @@ export class TimeValue {
let seconds = this.seconds * factor;
let nanoseconds = this.nanoseconds * factor;

if (nanoseconds >= TimeUnit.sec) {
if (nanoseconds >= TimeUnit.sec.valueOf()) {
// Carry seconds.
const carry = Math.floor(nanoseconds / TimeUnit.sec);
seconds += carry;
Expand Down

0 comments on commit b3efed6

Please sign in to comment.