PersistentAI API Documentation / @persistentai/fireflow-vfs / path / extname
Function: extname()
extname(
pathOrUri):string
Defined in: packages/fireflow-vfs/src/path/utils.ts:71
Get the file extension (with dot).
Parameters
pathOrUri
string
Path or URI string
Returns
string
The extension or empty string
Example
ts
extname('/foo/bar.txt') // '.txt'
extname('/foo/bar.tar.gz') // '.gz'
extname('/foo/.gitignore') // ''
extname('/foo/bar') // ''