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

Function exists

src/fileSystem/internalFs.js:307–321  ·  view source on GitHub ↗

* Check if a file or directory exists * @param {Promise } url

(url)

Source from the content-addressed store, hash-verified

305 * @param {Promise<Boolean>} url
306 */
307 exists(url) {
308 return new Promise((resolve, reject) => {
309 reject = setMessage(reject);
310 window.resolveLocalFileSystemURL(
311 url,
312 (entry) => {
313 resolve(true);
314 },
315 (err) => {
316 if (err.code === 1) resolve(false);
317 reject(err);
318 },
319 );
320 });
321 },
322
323 /**
324 * Test if url supports this file system

Callers

nothing calls this directly

Calls 3

resolveFunction · 0.85
setMessageFunction · 0.70
existsMethod · 0.65

Tested by

no test coverage detected