Skip to content

PersistentAI API Documentation / @persistentai/fireflow-vfs / path / ensureTrailingSlash

Function: ensureTrailingSlash()

ensureTrailingSlash(pathOrUri): string

Defined in: packages/fireflow-vfs/src/path/utils.ts:331

Ensure path ends with trailing slash (for directories).

Parameters

pathOrUri

string

Path string

Returns

string

Path with trailing slash

Example

ts
ensureTrailingSlash('/foo/bar')   // '/foo/bar/'
ensureTrailingSlash('/foo/bar/')  // '/foo/bar/'

Licensed under BUSL-1.1