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 9570635 commit 4ac2de0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 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
20 changes: 10 additions & 10 deletions src/core/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,11 @@ export class Log {
module?: string
): void {
if (module != null) {
if (Log.global.level >= LogLevel.DEBUG) {
if (Log.global.level >= LogLevel.DEBUG.valueOf()) {
Log.getInstance(module).debug(message.call(obj));
}
} else {
if (Log.global.level >= LogLevel.DEBUG) {
if (Log.global.level >= LogLevel.DEBUG.valueOf()) {
Log.global.debug(message.call(obj));
}
}
Expand All @@ -98,11 +98,11 @@ export class Log {
module?: string
): void {
if (module != null) {
if (Log.global.level >= LogLevel.ERROR) {
if (Log.global.level >= LogLevel.ERROR.valueOf()) {
Log.getInstance(module).error(message.call(obj));
}
} else {
if (Log.global.level >= LogLevel.ERROR) {
if (Log.global.level >= LogLevel.ERROR.valueOf()) {
// Log.global.error(message.call(obj));
console.error(message.call(obj));
}
Expand All @@ -124,11 +124,11 @@ export class Log {
module?: string
): void {
if (module != null) {
if (Log.global.level >= LogLevel.INFO) {
if (Log.global.level >= LogLevel.INFO.valueOf()) {
Log.getInstance(module).info(message.call(obj));
}
} else {
if (Log.global.level >= LogLevel.INFO) {
if (Log.global.level >= LogLevel.INFO.valueOf()) {
Log.global.info(message.call(obj));
}
}
Expand All @@ -149,11 +149,11 @@ export class Log {
module?: string
): void {
if (module != null) {
if (Log.global.level >= LogLevel.LOG) {
if (Log.global.level >= LogLevel.LOG.valueOf()) {
Log.getInstance(module).log(message.call(obj));
}
} else {
if (Log.global.level >= LogLevel.LOG) {
if (Log.global.level >= LogLevel.LOG.valueOf()) {
Log.global.log(message.call(obj));
}
}
Expand All @@ -174,11 +174,11 @@ export class Log {
module?: string
): void {
if (module != null) {
if (Log.global.level >= LogLevel.WARN) {
if (Log.global.level >= LogLevel.WARN.valueOf()) {
Log.getInstance(module).warn(message.call(obj));
}
} else {
if (Log.global.level >= LogLevel.WARN) {
if (Log.global.level >= LogLevel.WARN.valueOf()) {
Log.global.warn(message.call(obj));
}
}
Expand Down

0 comments on commit 4ac2de0

Please sign in to comment.