@loaders.gl/json 4.1.0 → 4.2.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/dist.dev.js CHANGED
@@ -1720,7 +1720,7 @@ Char: ${this.c}`;
1720
1720
  }
1721
1721
 
1722
1722
  // src/json-loader.ts
1723
- var VERSION = true ? "4.1.0" : "latest";
1723
+ var VERSION = true ? "4.2.0-alpha.1" : "latest";
1724
1724
  var JSONLoader = {
1725
1725
  name: "JSON",
1726
1726
  id: "json",
@@ -1812,7 +1812,7 @@ Char: ${this.c}`;
1812
1812
  }
1813
1813
 
1814
1814
  // src/ndjson-loader.ts
1815
- var VERSION2 = true ? "4.1.0" : "latest";
1815
+ var VERSION2 = true ? "4.2.0-alpha.1" : "latest";
1816
1816
  var NDJSONLoader = {
1817
1817
  name: "NDJSON",
1818
1818
  id: "ndjson",
@@ -2881,7 +2881,7 @@ Char: ${this.c}`;
2881
2881
  }
2882
2882
 
2883
2883
  // src/geojson-loader.ts
2884
- var VERSION3 = true ? "4.1.0" : "latest";
2884
+ var VERSION3 = true ? "4.2.0-alpha.1" : "latest";
2885
2885
  var GeoJSONWorkerLoader = {
2886
2886
  name: "GeoJSON",
2887
2887
  id: "geojson",
@@ -1,6 +1,6 @@
1
1
  import { geojsonToBinary } from '@loaders.gl/gis';
2
2
  import { parseJSONInBatches } from "./lib/parsers/parse-json-in-batches.js";
3
- const VERSION = typeof "4.1.0" !== 'undefined' ? "4.1.0" : 'latest';
3
+ const VERSION = typeof "4.2.0-alpha.1" !== 'undefined' ? "4.2.0-alpha.1" : 'latest';
4
4
  export const GeoJSONWorkerLoader = {
5
5
  name: 'GeoJSON',
6
6
  id: 'geojson',
@@ -1 +1 @@
1
- {"version":3,"file":"geojson-loader.js","names":["geojsonToBinary","parseJSONInBatches","VERSION","GeoJSONWorkerLoader","name","id","module","version","worker","extensions","mimeTypes","category","text","options","geojson","shape","json","jsonpaths","gis","format","GeoJSONLoader","parse","parseTextSync","parseInBatches","arrayBuffer","TextDecoder","decode","_geojson","JSON","table","type","features","asyncIterator","geojsonIterator","makeBinaryGeometryIterator","batch","data"],"sources":["../src/geojson-loader.ts"],"sourcesContent":["// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {Loader, LoaderWithParser} from '@loaders.gl/loader-utils';\nimport type {GeoJSON, GeoJSONTable, TableBatch} from '@loaders.gl/schema';\nimport type {JSONLoaderOptions} from './json-loader';\nimport {geojsonToBinary} from '@loaders.gl/gis';\n// import {parseJSONSync} from './lib/parsers/parse-json';\nimport {parseJSONInBatches} from './lib/parsers/parse-json-in-batches';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\nexport type GeoJSONLoaderOptions = JSONLoaderOptions & {\n geojson?: {\n shape?: 'object-row-table';\n };\n gis?: {\n format?: 'geojson' | 'binary';\n };\n};\n\n/**\n * GeoJSON loader\n */\nexport const GeoJSONWorkerLoader: Loader<GeoJSON, TableBatch, GeoJSONLoaderOptions> = {\n name: 'GeoJSON',\n id: 'geojson',\n module: 'geojson',\n version: VERSION,\n worker: true,\n extensions: ['geojson'],\n mimeTypes: ['application/geo+json'],\n category: 'geometry',\n text: true,\n options: {\n geojson: {\n shape: 'object-row-table'\n },\n json: {\n shape: 'object-row-table',\n jsonpaths: ['$', '$.features']\n },\n gis: {\n format: 'geojson'\n }\n }\n};\n\nexport const GeoJSONLoader: LoaderWithParser<GeoJSON, TableBatch, GeoJSONLoaderOptions> = {\n ...GeoJSONWorkerLoader,\n // @ts-expect-error\n parse,\n // @ts-expect-error\n parseTextSync,\n parseInBatches\n};\n\nasync function parse(arrayBuffer: ArrayBuffer, options?: GeoJSONLoaderOptions) {\n return parseTextSync(new TextDecoder().decode(arrayBuffer), options);\n}\n\nfunction parseTextSync(text: string, options?: GeoJSONLoaderOptions) {\n // Apps can call the parse method directly, we so apply default options here\n options = {...GeoJSONLoader.options, ...options};\n options.geojson = {...GeoJSONLoader.options.geojson, ...options.geojson};\n options.gis = options.gis || {};\n\n let geojson;\n try {\n geojson = JSON.parse(text);\n } catch {\n geojson = {};\n }\n\n const table: GeoJSONTable = {\n shape: 'geojson-table',\n // TODO - deduce schema from geojson\n // TODO check that parsed data is of type FeatureCollection\n type: 'FeatureCollection',\n features: geojson?.features || []\n };\n\n switch (options.gis.format) {\n case 'binary':\n return geojsonToBinary(table.features);\n default:\n return table;\n }\n}\n\nfunction parseInBatches(asyncIterator, options): AsyncIterable<TableBatch> {\n // Apps can call the parse method directly, we so apply default options here\n options = {...GeoJSONLoader.options, ...options};\n options.json = {...GeoJSONLoader.options.geojson, ...options.geojson};\n\n const geojsonIterator = parseJSONInBatches(asyncIterator, options);\n\n switch (options.gis.format) {\n case 'binary':\n return makeBinaryGeometryIterator(geojsonIterator);\n default:\n return geojsonIterator as AsyncIterable<TableBatch>;\n }\n}\n\nasync function* makeBinaryGeometryIterator(geojsonIterator) {\n for await (const batch of geojsonIterator) {\n batch.data = geojsonToBinary(batch.data);\n yield batch;\n }\n}\n"],"mappings":"AAOA,SAAQA,eAAe,QAAO,iBAAiB;AAAC,SAExCC,kBAAkB;AAI1B,MAAMC,OAAO,GAAG,cAAkB,KAAK,WAAW,aAAiB,QAAQ;AAc3E,OAAO,MAAMC,mBAAsE,GAAG;EACpFC,IAAI,EAAE,SAAS;EACfC,EAAE,EAAE,SAAS;EACbC,MAAM,EAAE,SAAS;EACjBC,OAAO,EAAEL,OAAO;EAChBM,MAAM,EAAE,IAAI;EACZC,UAAU,EAAE,CAAC,SAAS,CAAC;EACvBC,SAAS,EAAE,CAAC,sBAAsB,CAAC;EACnCC,QAAQ,EAAE,UAAU;EACpBC,IAAI,EAAE,IAAI;EACVC,OAAO,EAAE;IACPC,OAAO,EAAE;MACPC,KAAK,EAAE;IACT,CAAC;IACDC,IAAI,EAAE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A,CAACS,aAAa,EAAEnB,OAAO,EAA6B;EAEzEA,OAAO,GAAG;IAAC,GAAGO,aAAa,CAACP,OAAO;IAAE,GAAGA;EAAO,CAAC;EAChDA,OAAO,CAACG,IAAI,GAAG;IAAC,GAAGI,aAAa,CAACP,OAAO,CAACC,OAAO;IAAE,GAAGD,OAAO,CAACC;EAAO,CAAC;EAErE,MAAMmB,eAAe,GAAGhC,kBAAkB,CAAC+B,aAAa,EAAEnB,OAAO,CAAC;EAElE,QAAQA,OAAO,CAACK,GAAG,CAACC,MAAM;IACxB,KAAK,QAAQ;MACX,OAAOe,0BAA0B,CAACD,eAAe,CAAC;IACpD;MACE,OAAOA,eAAe;EAC1B;AACF;AAEA,gBAAgBC,0BAA0BA,CAACD,eAAe,EAAE;EAC1D,WAAW,MAAME,KAAK,IAAIF,eAAe,EAAE;IACzCE,KAAK,CAACC,IAAI,GAAGpC,eAAe,CAACmC,KAAK,CAACC,IAAI,CAAC;IACxC,MAAMD,KAAK;EACb;AACF"}
1
+ {"version":3,"file":"geojson-loader.js","names":["geojsonToBinary","parseJSONInBatches","VERSION","GeoJSONWorkerLoader","name","id","module","version","worker","extensions","mimeTypes","category","text","options","geojson","shape","json","jsonpaths","gis","format","GeoJSONLoader","parse","parseTextSync","parseInBatches","arrayBuffer","TextDecoder","decode","_geojson","JSON","table","type","features","asyncIterator","geojsonIterator","makeBinaryGeometryIterator","batch","data"],"sources":["../src/geojson-loader.ts"],"sourcesContent":["// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {Loader, LoaderWithParser} from '@loaders.gl/loader-utils';\nimport type {GeoJSON, GeoJSONTable, TableBatch} from '@loaders.gl/schema';\nimport type {JSONLoaderOptions} from './json-loader';\nimport {geojsonToBinary} from '@loaders.gl/gis';\n// import {parseJSONSync} from './lib/parsers/parse-json';\nimport {parseJSONInBatches} from './lib/parsers/parse-json-in-batches';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\nexport type GeoJSONLoaderOptions = JSONLoaderOptions & {\n geojson?: {\n shape?: 'object-row-table';\n };\n gis?: {\n format?: 'geojson' | 'binary';\n };\n};\n\n/**\n * GeoJSON loader\n */\nexport const GeoJSONWorkerLoader: Loader<GeoJSON, TableBatch, GeoJSONLoaderOptions> = {\n name: 'GeoJSON',\n id: 'geojson',\n module: 'geojson',\n version: VERSION,\n worker: true,\n extensions: ['geojson'],\n mimeTypes: ['application/geo+json'],\n category: 'geometry',\n text: true,\n options: {\n geojson: {\n shape: 'object-row-table'\n },\n json: {\n shape: 'object-row-table',\n jsonpaths: ['$', '$.features']\n },\n gis: {\n format: 'geojson'\n }\n }\n};\n\nexport const GeoJSONLoader: LoaderWithParser<GeoJSON, TableBatch, GeoJSONLoaderOptions> = {\n ...GeoJSONWorkerLoader,\n // @ts-expect-error\n parse,\n // @ts-expect-error\n parseTextSync,\n parseInBatches\n};\n\nasync function parse(arrayBuffer: ArrayBuffer, options?: GeoJSONLoaderOptions) {\n return parseTextSync(new TextDecoder().decode(arrayBuffer), options);\n}\n\nfunction parseTextSync(text: string, options?: GeoJSONLoaderOptions) {\n // Apps can call the parse method directly, we so apply default options here\n options = {...GeoJSONLoader.options, ...options};\n options.geojson = {...GeoJSONLoader.options.geojson, ...options.geojson};\n options.gis = options.gis || {};\n\n let geojson;\n try {\n geojson = JSON.parse(text);\n } catch {\n geojson = {};\n }\n\n const table: GeoJSONTable = {\n shape: 'geojson-table',\n // TODO - deduce schema from geojson\n // TODO check that parsed data is of type FeatureCollection\n type: 'FeatureCollection',\n features: geojson?.features || []\n };\n\n switch (options.gis.format) {\n case 'binary':\n return geojsonToBinary(table.features);\n default:\n return table;\n }\n}\n\nfunction parseInBatches(asyncIterator, options): AsyncIterable<TableBatch> {\n // Apps can call the parse method directly, we so apply default options here\n options = {...GeoJSONLoader.options, ...options};\n options.json = {...GeoJSONLoader.options.geojson, ...options.geojson};\n\n const geojsonIterator = parseJSONInBatches(asyncIterator, options);\n\n switch (options.gis.format) {\n case 'binary':\n return makeBinaryGeometryIterator(geojsonIterator);\n default:\n return geojsonIterator as AsyncIterable<TableBatch>;\n }\n}\n\nasync function* makeBinaryGeometryIterator(geojsonIterator) {\n for await (const batch of geojsonIterator) {\n batch.data = geojsonToBinary(batch.data);\n yield batch;\n }\n}\n"],"mappings":"AAOA,SAAQA,eAAe,QAAO,iBAAiB;AAAC,SAExCC,kBAAkB;AAI1B,MAAMC,OAAO,GAAG,sBAAkB,KAAK,WAAW,qBAAiB,QAAQ;AAc3E,OAAO,MAAMC,mBAAsE,GAAG;EACpFC,IAAI,EAAE,SAAS;EACfC,EAAE,EAAE,SAAS;EACbC,MAAM,EAAE,SAAS;EACjBC,OAAO,EAAEL,OAAO;EAChBM,MAAM,EAAE,IAAI;EACZC,UAAU,EAAE,CAAC,SAAS,CAAC;EACvBC,SAAS,EAAE,CAAC,sBAAsB,CAAC;EACnCC,QAAQ,EAAE,UAAU;EACpBC,IAAI,EAAE,IAAI;EACVC,OAAO,EAAE;IACPC,OAAO,EAAE;MACPC,KAAK,EAAE;IACT,CAAC;IACDC,IAAI,EAAE;MACJD,KAAK,EAAE,kBAAkB;MACzBE,SAAS,EAAE,CAAC,GAAG,EAAE,YAAY;IAC/B,CAAC;IACDC,GAAG,EAAE;MACHC,MAAM,EAAE;IACV;EACF;AACF,CAAC;AAED,OAAO,MAAMC,aAA0E,GAAG;EACxF,GAAGjB,mBAAmB;EAEtBkB,KAAK;EAELC,aAAa;EACbC;AACF,CAAC;AAED,eAAeF,KAAKA,CAACG,WAAwB,EAAEX,OAA8B,EAAE;EAC7E,OAAOS,aAAa,CAAC,IAAIG,WAAW,CAAC,CAAC,CAACC,MAAM,CAACF,WAAW,CAAC,EAAEX,OAAO,CAAC;AACtE;AAEA,SAASS,aAAaA,CAACV,IAAY,EAAEC,OAA8B,EAAE;EAAA,IAAAc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D,eAAe,EAAE;EAC1D,WAAW,MAAME,KAAK,IAAIF,eAAe,EAAE;IACzCE,KAAK,CAACC,IAAI,GAAGpC,eAAe,CAACmC,KAAK,CAACC,IAAI,CAAC;IACxC,MAAMD,KAAK;EACb;AACF"}
@@ -2430,7 +2430,7 @@ Char: ${this.c}`;
2430
2430
  }
