@loaders.gl/json 3.4.10 → 3.4.12

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.
@@ -17,7 +17,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
17
17
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
18
18
  function _asyncIterator(iterable) { var method, async, sync, retry = 2; for ("undefined" != typeof Symbol && (async = Symbol.asyncIterator, sync = Symbol.iterator); retry--;) { if (async && null != (method = iterable[async])) return method.call(iterable); if (sync && null != (method = iterable[sync])) return new AsyncFromSyncIterator(method.call(iterable)); async = "@@asyncIterator", sync = "@@iterator"; } throw new TypeError("Object is not async iterable"); }
19
19
  function AsyncFromSyncIterator(s) { function AsyncFromSyncIteratorContinuation(r) { if (Object(r) !== r) return Promise.reject(new TypeError(r + " is not an object.")); var done = r.done; return Promise.resolve(r.value).then(function (value) { return { value: value, done: done }; }); } return AsyncFromSyncIterator = function AsyncFromSyncIterator(s) { this.s = s, this.n = s.next; }, AsyncFromSyncIterator.prototype = { s: null, n: null, next: function next() { return AsyncFromSyncIteratorContinuation(this.n.apply(this.s, arguments)); }, return: function _return(value) { var ret = this.s.return; return void 0 === ret ? Promise.resolve({ value: value, done: !0 }) : AsyncFromSyncIteratorContinuation(ret.apply(this.s, arguments)); }, throw: function _throw(value) { var thr = this.s.return; return void 0 === thr ? Promise.reject(value) : AsyncFromSyncIteratorContinuation(thr.apply(this.s, arguments)); } }, new AsyncFromSyncIterator(s); }
