// __VERSION__ is injected by babel-plugin-version-inline // @ts-ignore TS2304: Cannot find name '__VERSION__'. const VERSION = typeof "4.3.1" !== 'undefined' ? "4.3.1" : 'latest'; /** * A JSON Micro loader (minimal bundle size) * Alternative to `@loaders.gl/json` */ export const JSONLoader = { dataType: null, batchType: null, name: 'JSON', id: 'json', module: 'json', version: VERSION, extensions: ['json', 'geojson'], mimeTypes: ['application/json'], category: 'json', text: true, parseTextSync, parse: async (arrayBuffer) => parseTextSync(new TextDecoder().decode(arrayBuffer)), options: {} }; // TODO - Better error handling! function parseTextSync(text) { return JSON.parse(text); }