Source

network/calculateUploadTimeout.js

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**
 * Calculate upload timeout based on file size
 *
 * @param size - The file size in bytes
 * @returns The timeout in milliseconds (ms).
 * @category network
 * @module calculateUploadTimeout
 */
function calculateUploadTimeout(size, min, factor) {
    if (min === void 0) { min = 60000; }
    if (factor === void 0) { factor = 10; }
    // 1s/10kB
    // This calculation is based on a network of minimum 1Mbps bandwidth
    return Math.max(size / factor, min);
}
exports.default = calculateUploadTimeout;