MCPcopy Create free account
hub / github.com/danoon2/Boxedwine / loadFile

Function loadFile

project/emscripten/boxedwine-shell.js:334–345  ·  view source on GitHub ↗
(pathPrefix, filename, callback)

Source from the content-addressed store, hash-verified

332 return contents;
333 }
334 function loadFile(pathPrefix, filename, callback) {
335 fetch(pathPrefix + filename, { method: 'GET' }).then(function(response) {
336 if (response.status === 200) {
337 response.arrayBuffer().then(function(buffer) {
338 let arr = new Uint8Array(buffer);
339 callback(arr);
340 });
341 } else {
342 console.log('Unable to load:' + filename + ' error:' + response.status);
343 }
344 });
345 }
346 function buildAppFileSystem(callback) {
347 if(Config.appPayload.length > 0){
348 let uint8Array = getBase64Data(Config.appPayload);

Callers 3

buildAppFileSystemFunction · 0.85
buildExtraFileSystemsFunction · 0.85
initialSetupFunction · 0.85

Calls 2

callbackFunction · 0.85
logMethod · 0.80

Tested by

no test coverage detected