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

Function stats

src/fileSystem/internalFs.js:231–259  ·  view source on GitHub ↗

* Return the stats of a file or directory * @param {string} filename * @returns {object}

(filename)

Source from the content-addressed store, hash-verified

229 * @returns {object}
230 */
231 stats(filename) {
232 return new Promise((resolve, reject) => {
233 reject = setMessage(reject);
234 window.resolveLocalFileSystemURL(
235 filename,
236 (entry) => {
237 sdcard.stats(
238 entry.nativeURL,
239 (stats) => {
240 helpers.defineDeprecatedProperty(
241 stats,
242 "uri",
243 function () {
244 return this.url;
245 },
246 function (val) {
247 this.url = val;
248 },
249 );
250 stats.url = filename;
251 resolve(stats);
252 },
253 reject,
254 );
255 },
256 reject,
257 );
258 });
259 },
260
261 /**
262 * Verify if a file or directory exists

Callers

nothing calls this directly

Calls 3

resolveFunction · 0.85
statsMethod · 0.80
setMessageFunction · 0.70

Tested by

no test coverage detected