OverExposureFileSystem
The subset of file-system operations the language-service host needs. Injecting this (rather than always using typescript’s sys) lets tests drive the analyzer against in-memory sources with no real file-system access.
Import:
import type { OverExposureFileSystem } from 'obsidian-dev-utils/script-utils/linters/over-exposure';Signature:
export interface OverExposureFileSystemMethods
| Method | Returns | Description |
|---|---|---|
| directoryExists(this, path) | boolean | Checks whether a directory exists. |
| fileExists(this, path) | boolean | Checks whether a file exists. |
| getCurrentDirectory(this) | string | Resolves the directory that relative paths are resolved against. |
| getDirectories(this, path) | string[] | Lists the immediate subdirectories of a directory. |
| readDirectory(this, path, extensions?, exclude?, include?, depth?) | string[] | Lists the files under a directory, filtered by extension and include/exclude patterns. |
| readFile(this, path) | string | undefined | Reads a file as text. |
Links to this page: