constdname = dirname(12345) dname.isOk() // => false dnane.isErr() // true dname.error.message // Outputs an error => '[paths.dirname] The given path must be a string'
Parameters
path: string
The file path from which to extract the directory name.
Returns Result<string, Error>
A Result object containing the directory name as a string on success,
or an Error object if the provided input is not a string.
Extracts the directory name from a given file path.
Example