feat: update deno-commons-mod.ts
This commit is contained in:
@@ -107,6 +107,18 @@ export function formatPercent(a: number, b: number): string {
|
|||||||
return p.substring(0, pointIndex) + "." + decimalPart + "%";
|
return p.substring(0, pointIndex) + "." + decimalPart + "%";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export async function clearLastLine() {
|
||||||
|
await printLastLine("");
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function printLastLine(line: string) {
|
||||||
|
await Deno.stdout.write(
|
||||||
|
new TextEncoder().encode(
|
||||||
|
`\x1b[1000D${line}\x1b[K`,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
Deno.test("isOn", () => {
|
Deno.test("isOn", () => {
|
||||||
assertEquals(false, isOn(undefined));
|
assertEquals(false, isOn(undefined));
|
||||||
assertEquals(false, isOn(""));
|
assertEquals(false, isOn(""));
|
||||||
|
|||||||
Reference in New Issue
Block a user