Skip to main content

source_dir

Function source_dir 

Source
pub fn source_dir(path: &str) -> String
Expand description

The directory a relative reference inside path resolves against.

A path with no separator (an in-memory key such as a.jsonic) yields the empty string, so a bare nested reference resolves plainly; a separator at index zero yields the root separator. Mirrors Go’s sourceDir and the TypeScript mem resolver’s resolvefolder.