MCPcopy Create free account
hub / github.com/antimatter15/ocrad.js / processData

Function processData

ocrad.js:4641–4662  ·  view source on GitHub ↗
(byteArray)

Source from the content-addressed store, hash-verified

4639 var fullname = name ? PATH.resolve(PATH.join2(parent, name)) : parent;
4640 var dep = getUniqueRunDependency('cp ' + fullname); // might have several active requests for the same fullname
4641 function processData(byteArray) {
4642 function finish(byteArray) {
4643 if (preFinish) preFinish();
4644 if (!dontCreateFile) {
4645 FS.createDataFile(parent, name, byteArray, canRead, canWrite, canOwn);
4646 }
4647 if (onload) onload();
4648 removeRunDependency(dep);
4649 }
4650 var handled = false;
4651 Module['preloadPlugins'].forEach(function(plugin) {
4652 if (handled) return;
4653 if (plugin['canHandle'](fullname)) {
4654 plugin['handle'](byteArray, fullname, finish, function() {
4655 if (onerror) onerror();
4656 removeRunDependency(dep);
4657 });
4658 handled = true;
4659 }
4660 });
4661 if (!handled) finish(byteArray);
4662 }
4663 addRunDependency(dep);
4664 if (typeof url == 'string') {
4665 Browser.asyncLoad(url, function(byteArray) {

Callers 1

createOcradInstanceFunction · 0.85

Calls 2

removeRunDependencyFunction · 0.85
finishFunction · 0.85

Tested by

no test coverage detected