PathHelpers Module
Pure path arithmetic, shared by the Fable and .NET builds. These were node's `path` under Fable and System.IO.Path under .NET - two implementations that already disagreed (node's join normalises, Path.Join does not), and one of which disappears with contextIsolation since `path` is a node module the renderer will not be able to require. Joining strings is not a privileged operation and has no business crossing a process boundary, so rather than becoming ten more bridge calls at 189 call sites this is one implementation for both targets. It follows node's semantics, which is what the app was built against, and Tests/Issie.Tests/PathHelperTests.fs holds it to them. Separator handling is platform-dependent in the way node's is: on Windows both `/` and `\` divide segments and output uses `\`; on POSIX only `/` divides and a backslash is an ordinary filename character. The leading root - a drive, a UNC share, or `/` - is found but never rewritten by dirname and basename, because node does not rewrite it either, and UNC paths matter here: Issie is run from networked locations on cluster machines.
Functions and values
| Function or value | Description |
Full Usage:
basename p
Parameters:
string
Returns: string
|
|
Full Usage:
dirname p
Parameters:
string
Returns: string
|
|
Full Usage:
extname p
Parameters:
string
Returns: string
|
|
Full Usage:
isAbsolute p
Parameters:
string
Returns: bool
|
|
Full Usage:
isSeparator c
Parameters:
char
Returns: bool
|
|
Full Usage:
join parts
Parameters:
string array
Returns: string
|
|
Full Usage:
normalise p
Parameters:
string
Returns: string
|
|
Full Usage:
sepChar
Returns: char
|