(userId: string, path: string)
| 25 | } |
| 26 | |
| 27 | function 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. |
| 40 | export function findBlockingLock(userId: string, path: string, presentedTokens: string[]): WebDavLock | null { |
no test coverage detected