Skip to content

Commit 95790d0

Browse files
authored
Returning 'bigint' to 'filesize.d.ts' & fixing docblock (#190)
1 parent d372bab commit 95790d0

File tree

7 files changed

+9
-9
lines changed

7 files changed

+9
-9
lines changed

dist/filesize.cjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ const STRINGS = {
6161

6262
/**
6363
* Converts a file size in bytes to a human-readable string with appropriate units
64-
* @param {number|bigint} arg - The file size in bytes to convert
64+
* @param {number|string|bigint} arg - The file size in bytes to convert
6565
* @param {Object} [options={}] - Configuration options for formatting
6666
* @param {boolean} [options.bits=false] - If true, calculates bits instead of bytes
6767
* @param {boolean} [options.pad=false] - If true, pads decimal places to match round parameter

dist/filesize.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ const STRINGS = {
5757
}
5858
};/**
5959
* Converts a file size in bytes to a human-readable string with appropriate units
60-
* @param {number|bigint} arg - The file size in bytes to convert
60+
* @param {number|string|bigint} arg - The file size in bytes to convert
6161
* @param {Object} [options={}] - Configuration options for formatting
6262
* @param {boolean} [options.bits=false] - If true, calculates bits instead of bytes
6363
* @param {boolean} [options.pad=false] - If true, pads decimal places to match round parameter

dist/filesize.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/filesize.umd.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ const STRINGS = {
5757
}
5858
};/**
5959
* Converts a file size in bytes to a human-readable string with appropriate units
60-
* @param {number|bigint} arg - The file size in bytes to convert
60+
* @param {number|string|bigint} arg - The file size in bytes to convert
6161
* @param {Object} [options={}] - Configuration options for formatting
6262
* @param {boolean} [options.bits=false] - If true, calculates bits instead of bytes
6363
* @param {boolean} [options.pad=false] - If true, pads decimal places to match round parameter

dist/filesize.umd.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/filesize.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import {
2626

2727
/**
2828
* Converts a file size in bytes to a human-readable string with appropriate units
29-
* @param {number|bigint} arg - The file size in bytes to convert
29+
* @param {number|string|bigint} arg - The file size in bytes to convert
3030
* @param {Object} [options={}] - Configuration options for formatting
3131
* @param {boolean} [options.bits=false] - If true, calculates bits instead of bytes
3232
* @param {boolean} [options.pad=false] - If true, pads decimal places to match round parameter

types/filesize.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export type FilesizeArray = [number | string, string];
5858
/**
5959
* Return type based on output option
6060
*/
61-
export type FilesizeReturn<T extends FilesizeOptions = {}> =
61+
export type FilesizeReturn<T extends FilesizeOptions = {}> =
6262
T['output'] extends "object" ? FilesizeObject :
6363
T['output'] extends "array" ? FilesizeArray :
6464
T['output'] extends "exponent" ? number :
@@ -76,7 +76,7 @@ export type FilesizeReturn<T extends FilesizeOptions = {}> =
7676
* filesize(1024, {output: "object"}) // {value: 1, symbol: "KB", exponent: 1, unit: "KB"}
7777
*/
7878
export function filesize<T extends FilesizeOptions = {}>(
79-
arg: number | bigint,
79+
arg: number | string | bigint,
8080
options?: T
8181
): FilesizeReturn<T>;
8282

@@ -91,4 +91,4 @@ export function filesize<T extends FilesizeOptions = {}>(
9191
*/
9292
export function partial<T extends FilesizeOptions = {}>(
9393
options?: T
94-
): (arg: number | bigint) => FilesizeReturn<T>;
94+
): (arg: number | string | bigint) => FilesizeReturn<T>;

0 commit comments

Comments
 (0)