Skip to content

Commit caa1f9a

Browse files
authored
switch size notation, link to the npm file browser (#1879)
1 parent 27e3aea commit caa1f9a

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

components/Library/MetaData.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ function generateData(
8383
id: 'size',
8484
icon: <PackageSize fill={iconColor} />,
8585
content: (
86-
<A href={`https://packagephobia.com/result?p=${npmPkg}`} style={styles.link}>
86+
<A href={`https://www.npmjs.com/package/${npmPkg}?activeTab=code`} style={styles.link}>
8787
{`${formatBytes(npm.size)} package size`}
8888
</A>
8989
),

util/formatBytes.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
const MUL = 1024;
2-
const SUFFIXES = ['B', 'KiB', 'MiB'];
1+
const MUL = 1000;
2+
const SUFFIXES = ['B', 'kB', 'MB'];
33

44
export function formatBytes(bytes: number, decimals = 2): string {
55
if (bytes === 0) {

0 commit comments

Comments
 (0)