/**
 * Calculates the file size and returns it as a formatted string.
 *
 * @param {number} size - The size of the file in bytes.
 * @returns {string} The formatted file size as a string in kb or mb.
 */
export function calculateFileSize(size) {
    const DEFAULT_SIZE = 0;
    const fileSize = size ?? DEFAULT_SIZE;
    if (!fileSize) {
        return `${DEFAULT_SIZE} kb`;
    }
    const sizeInKb = fileSize / 1024;
    if (sizeInKb > 1024) {
        return `${(sizeInKb / 1024).toFixed(2)} mb`;
    }
    else {
        return `${sizeInKb.toFixed(2)} kb`;
    }
}
//# sourceMappingURL=calculateFileSize.js.map