filterPosixPath() function
Replaces non-alphanumeric characters with dashes to make paths comply with POSIX file system names.
Signature
export declare function filterPosixPath(input: string): string;
Parameters
|
Parameter |
Type |
Description |
|---|---|---|
|
input |
string |
A path candidate. |
Returns
string
A validated path.
Remarks
This function provides explicit POSIX path sanitization regardless of the current platform. Useful when generating paths that will be used on Linux or macOS systems, or when consistency across platforms is required.
Processing rules:
- Preserves forward slashes (
/) for path separators. - Replaces all non-alphanumeric characters (except
/) with dashes. - Collapses consecutive dashes to single dashes.
Use this function instead of filterPath() when you need guaranteed POSIX-style sanitization even when running on Windows, such as when generating paths for remote Linux systems or container images.
Generated via tsdoc2docusaurus 1.3.0-pre by API Extractor/Documenter 7.55.2.