( excludedFolders: string | string[] | null | undefined )
| 3 | } |
| 4 | |
| 5 | export function parseExcludedFolders( |
| 6 | excludedFolders: string | string[] | null | undefined |
| 7 | ): string[] { |
| 8 | const folders = Array.isArray(excludedFolders) |
| 9 | ? excludedFolders |
| 10 | : typeof excludedFolders === "string" |
| 11 | ? excludedFolders.split(",") |
| 12 | : []; |
| 13 | |
| 14 | return Array.from( |
| 15 | new Set( |
| 16 | folders |
| 17 | .map((folder) => normalizeVaultPath(folder.trim())) |
| 18 | .filter((folder) => folder.length > 0) |
| 19 | ) |
| 20 | ); |
| 21 | } |
| 22 | |
| 23 | export function isPathInExcludedFolder(path: string, excludedFolders: readonly string[]): boolean { |
| 24 | const normalizedPath = normalizeVaultPath(path); |
no test coverage detected