From d0dc998522f198e4a19300a9216ced38a3bc5063 Mon Sep 17 00:00:00 2001 From: Jannik Stehle Date: Mon, 22 Apr 2024 17:11:53 +0200 Subject: [PATCH] feat: export the prepareFileFromProps method --- source/index.ts | 2 +- source/tools/dav.ts | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/source/index.ts b/source/index.ts index 414d4049..d2c9c557 100644 --- a/source/index.ts +++ b/source/index.ts @@ -2,5 +2,5 @@ export { createClient } from "./factory.js"; export { getPatcher } from "./compat/patcher.js"; export * from "./types.js"; -export { parseStat, parseXML, translateDiskSpace } from "./tools/dav.js"; +export { parseStat, parseXML, translateDiskSpace, prepareFileFromProps } from "./tools/dav.js"; export { processResponsePayload } from "./response.js"; diff --git a/source/tools/dav.ts b/source/tools/dav.ts index 7b3357c3..4d216758 100644 --- a/source/tools/dav.ts +++ b/source/tools/dav.ts @@ -110,6 +110,13 @@ export function parseXML(xml: string): Promise { }); } +/** + * Get a file stat result from given DAV properties + * @param props DAV properties + * @param filename The filename for the file stat + * @param isDetailed Whether or not the raw props of the resource should be returned + * @returns A file stat result + */ export function prepareFileFromProps( props: DAVResultResponseProps, filename: string,