Skip to content

ResourceLockComponent.bypassBlockedMutations method

ResourceLockComponent › bypassBlockedMutations

Opens an **ambient bypass scope**: while the returned Disposable is not disposed, this plugin's own mutations of the given paths (and, for a folder, its whole subtree) pass through the mutation blocker instead of throwing ResourceLockedError. Any mutation of a blocked path NOT covered by an active bypass scope is still rejected. Use it with a using declaration around the operation that legitimately mutates resources it has locked with ResourceLockComponentLockForPathParams.shouldBlockMutations:

``ts
using _bypass = component.bypassBlockedMutations([sourceFile, targetFile]);
// ... the operation's own vault mutations of those paths are allowed ...
// scope end: the paths are enforced again
``

Signature:

bypassBlockedMutations(pathsOrFiles: readonly PathOrFile[]): Disposable

Parameters:

ParameterTypeDescription
pathsOrFilesreadonly PathOrFile[]The paths (or files/folders) whose mutation by this operation is sanctioned.

Returns: DisposableA Disposable that ends the bypass scope when disposed.