format, add comments

This commit is contained in:
ThinaticSystem 2022-06-19 00:36:55 +09:00
parent fbe42927df
commit 16717567b7

View File

@ -58,7 +58,10 @@ export function createAiScriptEnv(opts) {
});
init.headers = typedHeaders;
}
const response = await fetch(url.value, init);
// Parsing Section
const contentType = response.headers.get('Content-Type');
if (contentType === null) {
return utils.jsToVal(await response.text());
@ -70,6 +73,7 @@ export function createAiScriptEnv(opts) {
const parser = new DOMParser();
return utils.jsToVal(parser.parseFromString((await response.text()), 'application/xml'));
}
// Content-Type不明
return utils.jsToVal(await response.text());
}),
};