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

Method fromJSON

src/lib/fileList.js:630–637  ·  view source on GitHub ↗

* Create a tree from json * @param {TreeJson} json * @returns {Tree}

(json)

Source from the content-addressed store, hash-verified

628 * @returns {Tree}
629 */
630 static fromJSON(json) {
631 const { name, url, path, parent, mime, size, modifiedDate, isDirectory } =
632 json;
633 const tree = new Tree(name, url, isDirectory, mime, size, modifiedDate);
634 tree.#parent = getTree(Object.values(filesTree), parent);
635 tree.#path = path;
636 return tree;
637 }
638}
639
640function normalizeModifiedDate(value) {

Callers 2

initMethod · 0.45
index.jsFile · 0.45

Calls 1

getTreeFunction · 0.85

Tested by

no test coverage detected