kaven-basic - v6.0.0
    Preparing search index...

    Function ParseFileSize

    • 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.

      3.0.0

      2023-11-25