@oaklean/profiler-core
Version:
Part of the @oaklean suite. It provides all basic functions to work with the `.oak` file format. It allows parsing the `.oak` file format as well as tools for analyzing the measurement values. It also provides all necessary capabilities required for prec
80 lines (79 loc) • 2.15 kB
TypeScript
import { UnifiedPath_string, UnifiedPathPart_string } from '../types';
export declare class UnifiedPath {
private readonly _unifiedPath;
private _parts;
constructor(arg?: string);
static fromPathParts(parts: string[]): UnifiedPath;
copy(): UnifiedPath;
/**
* String representation of a UnifiedPath
*
* @returns
*/
toString(): UnifiedPath_string;
/**
* Returns UnifiedPath as a string for the current platform
*
* @returns
*/
toPlatformString(): string;
/**
* JSON representation of a UnifiedPath
*
* @returns
*/
toJSON(): UnifiedPath_string;
/**
* Returns the directory name of a path
*
* @returns
*/
dirName(): UnifiedPath;
/**
* Returns the basename name of a path
*
* @returns The basename of the path (path/to/index.coffee.md -> index.coffee.md)
*/
basename(): string;
/**
* Returns the file name of a path (without extension)
*
* @returns The extension of the path (path/to/index.coffee.md -> index.coffee)
*/
filename(): string;
/**
* Returns the extension of a path
*
* @returns The extension of the path (path/to/index.coffee.md -> .md)
*/
extname(): string;
isRelative(): boolean;
isAbsoluteWindowsPath(): boolean;
/**
* Gives the relative UnifiedPath that points from this to the other path
*
* @param other
* @returns
*/
pathTo(other: UnifiedPath | string): UnifiedPath;
/**
* Splits the path into an array of it's components
*
* @returns
*/
split(): UnifiedPathPart_string[];
join(...args: Array<UnifiedPath | string>): UnifiedPath;
/**
* Returns the unified path from the root of the path to the first occurrence of the given directory
* and the remainder
*
* /path/to/node_modules/node_module_name/file -> /path/to/node_modules
*
* @param dirName
* @returns
*/
pathUntilSubDir(dirName: UnifiedPathPart_string): {
match: UnifiedPath;
remainder: UnifiedPath;
} | undefined;
}