{"version":3,"file":"requests.mjs","sources":["../../../lib/upload/utils/requests.ts"],"sourcesContent":["/*\n * SPDX-License-Identifier: AGPL-3.0-or-later\n * SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors\n */\n\nimport { isCancel } from '@nextcloud/axios'\n\n/**\n * Create modification time headers if valid value is available.\n * It can be invalid on Android devices if SD cards with NTFS / FAT are used,\n * as those files might use the NT epoch for time so the value will be negative.\n *\n * @param file - The file to upload\n */\nexport function getMtimeHeader(file: File): { 'X-OC-Mtime'?: number } {\n\tconst mtime = Math.floor(file.lastModified / 1000)\n\tif (mtime > 0) {\n\t\treturn { 'X-OC-Mtime': mtime }\n\t}\n\treturn {}\n}\n\n/**\n * Check if the given error is an abort error\n *\n * @param error - Error to check\n */\nexport function isRequestAborted(error: unknown): boolean {\n\treturn isCancel(error)\n\t\t|| (error instanceof DOMException && error.name === 'AbortError')\n}\n"],"names":[],"mappings":";AAcO,SAAS,eAAe,MAAuC;AACrE,QAAM,QAAQ,KAAK,MAAM,KAAK,eAAe,GAAI;AACjD,MAAI,QAAQ,GAAG;AACd,WAAO,EAAE,cAAc,MAAA;AAAA,EACxB;AACA,SAAO,CAAA;AACR;AAOO,SAAS,iBAAiB,OAAyB;AACzD,SAAO,SAAS,KAAK,KAChB,iBAAiB,gBAAgB,MAAM,SAAS;AACtD;"}