remove parsing function

This commit is contained in:
ThinaticSystem 2022-06-19 21:17:36 +09:00
parent b7f2b6c322
commit 20c0b2bedf

View File

@ -49,20 +49,6 @@ export function createAiScriptEnv(opts) {
return await fetch(resource.value); return await fetch(resource.value);
} }
})(); })();
// Parsing Section
const contentType = response.headers.get('Content-Type');
if (contentType === null) {
return utils.jsToVal(await response.text());
}
if (contentType.includes('json')) {
return utils.jsToVal(await response.json());
}
if (contentType.includes('xml')) {
const parser = new DOMParser();
return utils.jsToVal(parser.parseFromString((await response.text()), 'application/xml'));
}
// Content-Type不明
return utils.jsToVal(await response.text()); return utils.jsToVal(await response.text());
}), }),
}; };