MCPcopy Create free account
hub / github.com/ProtonDriveApps/sdk / getNodeByPath

Method getNodeByPath

cli/src/cli/paths.ts:290–304  ·  view source on GitHub ↗
(parentNode: NodeEntity, pathString: string)

Source from the content-addressed store, hash-verified

288 }
289
290 private async getNodeByPath(parentNode: NodeEntity, pathString: string) {
291 let node = parentNode;
292 const pathParts = splitPathSegments(pathString);
293 for (const part of pathParts) {
294 if (part === '') {
295 continue;
296 }
297 if (isNodeUid(part)) {
298 node = await this.sdk.getNode(part);
299 } else {
300 node = await this.getNodeByName(node, part);
301 }
302 }
303 return node;
304 }
305
306 private async getNodeByName(parentNode: NodeEntity, name: string) {
307 // Albums are not folders, so they cannot be traversed with the Drive SDK.

Callers 1

getNodeInternalMethod · 0.95

Calls 4

getNodeByNameMethod · 0.95
splitPathSegmentsFunction · 0.85
isNodeUidFunction · 0.85
getNodeMethod · 0.65

Tested by

no test coverage detected