UNPKG

ts-simple-ast

Version:

TypeScript compiler wrapper for AST navigation and code generation.

31 lines (30 loc) 1.09 kB
export declare class FileUtils { private constructor(); /** * Gets the current directory. */ static getCurrentDirectory(): string; /** * Joins the paths. * @param paths - Paths to join. */ static pathJoin(...paths: string[]): string; /** * Gets the standardized absolute path. * @param fileOrDirPath - Path to standardize. */ static getStandardizedAbsolutePath(fileOrDirPath: string): string; /** * Gets the directory name. * @param fileOrDirPath - Path to get the directory name from. */ static getDirName(fileOrDirPath: string): string; /** * Gets the absolute path when absolute, otherwise gets the relative path from the base dir. * @param filePath - File path. * @param baseDir - Base dir to use when file path is relative. */ static getAbsoluteOrRelativePathFromPath(filePath: string, baseDir: string): string; static standardizeSlashes(fileName: string): string; static filePathMatches(fileName: string | null, searchString: string | null): boolean; }