Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ var parseRegExp = /^((-|\+)?(\d+(?:\.\d+)?)) *(kb|mb|gb|tb|pb)$/i;
/**
* Convert the given value in bytes into a string or parse to string to an integer in bytes.
*
* @param {string|number} value
* @param {string|number|bigint} value
* @param {{
* case: [string],
* decimalPlaces: [number]
Expand All @@ -59,6 +59,10 @@ function bytes(value, options) {
if (typeof value === 'number') {
return format(value, options);
}

if (typeof value === 'bigint') {
return format(Number(value), options);
}

return null;
}
Expand Down