MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / format

Function format

src/utils/Uri.js:74–86  ·  view source on GitHub ↗

* Formats the five contentUri object to string * @param {{rootUri: string, docId: string} | String} contentUriObject or rootId * @param {string} [docId] * @returns {string}

(contentUriObject, docId)

Source from the content-addressed store, hash-verified

72 * @returns {string}
73 */
74 format(contentUriObject, docId) {
75 let rootUri;
76
77 if (typeof contentUriObject === "string") {
78 rootUri = contentUriObject;
79 } else {
80 rootUri = contentUriObject.rootUri;
81 docId = contentUriObject.docId;
82 }
83
84 if (docId) return [rootUri, docId].join("::");
85 else return rootUri;
86 },
87 /**
88 * Gets virtual address by replacing root with name i.e. added in file explorer
89 * @param {string} url

Callers 1

fontManager.jsFile · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected