UNPKG

@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

68 lines (67 loc) 1.73 kB
import { UnifiedPath_string, UnifiedPathPart_string } from '../types'; export declare class UnifiedPath { private readonly _unifiedPath; private _parts; constructor(filePath: 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 */ basename(): 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; }