PlatformPath
[<Interface>]
type PlatformPath =
abstract member delimiter: Delimiter
abstract member posix: PlatformPath
abstract member sep: Sep
abstract member win32: PlatformPath
static member Create (normalize: string -> string, join: string array -> string, resolve: string array -> string, matchesGlob: Func<string,string,bool>, isAbsolute: string -> bool, relative: Func<string,string,string>, dirname: string -> string, basename: Func<string,string option,string>, extname: string -> string, sep: Sep, delimiter: Delimiter, parse: string -> ParsedPath, format: FormatInputPathObject -> string, toNamespacedPath: string -> string, posix: PlatformPath, win32: PlatformPath) : PlatformPath
abstract member basename (path: string, ?suffix: string) : string
abstract member dirname (path: string) : string
abstract member extname (path: string) : string
abstract member format (pathObject: FormatInputPathObject) : string
abstract member isAbsolute (path: string) : bool
abstract member join (paths: string array) : string
abstract member matchesGlob (path: string, pattern: string) : bool
abstract member normalize (path: string) : string
abstract member parse (path: string) : ParsedPath
abstract member relative (from: string, to: string) : string
abstract member resolve (paths: string array) : string
abstract member toNamespacedPath (path: string) : string| Assembly | Xantham.Fable.Node |
| Attributes | [<Interface>] |
Declared inside
Delimiter | |
Sep |
Properties
abstract member delimiter: Delimiter
abstract member delimiter: DelimiterThe platform-specific file delimiter. ';' or ':'.
abstract member posix: PlatformPath
abstract member posix: PlatformPathPosix specific pathing. Same as parent object on posix.
abstract member sep: Sep
abstract member sep: SepThe platform-specific file separator. '\' or '/'.
abstract member win32: PlatformPath
abstract member win32: PlatformPathWindows specific pathing. Same as parent object on windows
Methods
static member Create (normalize: string -> string, join: string array -> string, resolve: string array -> string, matchesGlob: Func<string,string,bool>, isAbsolute: string -> bool, relative: Func<string,string,string>, dirname: string -> string, basename: Func<string,string option,string>, extname: string -> string, sep: Sep, delimiter: Delimiter, parse: string -> ParsedPath, format: FormatInputPathObject -> string, toNamespacedPath: string -> string, posix: PlatformPath, win32: PlatformPath) : PlatformPathabstract member basename (path: string, ?suffix: string) : string
abstract member basename (path: string, ?suffix: string) : stringReturn the last portion of a path. Similar to the Unix basename command. Often used to extract the file name from a fully qualified path.
@throws if path is not a string or if ext is given and is not a string.
| Parameter | |
|---|---|
path | the path to evaluate. |
suffix | optionally, an extension to remove from the result. |
abstract member dirname (path: string) : string
abstract member dirname (path: string) : stringReturn the directory name of a path. Similar to the Unix dirname command.
@throws if path is not a string.
| Parameter | |
|---|---|
path | the path to evaluate. |
abstract member extname (path: string) : string
abstract member extname (path: string) : stringReturn the extension of the path, from the last '.' to end of string in the last portion of the path. If there is no '.' in the last portion of the path or the first character of it is '.', then it returns an empty string.
@throws if path is not a string.
| Parameter | |
|---|---|
path | the path to evaluate. |
abstract member format (pathObject: FormatInputPathObject) : string
abstract member format (pathObject: FormatInputPathObject) : stringReturns a path string from an object - the opposite of parse().
| Parameter | |
|---|---|
pathObject | path to evaluate. |
abstract member isAbsolute (path: string) : bool
abstract member isAbsolute (path: string) : boolDetermines whether is an absolute path. An absolute path will always resolve to the same location, regardless of the working directory.
If the given is a zero-length string, false will be returned.
@throws if path is not a string.
| Parameter | |
|---|---|
path | path to test. |
abstract member join (paths: string array) : string
abstract member join (paths: string array) : stringJoin all arguments together and normalize the resulting path.
@throws if any of the path segments is not a string.
| Parameter | |
|---|---|
paths | paths to join. |
abstract member matchesGlob (path: string, pattern: string) : bool
abstract member matchesGlob (path: string, pattern: string) : boolThe path.matchesGlob() method determines if path matches the pattern.
@throws if path or pattern are not strings.
| Parameter | |
|---|---|
path | The path to glob-match against. |
pattern | The glob to check the path against. |
Returns. Whether or not the path matched the pattern.
abstract member normalize (path: string) : string
abstract member normalize (path: string) : stringNormalize a string path, reducing '..' and '.' parts. When multiple slashes are found, they're replaced by a single one; when the path contains a trailing slash, it is preserved. On Windows backslashes are used. If the path is a zero-length string, '.' is returned, representing the current working directory.
@throws if path is not a string.
| Parameter | |
|---|---|
path | string path to normalize. |
abstract member parse (path: string) : ParsedPath
abstract member parse (path: string) : ParsedPathReturns an object from a path string - the opposite of format().
@throws if path is not a string.
| Parameter | |
|---|---|
path | path to evaluate. |
abstract member relative (from: string, to: string) : string
abstract member relative (from: string, to: string) : stringSolve the relative path from to based on the current working directory. At times we have two absolute paths, and we need to derive the relative path from one to the other. This is actually the reverse transform of path.resolve.
@throws if either from or to is not a string.
abstract member resolve (paths: string array) : string
abstract member resolve (paths: string array) : stringThe right-most parameter is considered . Other parameters are considered an array of .
Starting from leftmost parameter, resolves to an absolute path.
If isn't already absolute, arguments are prepended in right to left order, until an absolute path is found. If after using all paths still no absolute path is found, the current working directory is used as well. The resulting path is normalized, and trailing slashes are removed unless the path gets resolved to the root directory.
@throws if any of the arguments is not a string.
| Parameter | |
|---|---|
paths | A sequence of paths or path segments. |
abstract member toNamespacedPath (path: string) : string
abstract member toNamespacedPath (path: string) : stringOn Windows systems only, returns an equivalent namespace-prefixed path for the given path. If path is not a string, path will be returned without modifications. This method is meaningful only on Windows system. On POSIX systems, the method is non-operational and always returns path without modifications.