diff --git a/README.md b/README.md index 3ba5935..0f3fdab 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,8 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v4 + with: + fetch-depth: 0 - name: Create Diff uses: e18e/action-dependency-diff@main ``` diff --git a/main.js b/main.js index 7c2d0ca..7c8a255 100644 --- a/main.js +++ b/main.js @@ -24198,8 +24198,8 @@ async function calculateTotalDependencySizeIncrease(newVersions) { // src/main.ts function formatBytes(bytes) { if (bytes === 0) return "0 B"; - const k = 1024; - const sizes = ["B", "KB", "MB", "GB"]; + const k = 1e3; + const sizes = ["B", "kB", "MB", "GB"]; const i = Math.floor(Math.log(bytes) / Math.log(k)); return `${parseFloat((bytes / Math.pow(k, i)).toFixed(1))} ${sizes[i]}`; } diff --git a/src/main.ts b/src/main.ts index 69ecebe..3ba6f54 100644 --- a/src/main.ts +++ b/src/main.ts @@ -7,8 +7,8 @@ import {calculateTotalDependencySizeIncrease} from './npm.js'; function formatBytes(bytes: number): string { if (bytes === 0) return '0 B'; - const k = 1024; - const sizes = ['B', 'KB', 'MB', 'GB']; + const k = 1000; + const sizes = ['B', 'kB', 'MB', 'GB']; const i = Math.floor(Math.log(bytes) / Math.log(k)); return `${parseFloat((bytes / Math.pow(k, i)).toFixed(1))} ${sizes[i]}`; }