MCPcopy Create free account
hub / github.com/emscripten-core/emscripten / getFile

Function getFile

src/IDBStore.js:64–77  ·  view source on GitHub ↗
(dbName, id, callback)

Source from the content-addressed store, hash-verified

62 },
63 // External API
64 getFile(dbName, id, callback) {
65 IDBStore.getStore(dbName, 'readonly', (err, store) => {
66 if (err) return callback(err);
67 var req = store.get(id);
68 req.onsuccess = (event) => {
69 var result = event.target.result;
70 if (!result) {
71 return callback(`file ${id} not found`);
72 }
73 return callback(null, result);
74 };
75 req.onerror = callback;
76 });
77 },
78 setFile(dbName, id, data, callback) {
79 IDBStore.getStore(dbName, 'readwrite', (err, store) => {
80 if (err) return callback(err);

Callers 6

openMethod · 0.85
closeMethod · 0.85
readMethod · 0.85
writeMethod · 0.85
setSizeMethod · 0.85
flushMethod · 0.85

Calls 2

getMethod · 0.65
callbackFunction · 0.50

Tested by

no test coverage detected