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

Method getNodeByName

cli/src/cli/paths.ts:306–313  ·  view source on GitHub ↗
(parentNode: NodeEntity, name: string)

Source from the content-addressed store, hash-verified

304 }
305
306 private async getNodeByName(parentNode: NodeEntity, name: string) {
307 // Albums are not folders, so they cannot be traversed with the Drive SDK.
308 // Resolve their children through the Photos SDK instead.
309 if (parentNode.type === NodeType.Album) {
310 return this.getAlbumChildByName(parentNode, name);
311 }
312 for await (const maybeChild of this.driveSdk.iterateFolderChildren(parentNode)) {
313 if (getName(maybeChild) === name) {
314 return maybeChild;
315 }
316 }

Callers 2

getChildMethod · 0.95
getNodeByPathMethod · 0.95

Calls 2

getNameFunction · 0.90
iterateFolderChildrenMethod · 0.45

Tested by

no test coverage detected