This commit is contained in:
Akko
2025-08-04 18:57:35 +02:00
parent 8cf6e78a79
commit 9495868c2e
5030 changed files with 518594 additions and 17609 deletions

View File

@@ -0,0 +1,27 @@
import { DOMAdapter } from '../../../environment/adapter.mjs';
import { ExtensionType } from '../../../extensions/Extensions.mjs';
import { checkDataUrl } from '../../utils/checkDataUrl.mjs';
import { checkExtension } from '../../utils/checkExtension.mjs';
import { LoaderParserPriority } from './LoaderParser.mjs';
"use strict";
const validJSONExtension = ".json";
const validJSONMIME = "application/json";
const loadJson = {
extension: {
type: ExtensionType.LoadParser,
priority: LoaderParserPriority.Low
},
name: "loadJson",
test(url) {
return checkDataUrl(url, validJSONMIME) || checkExtension(url, validJSONExtension);
},
async load(url) {
const response = await DOMAdapter.get().fetch(url);
const json = await response.json();
return json;
}
};
export { loadJson };
//# sourceMappingURL=loadJson.mjs.map