Move readableBytesMb to common/bytes

This commit is contained in:
Koen Vlaswinkel
2023-12-21 13:41:22 +01:00
parent 91ea2f089e
commit b2df8b6971
3 changed files with 6 additions and 5 deletions

View File

@@ -0,0 +1,3 @@
export function readableBytesMb(numBytes: number): string {
return `${(numBytes / (1024 * 1024)).toFixed(1)} MB`;
}

View File

@@ -4,6 +4,7 @@ import {
ProgressOptions as VSCodeProgressOptions,
window as Window,
} from "vscode";
import { readableBytesMb } from "../bytes";
export class UserCancellationException extends Error {
/**
@@ -108,10 +109,6 @@ export function withInheritedProgress<R>(
}
}
export function readableBytesMb(numBytes: number): string {
return `${(numBytes / (1024 * 1024)).toFixed(1)} MB`;
}
/**
* Displays a progress monitor that indicates how much progess has been made
* reading from a stream.

View File

@@ -1,5 +1,6 @@
import { readableBytesMb } from "../bytes";
import { UnzipProgressCallback } from "../unzip";
import { ProgressCallback, readableBytesMb } from "./progress";
import { ProgressCallback } from "./progress";
export function reportUnzipProgress(
messagePrefix: string,