@loaders.gl/json 4.0.2 → 4.0.4
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/geojson-worker.js +4 -14
- package/dist/geojson-writer.d.ts +2 -2
- package/dist/geojson-writer.d.ts.map +1 -1
- package/dist/geojson-writer.js.map +1 -1
- package/dist/json-writer.d.ts +2 -2
- package/dist/json-writer.d.ts.map +1 -1
- package/dist/json-writer.js.map +1 -1
- package/package.json +5 -5
- package/src/geojson-writer.ts +2 -2
- package/src/json-writer.ts +2 -2
package/dist/geojson-worker.js
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
(() => {
|
|
3
|
+
// ../worker-utils/src/lib/node/worker_threads-browser.ts
|
|
4
|
+
var parentPort = null;
|
|
5
|
+
|
|
3
6
|
// ../worker-utils/src/lib/worker-utils/get-transfer-list.ts
|
|
4
7
|
function getTransferList(object, recursive = true, transfers) {
|
|
5
8
|
const transfersSet = transfers || /* @__PURE__ */ new Set();
|
|
@@ -37,19 +40,6 @@
|
|
|
37
40
|
|
|
38
41
|
// ../worker-utils/src/lib/worker-farm/worker-body.ts
|
|
39
42
|
async function getParentPort() {
|
|
40
|
-
let parentPort;
|
|
41
|
-
try {
|
|
42
|
-
eval("globalThis.parentPort = require('worker_threads').parentPort");
|
|
43
|
-
parentPort = globalThis.parentPort;
|
|
44
|
-
} catch {
|
|
45
|
-
try {
|
|
46
|
-
eval("globalThis.workerThreadsPromise = import('worker_threads')");
|
|
47
|
-
const workerThreads = await globalThis.workerThreadsPromise;
|
|
48
|
-
parentPort = workerThreads.parentPort;
|
|
49
|
-
} catch (error) {
|
|
50
|
-
console.error(error.message);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
43
|
return parentPort;
|
|
54
44
|
}
|
|
55
45
|
var onMessageWrapperMap = /* @__PURE__ */ new Map();
|
|
@@ -2425,7 +2415,7 @@ Char: ${this.c}`;
|
|
|
2425
2415
|
}
|
|
2426
2416
|
|
|
2427
2417
|
// src/geojson-loader.ts
|
|
2428
|
-
var VERSION = true ? "4.0.
|
|
2418
|
+
var VERSION = true ? "4.0.4" : "latest";
|
|
2429
2419
|
var GeoJSONWorkerLoader = {
|
|
2430
2420
|
name: "GeoJSON",
|
|
2431
2421
|
id: "geojson",
|
package/dist/geojson-writer.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { WriterWithEncoder, WriterOptions } from '@loaders.gl/loader-utils';
|
|
2
2
|
import type { Table, TableBatch } from '@loaders.gl/schema';
|
|
3
3
|
export type GeoJSONWriterOptions = WriterOptions & {
|
|
4
4
|
geojson?: {
|
|
@@ -7,5 +7,5 @@ export type GeoJSONWriterOptions = WriterOptions & {
|
|
|
7
7
|
};
|
|
8
8
|
chunkSize?: number;
|
|
9
9
|
};
|
|
10
|
-
export declare const GeoJSONWriter:
|
|
10
|
+
export declare const GeoJSONWriter: WriterWithEncoder<Table, TableBatch, GeoJSONWriterOptions>;
|
|
11
11
|
//# sourceMappingURL=geojson-writer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"geojson-writer.d.ts","sourceRoot":"","sources":["../src/geojson-writer.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,
|
|
1
|
+
{"version":3,"file":"geojson-writer.d.ts","sourceRoot":"","sources":["../src/geojson-writer.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,iBAAiB,EAAE,aAAa,EAAC,MAAM,0BAA0B,CAAC;AAC/E,OAAO,KAAK,EAAC,KAAK,EAAE,UAAU,EAAC,MAAM,oBAAoB,CAAC;AAG1D,MAAM,MAAM,oBAAoB,GAAG,aAAa,GAAG;IACjD,OAAO,CAAC,EAAE;QACR,YAAY,CAAC,EAAE,OAAO,CAAC;QACvB,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;KAChC,CAAC;IACF,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,iBAAiB,CAAC,KAAK,EAAE,UAAU,EAAE,oBAAoB,CAgBpF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"geojson-writer.js","names":["encodeTableAsGeojsonInBatches","GeoJSONWriter","id","version","module","name","extensions","mimeTypes","options","geojson","featureArray","geometryColumn","text","encodeInBatches","tableIterator"],"sources":["../src/geojson-writer.ts"],"sourcesContent":["// loaders.gl, MIT license\n// Copyright (c) vis.gl contributors\n// Copyright Foursquare, Inc 20222\n\nimport type {
|
|
1
|
+
{"version":3,"file":"geojson-writer.js","names":["encodeTableAsGeojsonInBatches","GeoJSONWriter","id","version","module","name","extensions","mimeTypes","options","geojson","featureArray","geometryColumn","text","encodeInBatches","tableIterator"],"sources":["../src/geojson-writer.ts"],"sourcesContent":["// loaders.gl, MIT license\n// Copyright (c) vis.gl contributors\n// Copyright Foursquare, Inc 20222\n\nimport type {WriterWithEncoder, WriterOptions} from '@loaders.gl/loader-utils';\nimport type {Table, TableBatch} from '@loaders.gl/schema';\nimport {encodeTableAsGeojsonInBatches} from './lib/encoders/geojson-encoder';\n\nexport type GeoJSONWriterOptions = WriterOptions & {\n geojson?: {\n featureArray?: boolean;\n geometryColumn?: number | null;\n };\n chunkSize?: number;\n};\n\nexport const GeoJSONWriter: WriterWithEncoder<Table, TableBatch, GeoJSONWriterOptions> = {\n id: 'geojson',\n version: 'latest',\n module: 'geojson',\n name: 'GeoJSON',\n extensions: ['geojson'],\n mimeTypes: ['application/geo+json'],\n options: {\n geojson: {\n featureArray: false,\n geometryColumn: null\n }\n },\n text: true,\n encodeInBatches: (tableIterator: AsyncIterable<TableBatch>, options) =>\n encodeTableAsGeojsonInBatches(tableIterator, options)\n};\n"],"mappings":"SAMQA,6BAA6B;AAUrC,OAAO,MAAMC,aAAyE,GAAG;EACvFC,EAAE,EAAE,SAAS;EACbC,OAAO,EAAE,QAAQ;EACjBC,MAAM,EAAE,SAAS;EACjBC,IAAI,EAAE,SAAS;EACfC,UAAU,EAAE,CAAC,SAAS,CAAC;EACvBC,SAAS,EAAE,CAAC,sBAAsB,CAAC;EACnCC,OAAO,EAAE;IACPC,OAAO,EAAE;MACPC,YAAY,EAAE,KAAK;MACnBC,cAAc,EAAE;IAClB;EACF,CAAC;EACDC,IAAI,EAAE,IAAI;EACVC,eAAe,EAAEA,CAACC,aAAwC,EAAEN,OAAO,KACjER,6BAA6B,CAACc,aAAa,EAAEN,OAAO;AACxD,CAAC"}
|
package/dist/json-writer.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { WriterWithEncoder, WriterOptions } from '@loaders.gl/loader-utils';
|
|
2
2
|
import type { Table, TableBatch } from '@loaders.gl/schema';
|
|
3
3
|
export type JSONWriterOptions = WriterOptions & {
|
|
4
4
|
json?: {
|
|
@@ -11,6 +11,6 @@ type RowObject = {
|
|
|
11
11
|
[key: string]: unknown;
|
|
12
12
|
};
|
|
13
13
|
type TableJSON = RowArray[] | RowObject[];
|
|
14
|
-
export declare const JSONWriter:
|
|
14
|
+
export declare const JSONWriter: WriterWithEncoder<Table, TableBatch, JSONWriterOptions>;
|
|
15
15
|
export {};
|
|
16
16
|
//# sourceMappingURL=json-writer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"json-writer.d.ts","sourceRoot":"","sources":["../src/json-writer.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAC,
|
|
1
|
+
{"version":3,"file":"json-writer.d.ts","sourceRoot":"","sources":["../src/json-writer.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAC,iBAAiB,EAAE,aAAa,EAAC,MAAM,0BAA0B,CAAC;AAC/E,OAAO,KAAK,EAAC,KAAK,EAAE,UAAU,EAAC,MAAM,oBAAoB,CAAC;AAG1D,MAAM,MAAM,iBAAiB,GAAG,aAAa,GAAG;IAC9C,IAAI,CAAC,EAAE;QACL,KAAK,CAAC,EAAE,kBAAkB,GAAG,iBAAiB,CAAC;QAC/C,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,OAAO,CAAC;KACzC,CAAC;CACH,CAAC;AAEF,KAAK,QAAQ,GAAG,OAAO,EAAE,CAAC;AAC1B,KAAK,SAAS,GAAG;IAAC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CAAC,CAAC;AAC1C,KAAK,SAAS,GAAG,QAAQ,EAAE,GAAG,SAAS,EAAE,CAAC;AAE1C,eAAO,MAAM,UAAU,EAAE,iBAAiB,CAAC,KAAK,EAAE,UAAU,EAAE,iBAAiB,CAY9E,CAAC"}
|
package/dist/json-writer.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"json-writer.js","names":["encodeTableAsJSON","JSONWriter","id","version","module","name","extensions","mimeTypes","options","text","encode","table","TextEncoder","buffer","encodeTextSync"],"sources":["../src/json-writer.ts"],"sourcesContent":["// loaders.gl, MIT license\n// Copyright (c) vis.gl contributors\n// Copyright 2022 Foursquare Labs, Inc.\n\n/* global TextEncoder */\nimport type {
|
|
1
|
+
{"version":3,"file":"json-writer.js","names":["encodeTableAsJSON","JSONWriter","id","version","module","name","extensions","mimeTypes","options","text","encode","table","TextEncoder","buffer","encodeTextSync"],"sources":["../src/json-writer.ts"],"sourcesContent":["// loaders.gl, MIT license\n// Copyright (c) vis.gl contributors\n// Copyright 2022 Foursquare Labs, Inc.\n\n/* global TextEncoder */\nimport type {WriterWithEncoder, WriterOptions} from '@loaders.gl/loader-utils';\nimport type {Table, TableBatch} from '@loaders.gl/schema';\nimport {encodeTableAsJSON} from './lib/encoders/json-encoder';\n\nexport type JSONWriterOptions = WriterOptions & {\n json?: {\n shape?: 'object-row-table' | 'array-row-table';\n wrapper?: (table: TableJSON) => unknown;\n };\n};\n\ntype RowArray = unknown[];\ntype RowObject = {[key: string]: unknown};\ntype TableJSON = RowArray[] | RowObject[];\n\nexport const JSONWriter: WriterWithEncoder<Table, TableBatch, JSONWriterOptions> = {\n id: 'json',\n version: 'latest',\n module: 'json',\n name: 'JSON',\n extensions: ['json'],\n mimeTypes: ['application/json'],\n options: {},\n text: true,\n encode: async (table: Table, options: JSONWriterOptions) =>\n new TextEncoder().encode(encodeTableAsJSON(table, options)).buffer,\n encodeTextSync: (table: Table, options: JSONWriterOptions) => encodeTableAsJSON(table, options)\n};\n"],"mappings":"SAOQA,iBAAiB;AAazB,OAAO,MAAMC,UAAmE,GAAG;EACjFC,EAAE,EAAE,MAAM;EACVC,OAAO,EAAE,QAAQ;EACjBC,MAAM,EAAE,MAAM;EACdC,IAAI,EAAE,MAAM;EACZC,UAAU,EAAE,CAAC,MAAM,CAAC;EACpBC,SAAS,EAAE,CAAC,kBAAkB,CAAC;EAC/BC,OAAO,EAAE,CAAC,CAAC;EACXC,IAAI,EAAE,IAAI;EACVC,MAAM,EAAE,MAAAA,CAAOC,KAAY,EAAEH,OAA0B,KACrD,IAAII,WAAW,CAAC,CAAC,CAACF,MAAM,CAACV,iBAAiB,CAACW,KAAK,EAAEH,OAAO,CAAC,CAAC,CAACK,MAAM;EACpEC,cAAc,EAAEA,CAACH,KAAY,EAAEH,OAA0B,KAAKR,iBAAiB,CAACW,KAAK,EAAEH,OAAO;AAChG,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@loaders.gl/json",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.4",
|
|
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.0.
|
|
47
|
-
"@loaders.gl/loader-utils": "4.0.
|
|
48
|
-
"@loaders.gl/schema": "4.0.
|
|
46
|
+
"@loaders.gl/gis": "4.0.4",
|
|
47
|
+
"@loaders.gl/loader-utils": "4.0.4",
|
|
48
|
+
"@loaders.gl/schema": "4.0.4"
|
|
49
49
|
},
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "4dc810fa04bb400f4aedfef98a83c7ef882ed3d7"
|
|
51
51
|
}
|
package/src/geojson-writer.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Copyright (c) vis.gl contributors
|
|
3
3
|
// Copyright Foursquare, Inc 20222
|
|
4
4
|
|
|
5
|
-
import type {
|
|
5
|
+
import type {WriterWithEncoder, WriterOptions} from '@loaders.gl/loader-utils';
|
|
6
6
|
import type {Table, TableBatch} from '@loaders.gl/schema';
|
|
7
7
|
import {encodeTableAsGeojsonInBatches} from './lib/encoders/geojson-encoder';
|
|
8
8
|
|
|
@@ -14,7 +14,7 @@ export type GeoJSONWriterOptions = WriterOptions & {
|
|
|
14
14
|
chunkSize?: number;
|
|
15
15
|
};
|
|
16
16
|
|
|
17
|
-
export const GeoJSONWriter:
|
|
17
|
+
export const GeoJSONWriter: WriterWithEncoder<Table, TableBatch, GeoJSONWriterOptions> = {
|
|
18
18
|
id: 'geojson',
|
|
19
19
|
version: 'latest',
|
|
20
20
|
module: 'geojson',
|
package/src/json-writer.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// Copyright 2022 Foursquare Labs, Inc.
|
|
4
4
|
|
|
5
5
|
/* global TextEncoder */
|
|
6
|
-
import type {
|
|
6
|
+
import type {WriterWithEncoder, WriterOptions} from '@loaders.gl/loader-utils';
|
|
7
7
|
import type {Table, TableBatch} from '@loaders.gl/schema';
|
|
8
8
|
import {encodeTableAsJSON} from './lib/encoders/json-encoder';
|
|
9
9
|
|
|
@@ -18,7 +18,7 @@ type RowArray = unknown[];
|
|
|
18
18
|
type RowObject = {[key: string]: unknown};
|
|
19
19
|
type TableJSON = RowArray[] | RowObject[];
|
|
20
20
|
|
|
21
|
-
export const JSONWriter:
|
|
21
|
+
export const JSONWriter: WriterWithEncoder<Table, TableBatch, JSONWriterOptions> = {
|
|
22
22
|
id: 'json',
|
|
23
23
|
version: 'latest',
|
|
24
24
|
module: 'json',
|