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

Method create

src/lib/fileList.js:501–512  ·  view source on GitHub ↗

* Create a tree * @param {string} url file url * @param {string} [name] file name * @param {boolean} [isDirectory] if the file is a directory

(url, name, isDirectory, mime, size, modifiedDate)

Source from the content-addressed store, hash-verified

499 * @param {boolean} [isDirectory] if the file is a directory
500 */
501 static async create(url, name, isDirectory, mime, size, modifiedDate) {
502 if (!name && !isDirectory) {
503 const stat = await fsOperation(url).stat();
504 name = stat.name;
505 isDirectory = stat.isDirectory;
506 mime = stat.mime || stat.type;
507 size = stat.size;
508 modifiedDate = stat.modifiedDate;
509 }
510
511 return new Tree(name, url, isDirectory, mime, size, modifiedDate);
512 }
513
514 /**
515 * Create a root tree

Callers

nothing calls this directly

Calls 2

fsOperationFunction · 0.85
statMethod · 0.45

Tested by

no test coverage detected