20
- var VERSION = typeof "3.4.10" !== 'undefined' ? "3.4.10" : 'latest';
20
+ var VERSION = typeof "3.4.12" !== 'undefined' ? "3.4.12" : 'latest';
21
21
  var DEFAULT_GEOJSON_LOADER_OPTIONS = {
22
22
  geojson: {
23
23
  shape: 'object-row-table'
@@ -12,7 +12,7 @@ var _parseJson = _interopRequireDefault(require("./lib/parse-json"));
12
12
  var _parseJsonInBatches = _interopRequireDefault(require("./lib/parse-json-in-batches"));
13
13
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
14
14
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
15
- var VERSION = typeof "3.4.10" !== 'undefined' ? "3.4.10" : 'latest';
15
+ var VERSION = typeof "3.4.12" !== 'undefined' ? "3.4.12" : 'latest';
16
16
  var DEFAULT_JSON_LOADER_OPTIONS = {
17
17
  json: {
18
18
  shape: 'row-table',
@@ -9,7 +9,7 @@ var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"))
9
9
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
10
10
  var _parseNdjson = _interopRequireDefault(require("./lib/parse-ndjson"));
11
11
  var _parseNdjsonInBatches = _interopRequireDefault(require("./lib/parse-ndjson-in-batches"));
12
- var VERSION = typeof "3.4.10" !== 'undefined' ? "3.4.10" : 'latest';
12
+ var VERSION = typeof "3.4.12" !== 'undefined' ? "3.4.12" : 'latest';
13
13
  var DEFAULT_NDGEOJSON_LOADER_OPTIONS = {
14
14
  geojson: {
15
15
  shape: 'object-row-table'
@@ -9,7 +9,7 @@ var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"))
9
9
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
10
10
  var _parseNdjson = _interopRequireDefault(require("./lib/parse-ndjson"));
11
11
  var _parseNdjsonInBatches = _interopRequireDefault(require("./lib/parse-ndjson-in-batches"));
12
- var VERSION = typeof "3.4.10" !== 'undefined' ? "3.4.10" : 'latest';
12
+ var VERSION = typeof "3.4.12" !== 'undefined' ? "3.4.12" : 'latest';
13
13
  var NDJSONLoader = {
14
14
  name: 'NDJSON',
15
15
  id: 'ndjson',
@@ -1,7 +1,7 @@
1
1
  import { geojsonToBinary } from '@loaders.gl/gis';
2
2
  import parseJSONSync from './lib/parse-json';
3
3
  import parseJSONInBatches from './lib/parse-json-in-batches';
4
- const VERSION = typeof "3.4.10" !== 'undefined' ? "3.4.10" : 'latest';
4
+ const VERSION = typeof "3.4.12" !== 'undefined' ? "3.4.12" : 'latest';
5
5
  const DEFAULT_GEOJSON_LOADER_OPTIONS = {
6
6
  geojson: {
7
7
  shape: 'object-row-table'
@@ -1,6 +1,6 @@
1
1
  import parseJSONSync from './lib/parse-json';
2
2
  import parseJSONInBatches from './lib/parse-json-in-batches';
3
- const VERSION = typeof "3.4.10" !== 'undefined' ? "3.4.10" : 'latest';
3
+ const VERSION = typeof "3.4.12" !== 'undefined' ? "3.4.12" : 'latest';
4
4
  const DEFAULT_JSON_LOADER_OPTIONS = {
5
5
  json: {
6
6
  shape: 'row-table',
@@ -1,6 +1,6 @@
1
1
  import parseNDJSONSync from './lib/parse-ndjson';
2
2
  import parseNDJSONInBatches from './lib/parse-ndjson-in-batches';
3
- const VERSION = typeof "3.4.10" !== 'undefined' ? "3.4.10" : 'latest';
3
+ const VERSION = typeof "3.4.12" !== 'undefined' ? "3.4.12" : 'latest';
4
4
  const DEFAULT_NDGEOJSON_LOADER_OPTIONS = {
5
5
  geojson: {
6
6
  shape: 'object-row-table'
@@ -1,6 +1,6 @@
1
1
  import parseNDJSONSync from './lib/parse-ndjson';
2
2
  import parseNDJSONInBatches from './lib/parse-ndjson-in-batches';
3
- const VERSION = typeof "3.4.10" !== 'undefined' ? "3.4.10" : 'latest';
3
+ const VERSION = typeof "3.4.12" !== 'undefined' ? "3.4.12" : 'latest';
4
4
  export const NDJSONLoader = {
5
5
  name: 'NDJSON',
6
6
  id: 'ndjson',
@@ -2276,7 +2276,7 @@ Char: ${this.c}`;
2276
2276
  }
2277
2277
 
2278
2278
  // src/geojson-loader.ts
2279
- var VERSION = true ? "3.4.10" : "latest";
2279
+ var VERSION = true ? "3.4.12" : "latest";
2280
2280
  var DEFAULT_GEOJSON_LOADER_OPTIONS = {
2281
2281
  geojson: {
2282
2282
  shape: "object-row-table"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loaders.gl/json",
3
- "version": "3.4.10",
3
+ "version": "3.4.12",
4
4
  "description": "Framework-independent loader for JSON and streaming JSON formats",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
@@ -35,9 +35,9 @@
35
35
  "build-worker": "esbuild src/workers/geojson-worker.ts --bundle --outfile=dist/geojson-worker.js --define:__VERSION__=\\\"$npm_package_version\\\""
36
36
  },
37
37
  "dependencies": {
38
- "@loaders.gl/gis": "3.4.10",
39
- "@loaders.gl/loader-utils": "3.4.10",
40
- "@loaders.gl/schema": "3.4.10"
38
+ "@loaders.gl/gis": "3.4.12",
39
+ "@loaders.gl/loader-utils": "3.4.12",
40
+ "@loaders.gl/schema": "3.4.12"
41
41
  },
42
- "gitHead": "4568459c96eaf0480a50ab77cace355307f61f04"
42
+ "gitHead": "85254762ae3082f608a863291deef09f2b40c6cf"
43
43
  }
package/dist/bundle.js DELETED
@@ -1,5 +0,0 @@
1
- "use strict";
2
- // @ts-nocheck
3
- const moduleExports = require('./index');
4
- globalThis.loaders = globalThis.loaders || {};
5
- module.exports = Object.assign(globalThis.loaders, moduleExports);
@@ -1,78 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.GeoJSONLoader = exports.GeoJSONWorkerLoader = void 0;
7
- const gis_1 = require("@loaders.gl/gis");
8
- const parse_json_1 = __importDefault(require("./lib/parse-json"));
9
- const parse_json_in_batches_1 = __importDefault(require("./lib/parse-json-in-batches"));
10
- // __VERSION__ is injected by babel-plugin-version-inline
11
- // @ts-ignore TS2304: Cannot find name '__VERSION__'.
12
- const VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';
13
- const DEFAULT_GEOJSON_LOADER_OPTIONS = {
14
- geojson: {
15
- shape: 'object-row-table'
16
- },
17
- json: {
18
- jsonpaths: ['$', '$.features']
19
- },
20
- gis: {
21
- format: 'geojson'
22
- }
23
- };
24
- /**
25
- * GeoJSON loader
26
- */
27
- exports.GeoJSONWorkerLoader = {
28
- name: 'GeoJSON',
29
- id: 'geojson',
30
- module: 'geojson',
31
- version: VERSION,
32
- worker: true,
33
- extensions: ['geojson'],
34
- mimeTypes: ['application/geo+json'],
35
- category: 'geometry',
36
- text: true,
37
- options: DEFAULT_GEOJSON_LOADER_OPTIONS
38
- };
39
- exports.GeoJSONLoader = {
40
- ...exports.GeoJSONWorkerLoader,
41
- parse,
42
- parseTextSync,
43
- parseInBatches
44
- };
45
- async function parse(arrayBuffer, options) {
46
- return parseTextSync(new TextDecoder().decode(arrayBuffer), options);
47
- }
48
- function parseTextSync(text, options) {
49
- // Apps can call the parse method directly, we so apply default options here
50
- options = { ...DEFAULT_GEOJSON_LOADER_OPTIONS, ...options };
51
- options.json = { ...DEFAULT_GEOJSON_LOADER_OPTIONS.geojson, ...options.geojson };
52
- options.gis = options.gis || {};
53
- const json = (0, parse_json_1.default)(text, options);
54
- switch (options.gis.format) {
55
- case 'binary':
56
- return (0, gis_1.geojsonToBinary)(json);
57
- default:
58
- return json;
59
- }
60
- }
61
- function parseInBatches(asyncIterator, options) {
62
- // Apps can call the parse method directly, we so apply default options here
63
- options = { ...DEFAULT_GEOJSON_LOADER_OPTIONS, ...options };
64
- options.json = { ...DEFAULT_GEOJSON_LOADER_OPTIONS.geojson, ...options.geojson };
65
- const geojsonIterator = (0, parse_json_in_batches_1.default)(asyncIterator, options);
66
- switch (options.gis.format) {
67
- case 'binary':
68
- return makeBinaryGeometryIterator(geojsonIterator);
69
- default:
70
- return geojsonIterator;
71
- }
72
- }
73
- async function* makeBinaryGeometryIterator(geojsonIterator) {
74
- for await (const batch of geojsonIterator) {
75
- batch.data = (0, gis_1.geojsonToBinary)(batch.data);
76
- yield batch;
77
- }
78
- }
package/dist/index.js DELETED
@@ -1,19 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports._rebuildJsonObject = exports._ClarinetParser = exports._JSONPath = exports._GeoJSONWorkerLoader = exports._GeoJSONLoader = exports.NDJSONLoader = exports.JSONLoader = void 0;
7
- var json_loader_1 = require("./json-loader");
8
- Object.defineProperty(exports, "JSONLoader", { enumerable: true, get: function () { return json_loader_1.JSONLoader; } });
9
- var ndjson_loader_1 = require("./ndjson-loader");
10
- Object.defineProperty(exports, "NDJSONLoader", { enumerable: true, get: function () { return ndjson_loader_1.NDJSONLoader; } });
11
- var geojson_loader_1 = require("./geojson-loader");
12
- Object.defineProperty(exports, "_GeoJSONLoader", { enumerable: true, get: function () { return geojson_loader_1.GeoJSONLoader; } });
13
- Object.defineProperty(exports, "_GeoJSONWorkerLoader", { enumerable: true, get: function () { return geojson_loader_1.GeoJSONWorkerLoader; } });
14
- var jsonpath_1 = require("./lib/jsonpath/jsonpath");
15
- Object.defineProperty(exports, "_JSONPath", { enumerable: true, get: function () { return __importDefault(jsonpath_1).default; } });
16
- var clarinet_1 = require("./lib/clarinet/clarinet");
17
- Object.defineProperty(exports, "_ClarinetParser", { enumerable: true, get: function () { return __importDefault(clarinet_1).default; } });
18
- var parse_json_in_batches_1 = require("./lib/parse-json-in-batches");
19
- Object.defineProperty(exports, "_rebuildJsonObject", { enumerable: true, get: function () { return parse_json_in_batches_1.rebuildJsonObject; } });
@@ -1,44 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.JSONLoader = void 0;
7
- const parse_json_1 = __importDefault(require("./lib/parse-json"));
8
- const parse_json_in_batches_1 = __importDefault(require("./lib/parse-json-in-batches"));
9
- // __VERSION__ is injected by babel-plugin-version-inline
10
- // @ts-ignore TS2304: Cannot find name '__VERSION__'.
11
- const VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';
12
- const DEFAULT_JSON_LOADER_OPTIONS = {
13
- json: {
14
- shape: 'row-table',
15
- table: false,
16
- jsonpaths: []
17
- // batchSize: 'auto'
18
- }
19
- };
20
- exports.JSONLoader = {
21
- name: 'JSON',
22
- id: 'json',
23
- module: 'json',
24
- version: VERSION,
25
- extensions: ['json', 'geojson'],
26
- mimeTypes: ['application/json'],
27
- category: 'table',
28
- text: true,
29
- parse,
30
- parseTextSync,
31
- parseInBatches,
32
- options: DEFAULT_JSON_LOADER_OPTIONS
33
- };
34
- async function parse(arrayBuffer, options) {
35
- return parseTextSync(new TextDecoder().decode(arrayBuffer), options);
36
- }
37
- function parseTextSync(text, options) {
38
- const jsonOptions = { ...options, json: { ...DEFAULT_JSON_LOADER_OPTIONS.json, ...options?.json } };
39
- return (0, parse_json_1.default)(text, jsonOptions);
40
- }
41
- function parseInBatches(asyncIterator, options) {
42
- const jsonOptions = { ...options, json: { ...DEFAULT_JSON_LOADER_OPTIONS.json, ...options?.json } };
43
- return (0, parse_json_in_batches_1.default)(asyncIterator, jsonOptions);
44
- }