feat: unify mounted workspace graph
This commit is contained in:
@@ -11,7 +11,10 @@ function compareVaultContainmentPath(path: string, vaultPath: string): [string,
|
||||
: [normalizedPath, normalizedVaultPath]
|
||||
}
|
||||
|
||||
export function canWritePathToVault(path: string, vaultPath: string): boolean {
|
||||
export function canWritePathToVault(path: string, vaultPath: string | readonly string[]): boolean {
|
||||
if (Array.isArray(vaultPath)) {
|
||||
return vaultPath.some((candidate) => canWritePathToVault(path, candidate))
|
||||
}
|
||||
const trimmedVaultPath = vaultPath.trim()
|
||||
if (!trimmedVaultPath) return true
|
||||
const [targetPath, rootPath] = compareVaultContainmentPath(path, trimmedVaultPath)
|
||||
|
||||
Reference in New Issue
Block a user