2431
2431
 
2432
2432
  // src/geojson-loader.ts
2433
- var VERSION = true ? "4.1.0" : "latest";
2433
+ var VERSION = true ? "4.2.0-alpha.1" : "latest";
2434
2434
  var GeoJSONWorkerLoader = {
2435
2435
  name: "GeoJSON",
2436
2436
  id: "geojson",
@@ -1,6 +1,6 @@
1
1
  import { parseJSONSync } from "./lib/parsers/parse-json.js";
2
2
  import { parseJSONInBatches } from "./lib/parsers/parse-json-in-batches.js";
3
- const VERSION = typeof "4.1.0" !== 'undefined' ? "4.1.0" : 'latest';
3
+ const VERSION = typeof "4.2.0-alpha.1" !== 'undefined' ? "4.2.0-alpha.1" : 'latest';
4
4
  export const JSONLoader = {
5
5
  name: 'JSON',
6
6
  id: 'json',
@@ -1 +1 @@
1
- {"version":3,"file":"json-loader.js","names":["parseJSONSync","parseJSONInBatches","VERSION","JSONLoader","name","id","module","version","extensions","mimeTypes","category","text","options","json","shape","undefined","table","jsonpaths","parse","parseTextSync","parseInBatches","arrayBuffer","TextDecoder","decode","jsonOptions","asyncIterator"],"sources":["../src/json-loader.ts"],"sourcesContent":["// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {Table, TableBatch, Batch} from '@loaders.gl/schema';\nimport type {LoaderWithParser, LoaderOptions} from '@loaders.gl/loader-utils';\nimport {parseJSONSync} from './lib/parsers/parse-json';\nimport {parseJSONInBatches} from './lib/parsers/parse-json-in-batches';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\nexport type MetadataBatch = Batch & {\n shape: 'metadata';\n};\n\nexport type JSONBatch = Batch & {\n shape: 'json';\n /** JSON data */\n container: any;\n};\n\n/**\n * @param table -\n * @param jsonpaths -\n */\nexport type JSONLoaderOptions = LoaderOptions & {\n json?: {\n /** Not specifying shape leaves avoids changes */\n shape?: 'object-row-table' | 'array-row-table';\n table?: boolean;\n jsonpaths?: string[];\n };\n};\n\nexport const JSONLoader: LoaderWithParser<\n Table,\n TableBatch | MetadataBatch | JSONBatch,\n JSONLoaderOptions\n> = {\n name: 'JSON',\n id: 'json',\n module: 'json',\n version: VERSION,\n extensions: ['json', 'geojson'],\n mimeTypes: ['application/json'],\n category: 'table',\n text: true,\n options: {\n json: {\n shape: undefined,\n table: false,\n jsonpaths: []\n // batchSize: 'auto'\n }\n },\n parse,\n parseTextSync,\n parseInBatches\n};\n\nasync function parse(arrayBuffer: ArrayBuffer, options?: JSONLoaderOptions) {\n return parseTextSync(new TextDecoder().decode(arrayBuffer), options);\n}\n\nfunction parseTextSync(text: string, options?: JSONLoaderOptions) {\n const jsonOptions = {...options, json: {...JSONLoader.options.json, ...options?.json}};\n return parseJSONSync(text, jsonOptions as JSONLoaderOptions);\n}\n\nfunction parseInBatches(\n asyncIterator: AsyncIterable<ArrayBuffer> | Iterable<ArrayBuffer>,\n options?: JSONLoaderOptions\n): AsyncIterable<TableBatch | MetadataBatch | JSONBatch> {\n const jsonOptions = {...options, json: {...JSONLoader.options.json, ...options?.json}};\n return parseJSONInBatches(asyncIterator, jsonOptions as JSONLoaderOptions);\n}\n"],"mappings":"SAMQA,aAAa;AAAA,SACbC,kBAAkB;AAI1B,MAAMC,OAAO,GAAG,cAAkB,KAAK,WAAW,aAAiB,QAAQ;AAyB3E,OAAO,MAAMC,UAIZ,GAAG;EACFC,IAAI,EAAE,MAAM;EACZC,EAAE,EAAE,MAAM;EACVC,MAAM,EAAE,MAAM;EACdC,OAAO,EAAEL,OAAO;EAChBM,UAAU,EAAE,CAAC,MAAM,EAAE,SAAS,CAAC;EAC/BC,SAAS,EAAE,CAAC,kBAAkB,CAAC;EAC/BC,QAAQ,EAAE,OAAO;EACjBC,IAAI,EAAE,IAAI;EACVC,OAAO,EAAE;IACPC,IAAI,EAAE;MACJC,KAAK,EAAEC,SAAS;MAChBC,KAAK,EAAE,KAAK;MACZC,SAAS,EAAE;IAEb;EACF,CAAC;EACDC,KAAK;EACLC,aAAa;EACbC;AACF,CAAC;AAED,eAAeF,KAAKA,CAACG,WAAwB,EAAET,OAA2B,EAAE;EAC1E,OAAOO,aAAa,CAAC,IAAIG,WAAW,CAAC,CAAC,CAACC,MAAM,CAACF,WAAW,CAAC,EAAET,OAAO,CAAC;AACtE;AAEA,SAASO,aAAaA,CAACR,IAAY,EAAEC,OAA2B,EAAE;EAChE,MAAMY,WAAW,GAAG;IAAC,GAAGZ,OAAO;IAAEC,IAAI,EAAE;MAAC,GAAGV,UAAU,CAACS,OAAO,CAACC,IAAI;MAAE,IAAGD,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEC,IAAI;IAAA;EAAC,CAAC;EACtF,OAAOb,aAAa,CAACW,IAAI,EAAEa,WAAgC,CAAC;AAC9D;AAEA,SAASJ,cAAcA,CACrBK,aAAiE,EACjEb,OAA2B,EAC4B;EACvD,MAAMY,WAAW,GAAG;IAAC,GAAGZ,OAAO;IAAEC,IAAI,EAAE;MAAC,GAAGV,UAAU,CAACS,OAAO,CAACC,IAAI;MAAE,IAAGD,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEC,IAAI;IAAA;EAAC,CAAC;EACtF,OAAOZ,kBAAkB,CAACwB,aAAa,EAAED,WAAgC,CAAC;AAC5E"}
1
+ {"version":3,"file":"json-loader.js","names":["parseJSONSync","parseJSONInBatches","VERSION","JSONLoader","name","id","module","version","extensions","mimeTypes","category","text","options","json","shape","undefined","table","jsonpaths","parse","parseTextSync","parseInBatches","arrayBuffer","TextDecoder","decode","jsonOptions","asyncIterator"],"sources":["../src/json-loader.ts"],"sourcesContent":["// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {Table, TableBatch, Batch} from '@loaders.gl/schema';\nimport type {LoaderWithParser, LoaderOptions} from '@loaders.gl/loader-utils';\nimport {parseJSONSync} from './lib/parsers/parse-json';\nimport {parseJSONInBatches} from './lib/parsers/parse-json-in-batches';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\nexport type MetadataBatch = Batch & {\n shape: 'metadata';\n};\n\nexport type JSONBatch = Batch & {\n shape: 'json';\n /** JSON data */\n container: any;\n};\n\n/**\n * @param table -\n * @param jsonpaths -\n */\nexport type JSONLoaderOptions = LoaderOptions & {\n json?: {\n /** Not specifying shape leaves avoids changes */\n shape?: 'object-row-table' | 'array-row-table';\n table?: boolean;\n jsonpaths?: string[];\n };\n};\n\nexport const JSONLoader: LoaderWithParser<\n Table,\n TableBatch | MetadataBatch | JSONBatch,\n JSONLoaderOptions\n> = {\n name: 'JSON',\n id: 'json',\n module: 'json',\n version: VERSION,\n extensions: ['json', 'geojson'],\n mimeTypes: ['application/json'],\n category: 'table',\n text: true,\n options: {\n json: {\n shape: undefined,\n table: false,\n jsonpaths: []\n // batchSize: 'auto'\n }\n },\n parse,\n parseTextSync,\n parseInBatches\n};\n\nasync function parse(arrayBuffer: ArrayBuffer, options?: JSONLoaderOptions) {\n return parseTextSync(new TextDecoder().decode(arrayBuffer), options);\n}\n\nfunction parseTextSync(text: string, options?: JSONLoaderOptions) {\n const jsonOptions = {...options, json: {...JSONLoader.options.json, ...options?.json}};\n return parseJSONSync(text, jsonOptions as JSONLoaderOptions);\n}\n\nfunction parseInBatches(\n asyncIterator: AsyncIterable<ArrayBuffer> | Iterable<ArrayBuffer>,\n options?: JSONLoaderOptions\n): AsyncIterable<TableBatch | MetadataBatch | JSONBatch> {\n const jsonOptions = {...options, json: {...JSONLoader.options.json, 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AGD,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEC,IAAI;IAAA;EAAC,CAAC;EACtF,OAAOZ,kBAAkB,CAACwB,aAAa,EAAED,WAAgC,CAAC;AAC5E"}
@@ -1,6 +1,6 @@
1
1
  import { parseNDJSONSync } from "./lib/parsers/parse-ndjson.js";
2
2
  import { parseNDJSONInBatches } from "./lib/parsers/parse-ndjson-in-batches.js";
3
- const VERSION = typeof "4.1.0" !== 'undefined' ? "4.1.0" : 'latest';
3
+ const VERSION = typeof "4.2.0-alpha.1" !== 'undefined' ? "4.2.0-alpha.1" : 'latest';
4
4
  export const NDJSONLoader = {
5
5
  name: 'NDJSON',
6
6
  id: 'ndjson',
@@ -1 +1 @@
1
- {"version":3,"file":"ndgeoson-loader.js","names":["parseNDJSONSync","parseNDJSONInBatches","VERSION","NDJSONLoader","name","id","module","version","extensions","mimeTypes","category","text","parse","arrayBuffer","TextDecoder","decode","parseTextSync","parseInBatches","options","geojson","shape","gis","format"],"sources":["../src/ndgeoson-loader.ts"],"sourcesContent":["import type {LoaderWithParser, LoaderOptions} from '@loaders.gl/loader-utils';\nimport {parseNDJSONSync} from './lib/parsers/parse-ndjson';\nimport {parseNDJSONInBatches} from './lib/parsers/parse-ndjson-in-batches';\nimport {ArrayRowTable, ObjectRowTable, Batch} from '@loaders.gl/schema';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\n/** Options for NDGeoJSONLoader */\nexport type NDGeoJSONLoaderOptions = LoaderOptions & {\n geojson?: {\n shape?: 'object-row-table';\n };\n gis?: {\n format: 'geojson';\n };\n};\n\n/** NDGeoJSONLoader */\nexport const NDJSONLoader: LoaderWithParser<\n ArrayRowTable | ObjectRowTable,\n Batch,\n NDGeoJSONLoaderOptions\n> = {\n name: 'NDJSON',\n id: 'ndjson',\n module: 'json',\n version: VERSION,\n extensions: ['ndjson', 'ndgeojson'],\n mimeTypes: [\n 'application/geo+x-ndjson',\n 'application/geo+x-ldjson',\n 'application/jsonlines', // https://docs.aws.amazon.com/sagemaker/latest/dg/cdf-inference.html#cm-batch\n 'application/geo+json-seq',\n 'application/x-ndjson'\n ],\n category: 'table',\n text: true,\n parse: async (arrayBuffer: ArrayBuffer) => parseNDJSONSync(new TextDecoder().decode(arrayBuffer)),\n parseTextSync: parseNDJSONSync,\n parseInBatches: parseNDJSONInBatches,\n options: {\n geojson: {\n shape: 'object-row-table'\n },\n gis: {\n format: 'geojson'\n }\n }\n};\n"],"mappings":"SACQA,eAAe;AAAA,SACfC,oBAAoB;AAK5B,MAAMC,OAAO,GAAG,cAAkB,KAAK,WAAW,aAAiB,QAAQ;AAa3E,OAAO,MAAMC,YAIZ,GAAG;EACFC,IAAI,EAAE,QAAQ;EACdC,EAAE,EAAE,QAAQ;EACZC,MAAM,EAAE,MAAM;EACdC,OAAO,EAAEL,OAAO;EAChBM,UAAU,EAAE,CAAC,QAAQ,EAAE,WAAW,CAAC;EACnCC,SAAS,EAAE,CACT,0BAA0B,EAC1B,0BAA0B,EAC1B,uBAAuB,EACvB,0BAA0B,EAC1B,sBAAsB,CACvB;EACDC,QAAQ,EAAE,OAAO;EACjBC,IAAI,EAAE,IAAI;EACVC,KAAK,EAAE,MAAOC,WAAwB,IAAKb,eAAe,CAAC,IAAIc,WAAW,CAAC,CAAC,CAACC,MAAM,CAACF,WAAW,CAAC,CAAC;EACjGG,aAAa,EAAEhB,eAAe;EAC9BiB,cAAc,EAAEhB,oBAAoB;EACpCiB,OAAO,EAAE;IACPC,OAAO,EAAE;MACPC,KAAK,EAAE;IACT,CAAC;IACDC,GAAG,EAAE;MACHC,MAAM,EAAE;IACV;EACF;AACF,CAAC"}
1
+ {"version":3,"file":"ndgeoson-loader.js","names":["parseNDJSONSync","parseNDJSONInBatches","VERSION","NDJSONLoader","name","id","module","version","extensions","mimeTypes","category","text","parse","arrayBuffer","TextDecoder","decode","parseTextSync","parseInBatches","options","geojson","shape","gis","format"],"sources":["../src/ndgeoson-loader.ts"],"sourcesContent":["import type {LoaderWithParser, LoaderOptions} from '@loaders.gl/loader-utils';\nimport {parseNDJSONSync} from './lib/parsers/parse-ndjson';\nimport {parseNDJSONInBatches} from './lib/parsers/parse-ndjson-in-batches';\nimport {ArrayRowTable, ObjectRowTable, Batch} from '@loaders.gl/schema';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\n/** Options for NDGeoJSONLoader */\nexport type NDGeoJSONLoaderOptions = LoaderOptions & {\n geojson?: {\n shape?: 'object-row-table';\n };\n gis?: {\n format: 'geojson';\n };\n};\n\n/** NDGeoJSONLoader */\nexport const NDJSONLoader: LoaderWithParser<\n ArrayRowTable | ObjectRowTable,\n Batch,\n NDGeoJSONLoaderOptions\n> = {\n name: 'NDJSON',\n id: 'ndjson',\n module: 'json',\n version: VERSION,\n extensions: ['ndjson', 'ndgeojson'],\n mimeTypes: [\n 'application/geo+x-ndjson',\n 'application/geo+x-ldjson',\n 'application/jsonlines', // https://docs.aws.amazon.com/sagemaker/latest/dg/cdf-inference.html#cm-batch\n 'application/geo+json-seq',\n 'application/x-ndjson'\n ],\n category: 'table',\n text: true,\n parse: async (arrayBuffer: ArrayBuffer) => parseNDJSONSync(new TextDecoder().decode(arrayBuffer)),\n parseTextSync: parseNDJSONSync,\n parseInBatches: parseNDJSONInBatches,\n options: {\n geojson: {\n shape: 'object-row-table'\n },\n gis: {\n format: 'geojson'\n }\n }\n};\n"],"mappings":"SACQA,eAAe;AAAA,SACfC,oBAAoB;AAK5B,MAAMC,OAAO,GAAG,sBAAkB,KAAK,WAAW,qBAAiB,QAAQ;AAa3E,OAAO,MAAMC,YAIZ,GAAG;EACFC,IAAI,EAAE,QAAQ;EACdC,EAAE,EAAE,QAAQ;EACZC,MAAM,EAAE,MAAM;EACdC,OAAO,EAAEL,OAAO;EAChBM,UAAU,EAAE,CAAC,QAAQ,EAAE,WAAW,CAAC;EACnCC,SAAS,EAAE,CACT,0BAA0B,EAC1B,0BAA0B,EAC1B,uBAAuB,EACvB,0BAA0B,EAC1B,sBAAsB,CACvB;EACDC,QAAQ,EAAE,OAAO;EACjBC,IAAI,EAAE,IAAI;EACVC,KAAK,EAAE,MAAOC,WAAwB,IAAKb,eAAe,CAAC,IAAIc,WAAW,CAAC,CAAC,CAACC,MAAM,CAACF,WAAW,CAAC,CAAC;EACjGG,aAAa,EAAEhB,eAAe;EAC9BiB,cAAc,EAAEhB,oBAAoB;EACpCiB,OAAO,EAAE;IACPC,OAAO,EAAE;MACPC,KAAK,EAAE;IACT,CAAC;IACDC,GAAG,EAAE;MACHC,MAAM,EAAE;IACV;EACF;AACF,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import { parseNDJSONSync } from "./lib/parsers/parse-ndjson.js";
2
2
  import { parseNDJSONInBatches } from "./lib/parsers/parse-ndjson-in-batches.js";
3
- const VERSION = typeof "4.1.0" !== 'undefined' ? "4.1.0" : 'latest';
3
+ const VERSION = typeof "4.2.0-alpha.1" !== 'undefined' ? "4.2.0-alpha.1" : 'latest';
4
4
  export const NDJSONLoader = {
5
5
  name: 'NDJSON',
6
6
  id: 'ndjson',
@@ -1 +1 @@
1
- {"version":3,"file":"ndjson-loader.js","names":["parseNDJSONSync","parseNDJSONInBatches","VERSION","NDJSONLoader","name","id","module","version","extensions","mimeTypes","category","text","parse","arrayBuffer","TextDecoder","decode","parseTextSync","parseInBatches","options"],"sources":["../src/ndjson-loader.ts"],"sourcesContent":["// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {LoaderWithParser, LoaderOptions} from '@loaders.gl/loader-utils';\nimport {ObjectRowTable, ArrayRowTable, TableBatch} from '@loaders.gl/schema';\nimport {parseNDJSONSync} from './lib/parsers/parse-ndjson';\nimport {parseNDJSONInBatches} from './lib/parsers/parse-ndjson-in-batches';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\nexport const NDJSONLoader: LoaderWithParser<\n ObjectRowTable | ArrayRowTable,\n TableBatch,\n LoaderOptions\n> = {\n name: 'NDJSON',\n id: 'ndjson',\n module: 'json',\n version: VERSION,\n extensions: ['ndjson', 'jsonl'],\n mimeTypes: [\n 'application/x-ndjson',\n 'application/jsonlines', // https://docs.aws.amazon.com/sagemaker/latest/dg/cdf-inference.html#cm-batch\n 'application/json-seq'\n ],\n category: 'table',\n text: true,\n parse: async (arrayBuffer: ArrayBuffer) => parseNDJSONSync(new TextDecoder().decode(arrayBuffer)),\n parseTextSync: parseNDJSONSync,\n parseInBatches: parseNDJSONInBatches,\n options: {}\n};\n"],"mappings":"SAMQA,eAAe;AAAA,SACfC,oBAAoB;AAI5B,MAAMC,OAAO,GAAG,cAAkB,KAAK,WAAW,aAAiB,QAAQ;AAE3E,OAAO,MAAMC,YAIZ,GAAG;EACFC,IAAI,EAAE,QAAQ;EACdC,EAAE,EAAE,QAAQ;EACZC,MAAM,EAAE,MAAM;EACdC,OAAO,EAAEL,OAAO;EAChBM,UAAU,EAAE,CAAC,QAAQ,EAAE,OAAO,CAAC;EAC/BC,SAAS,EAAE,CACT,sBAAsB,EACtB,uBAAuB,EACvB,sBAAsB,CACvB;EACDC,QAAQ,EAAE,OAAO;EACjBC,IAAI,EAAE,IAAI;EACVC,KAAK,EAAE,MAAOC,WAAwB,IAAKb,eAAe,CAAC,IAAIc,WAAW,CAAC,CAAC,CAACC,MAAM,CAACF,WAAW,CAAC,CAAC;EACjGG,aAAa,EAAEhB,eAAe;EAC9BiB,cAAc,EAAEhB,oBAAoB;EACpCiB,OAAO,EAAE,CAAC;AACZ,CAAC"}
1
+ {"version":3,"file":"ndjson-loader.js","names":["parseNDJSONSync","parseNDJSONInBatches","VERSION","NDJSONLoader","name","id","module","version","extensions","mimeTypes","category","text","parse","arrayBuffer","TextDecoder","decode","parseTextSync","parseInBatches","options"],"sources":["../src/ndjson-loader.ts"],"sourcesContent":["// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {LoaderWithParser, LoaderOptions} from '@loaders.gl/loader-utils';\nimport {ObjectRowTable, ArrayRowTable, TableBatch} from '@loaders.gl/schema';\nimport {parseNDJSONSync} from './lib/parsers/parse-ndjson';\nimport {parseNDJSONInBatches} from './lib/parsers/parse-ndjson-in-batches';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\nexport const NDJSONLoader: LoaderWithParser<\n ObjectRowTable | ArrayRowTable,\n TableBatch,\n LoaderOptions\n> = {\n name: 'NDJSON',\n id: 'ndjson',\n module: 'json',\n version: VERSION,\n extensions: ['ndjson', 'jsonl'],\n mimeTypes: [\n 'application/x-ndjson',\n 'application/jsonlines', // https://docs.aws.amazon.com/sagemaker/latest/dg/cdf-inference.html#cm-batch\n 'application/json-seq'\n ],\n category: 'table',\n text: true,\n parse: async (arrayBuffer: ArrayBuffer) => parseNDJSONSync(new TextDecoder().decode(arrayBuffer)),\n parseTextSync: parseNDJSONSync,\n parseInBatches: parseNDJSONInBatches,\n options: {}\n};\n"],"mappings":"SAMQA,eAAe;AAAA,SACfC,oBAAoB;AAI5B,MAAMC,OAAO,GAAG,sBAAkB,KAAK,WAAW,qBAAiB,QAAQ;AAE3E,OAAO,MAAMC,YAIZ,GAAG;EACFC,IAAI,EAAE,QAAQ;EACdC,EAAE,EAAE,QAAQ;EACZC,MAAM,EAAE,MAAM;EACdC,OAAO,EAAEL,OAAO;EAChBM,UAAU,EAAE,CAAC,QAAQ,EAAE,OAAO,CAAC;EAC/BC,SAAS,EAAE,CACT,sBAAsB,EACtB,uBAAuB,EACvB,sBAAsB,CACvB;EACDC,QAAQ,EAAE,OAAO;EACjBC,IAAI,EAAE,IAAI;EACVC,KAAK,EAAE,MAAOC,WAAwB,IAAKb,eAAe,CAAC,IAAIc,WAAW,CAAC,CAAC,CAACC,MAAM,CAACF,WAAW,CAAC,CAAC;EACjGG,aAAa,EAAEhB,eAAe;EAC9BiB,cAAc,EAAEhB,oBAAoB;EACpCiB,OAAO,EAAE,CAAC;AACZ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loaders.gl/json",
3
- "version": "4.1.0",
3
+ "version": "4.2.0-alpha.1",
4
4
  "description": "Framework-independent loader for JSON and streaming JSON formats",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -43,9 +43,9 @@
43
43
  "build-worker": "esbuild src/workers/geojson-worker.ts --bundle --outfile=dist/geojson-worker.js --define:__VERSION__=\\\"$npm_package_version\\\""
44
44
  },
45
45
  "dependencies": {
46
- "@loaders.gl/gis": "4.1.0",
47
- "@loaders.gl/loader-utils": "4.1.0",
48
- "@loaders.gl/schema": "4.1.0"
46
+ "@loaders.gl/gis": "4.2.0-alpha.1",
47
+ "@loaders.gl/loader-utils": "4.2.0-alpha.1",
48
+ "@loaders.gl/schema": "4.2.0-alpha.1"
49
49
  },
50
- "gitHead": "75961cc7a6ed6679018c0e3fb6eb5c3c74d97bdb"
50
+ "gitHead": "d4da81f4d8fb2a3b43b0e025109cf7ccfb317d4c"
51
51
  }