import { FileUtils } from "https://dotland.deno.dev/x/ts_morph@19.0.0/common/mod.ts";
Utilities for working with files.
Static Methods
getDescendantDirectories(fileSystemWrapper: TransactionalFileSystem, dirPath: StandardizedFilePath): IterableIterator<StandardizedFilePath>
Gets the descendant directories of the specified directory.
getParentMostPaths(paths: StandardizedFilePath[]): StandardizedFilePath[]
Gets the parent most paths out of the list of paths.
getRelativePathTo(absoluteDirPathFrom: StandardizedFilePath, absolutePathTo: StandardizedFilePath): StandardizedFilePath
Gets the relative path from one absolute path to another.
isNotExistsError(err: any): boolean
Gets if the error is a file not found or directory not found error.
pathEndsWith(fileOrDirPath: string | undefined, endsWithPath: string | undefined): boolean
Checks if a path ends with a specified search path.
pathStartsWith(fileOrDirPath: string | undefined, startsWithPath: string | undefined): boolean
Checks if a path starts with a specified search path.
readFileOrNotExists(): Promise<string | false>
Reads a file or returns false if the file doesn't exist.
readFileOrNotExistsSync(): string | false
Reads a file synchronously or returns false if the file doesn't exist.
standardizeSlashes<T extends string>(fileOrDirPath: T): T
Changes all back slashes to forward slashes.