update commit.ts

This commit is contained in:
2026-01-25 18:09:16 +08:00
parent c0e6d3e7f1
commit 4ed855ea26
2 changed files with 14 additions and 20 deletions

View File

@@ -1,10 +1,10 @@
// Reference:
// - https://docs.deno.com/runtime/fundamentals/testing/
import {assert} from "jsr:@std/assert/assert";
import {assertEquals} from "jsr:@std/assert";
import {decodeBase64, encodeBase64} from "jsr:@std/encoding/base64";
import {dirname} from "https://deno.land/std@0.208.0/path/mod.ts";
import { assert } from "jsr:@std/assert/assert";
import { assertEquals } from "jsr:@std/assert";
import { decodeBase64, encodeBase64 } from "jsr:@std/encoding/base64";
import { dirname } from "https://deno.land/std@0.208.0/path/mod.ts";
// reference: https://docs.deno.com/examples/hex_base64_encoding/
// import { decodeBase64, encodeBase64 } from "jsr:@std/encoding/base64";
@@ -522,12 +522,9 @@ export class ProcessBar {
this.interval = setInterval(() => {
const dots = ".".repeat(((count++) % 10) + 1);
const costMs = new Date().getTime() - startMs;
let time = `${costMs}ms`;
if (costMs > 1000) {
time = `${Math.floor(costMs / 1000)}s`;
}
const time = `${Math.floor(costMs / 1000)}s`;
process.stderr.write(`\r${this.message} ${time} ${dots}\x1b[K`);
}, 200);
}, 500);
}
stop(clearLine?: boolean): void {
if (this.interval) {