1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-07-25 22:34:49 +02:00

chore(dev): tweak some workflows

This commit is contained in:
syuilo
2026-06-26 16:51:54 +09:00
parent 08ca482bcd
commit 2747fd0348
4 changed files with 63 additions and 81 deletions

View File

@@ -17,7 +17,7 @@ export function median(values: number[]) {
}
export function mad(values: number[]) {
if (values.length < 2) return null;
if (values.length < 2) throw new Error('Not enough samples to calculate MAD');
const center = median(values);
return median(values.map(value => Math.abs(value - center)));
@@ -111,7 +111,7 @@ export function formatNumber(value: number) {
export function formatBytes(value: number) {
if (value === 0) return '0 B';
const units = ['B', 'KiB', 'MiB', 'GiB'];
const units = ['B', 'KB', 'MB', 'GB'];
let unitIndex = 0;
let size = value;
while (size >= 1024 && unitIndex < units.length - 1) {