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

Function hasDescendantLock

lib/interfaces/webdav-locks.ts:27–37  ·  view source on GitHub ↗
(userId: string, path: string)

Source from the content-addressed store, hash-verified

25}
26
27function hasDescendantLock(userId: string, path: string) {
28 const prefix = buildKey(userId, path ? `${path}/` : '');
29
30 for (const [key, lock] of locksByKey) {
31 if (key !== buildKey(userId, path) && key.startsWith(prefix) && !isExpired(lock)) {
32 return true;
33 }
34 }
35
36 return false;
37}
38
39// A lock on any ancestor collection with Depth: infinity covers this path too.
40export function findBlockingLock(userId: string, path: string, presentedTokens: string[]): WebDavLock | null {

Callers 1

acquireLockFunction · 0.85

Calls 2

buildKeyFunction · 0.85
isExpiredFunction · 0.85

Tested by

no test coverage detected