MCPcopy
hub / github.com/GitbookIO/gitbook / relativeForFile

Function relativeForFile

lib/utils/location.js:112–114  ·  view source on GitHub ↗

* Convert an absolute path to a relative path for a specific folder (dir) * ('test/test.md', 'hello.md') -> '../hello.md' * * @param {String} baseFile: current file * @param {String} file: absolute path of file * @return {String}

(baseFile, file)

Source from the content-addressed store, hash-verified

110 * @return {String}
111 */
112function relativeForFile(baseFile, file) {
113 return relative(path.dirname(baseFile), file);
114}
115
116/**
117 * Compare two paths, return true if they are identical

Callers

nothing calls this directly

Calls 1

relativeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…