send-mail/node_modules/@actions/glob/lib/internal-path-helper.d.ts

43 lines
1.5 KiB
TypeScript
Raw Normal View History

2021-06-23 00:18:21 +07:00
/**
* Similar to path.dirname except normalizes the path separators and slightly better handling for Windows UNC paths.
*
* For example, on Linux/macOS:
* - `/ => /`
* - `/hello => /`
*
* For example, on Windows:
* - `C:\ => C:\`
* - `C:\hello => C:\`
* - `C: => C:`
* - `C:hello => C:`
* - `\ => \`
* - `\hello => \`
* - `\\hello => \\hello`
* - `\\hello\world => \\hello\world`
*/
export declare function dirname(p: string): string;
/**
* Roots the path if not already rooted. On Windows, relative roots like `\`
* or `C:` are expanded based on the current working directory.
*/
export declare function ensureAbsoluteRoot(root: string, itemPath: string): string;
/**
* On Linux/macOS, true if path starts with `/`. On Windows, true for paths like:
* `\\hello\share` and `C:\hello` (and using alternate separator).
*/
export declare function hasAbsoluteRoot(itemPath: string): boolean;
/**
* On Linux/macOS, true if path starts with `/`. On Windows, true for paths like:
* `\`, `\hello`, `\\hello\share`, `C:`, and `C:\hello` (and using alternate separator).
*/
export declare function hasRoot(itemPath: string): boolean;
/**
* Removes redundant slashes and converts `/` to `\` on Windows
*/
export declare function normalizeSeparators(p: string): string;
/**
* Normalizes the path separators and trims the trailing separator (when safe).
* For example, `/foo/ => /foo` but `/ => /`
*/
export declare function safeTrimTrailingSeparator(p: string): string;