diff --git a/source/tools/quota.ts b/source/tools/quota.ts index eecc768..1bd22e9 100644 --- a/source/tools/quota.ts +++ b/source/tools/quota.ts @@ -11,7 +11,8 @@ export function parseQuota(result: DAVResult): DiskQuota | null { } = responseItem; return typeof quotaUsed !== "undefined" && typeof quotaAvail !== "undefined" ? { - used: parseInt(quotaUsed, 10), + // As it could be both a string or a number ensure we are working with a number + used: parseInt(String(quotaUsed), 10), available: translateDiskSpace(quotaAvail) } : null; diff --git a/source/types.ts b/source/types.ts index f6f328f..18d6092 100644 --- a/source/types.ts +++ b/source/types.ts @@ -70,8 +70,8 @@ export interface DAVResultResponseProps { getetag?: string; getcontentlength?: string; getcontenttype?: string; - "quota-available-bytes"?: any; - "quota-used-bytes"?: string; + "quota-available-bytes"?: string | number; + "quota-used-bytes"?: string | number; [additionalProp: string]: unknown; }