@fgv/ts-web-extras
Version:
Browser-compatible utilities and FileTree implementations
53 lines (25 loc) • 821 B
Markdown
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@fgv/ts-web-extras](./ts-web-extras.md) > [extractDirectoryPath](./ts-web-extras.extractdirectorypath.md)
## extractDirectoryPath() function
Extracts the directory path from a file or directory path If the path appears to be a directory (no extension), returns it as-is If the path appears to be a file, returns the parent directory
**Signature:**
```typescript
export declare function extractDirectoryPath(path: string): string;
```
## Parameters
<table><thead><tr><th>
Parameter
</th><th>
Type
</th><th>
Description
</th></tr></thead>
<tbody><tr><td>
path
</td><td>
string
</td><td>
</td></tr>
</tbody></table>
**Returns:**
string