got file output working. Adding Mime walking

This commit is contained in:
Brian Whitney 2018-11-22 14:51:53 -05:00
parent 1e0bb72dfa
commit d8667a67be

View file

@ -90,19 +90,41 @@ class ParseIMF extends Operation {
let headerBody = ParseIMF.splitHeaderFromBody(input); let headerBody = ParseIMF.splitHeaderFromBody(input);
let header = headerBody[0]; let header = headerBody[0];
let headerArray = ParseIMF.parseHeader(header); let headerArray = ParseIMF.parseHeader(header);
if (args[0]) { if (args[0] && headerBody.length > 0) {
header = ParseIMF.replaceDecodeWord(header); headerBody[0] = ParseIMF.replaceDecodeWord(headerBody[0]);
} }
let retval = []; let retval = [];
let i = 0; let i = 0;
headerBody.forEach(function(file){ headerBody.forEach(function(file){
file = new File(Array.from(file), "test"+String(i), {type: "text/plain"}) file = new File([file], "test"+String(i), {type: "text/plain"});
retval.push(file); retval.push(file);
i++; i++;
}); });
return retval; return retval;
} }
/**
* Displays the files in HTML for web apps.
*
* @param {File[]} files
* @returns {html}
*/
async present(files) {
return await Utils.displayFilesAsHTML(files);
}
/**
* Walks a MIME document and returns an array of Mime data and header objects.
*
* @param {string} input
* @param {object} header
* @returns {object[]}
*/
static walkMime(input, header) {
let output = [];
if header[""]
}
/** /**
* Breaks the header from the body and returns [header, body] * Breaks the header from the body and returns [header, body]
* *