Skip to content

Commit b2df8b6

Browse files
committed
Move readableBytesMb to common/bytes
1 parent 91ea2f0 commit b2df8b6

3 files changed

Lines changed: 6 additions & 5 deletions

File tree

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export function readableBytesMb(numBytes: number): string {
2+
return `${(numBytes / (1024 * 1024)).toFixed(1)} MB`;
3+
}

extensions/ql-vscode/src/common/vscode/progress.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import {
44
ProgressOptions as VSCodeProgressOptions,
55
window as Window,
66
} from "vscode";
7+
import { readableBytesMb } from "../bytes";
78

89
export class UserCancellationException extends Error {
910
/**
@@ -108,10 +109,6 @@ export function withInheritedProgress<R>(
108109
}
109110
}
110111

111-
export function readableBytesMb(numBytes: number): string {
112-
return `${(numBytes / (1024 * 1024)).toFixed(1)} MB`;
113-
}
114-
115112
/**
116113
* Displays a progress monitor that indicates how much progess has been made
117114
* reading from a stream.

extensions/ql-vscode/src/common/vscode/unzip-progress.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
import { readableBytesMb } from "../bytes";
12
import { UnzipProgressCallback } from "../unzip";
2-
import { ProgressCallback, readableBytesMb } from "./progress";
3+
import { ProgressCallback } from "./progress";
34

45
export function reportUnzipProgress(
56
messagePrefix: string,

0 commit comments

Comments
 (0)