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

Function flatten

lib/utils/location.js:48–55  ·  view source on GitHub ↗

* Flatten a path, it removes the leading "/" * * @param {String} href * @return {String}

(href)

Source from the content-addressed store, hash-verified

46 * @return {String}
47 */
48function flatten(href) {
49 href = normalize(href);
50 if (href[0] == '/') {
51 href = normalize(href.slice(1));
52 }
53
54 return href;
55}
56
57/**
58 * Convert a relative path to absolute

Callers

nothing calls this directly

Calls 1

normalizeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…