Parses a human-readable file size string and returns its numeric value in bytes.
Supports both SI (e.g., kB, MB, GB) and IEC (e.g., KiB, MiB, GiB) units, as well as "Bytes".
If no unit is specified, the numeric value is returned as-is.
Returns undefined if the input is invalid or the unit is unrecognized.
Parameters
fileSize: string
The file size string to parse (e.g., "10 MB", "5.5 GiB", "1000").
Returns undefined|number
The file size in bytes as a number, or undefined if parsing fails.
Parses a human-readable file size string and returns its numeric value in bytes.
Supports both SI (e.g., kB, MB, GB) and IEC (e.g., KiB, MiB, GiB) units, as well as "Bytes". If no unit is specified, the numeric value is returned as-is. Returns
undefined
if the input is invalid or the unit is unrecognized.