MCPcopy Create free account
hub / github.com/bewcloud/bewcloud / getPropertyNames

Function getPropertyNames

lib/utils/webdav.ts:82–101  ·  view source on GitHub ↗
(xml: Record<string, any>)

Source from the content-addressed store, hash-verified

80}
81
82export function getPropertyNames(xml: Record<string, any>): string[] {
83 const propFindElement = xml['D:propfind'] || xml.propfind;
84 if (!propFindElement) {
85 return ['allprop'];
86 }
87
88 const propElement = propFindElement['D:prop'] || propFindElement.prop;
89 if (!propElement) {
90 return [];
91 }
92
93 const propertyNames: string[] = [];
94 for (const key in propElement) {
95 if (Object.hasOwn(propElement, key)) {
96 propertyNames.push(key.replace('D:', ''));
97 }
98 }
99
100 return propertyNames;
101}
102
103function encodeFilePath(filePath: string) {
104 const encoded = encodeURIComponent(filePath)

Callers 2

handlerFunction · 0.90
webdav_test.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected