Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: export the prepareFileFromProps method #373

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion source/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
7 changes: 7 additions & 0 deletions source/tools/dav.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,13 @@ export function parseXML(xml: string): Promise<DAVResult> {
});
}

/**
* 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,
Expand Down
Loading