@loaders.gl/csv 4.3.0-alpha.8 → 4.3.0-beta.2
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/csv-loader.d.ts.map +1 -1
- package/dist/csv-loader.js +1 -2
- package/dist/csv-writer.d.ts +0 -2
- package/dist/csv-writer.d.ts.map +1 -1
- package/dist/dist.dev.js +304 -311
- package/dist/dist.min.js +12 -12
- package/dist/index.cjs +285 -292
- package/dist/index.cjs.map +3 -3
- package/dist/papaparse/async-iterator-streamer.d.ts +28 -4
- package/dist/papaparse/async-iterator-streamer.d.ts.map +1 -1
- package/dist/papaparse/async-iterator-streamer.js +11 -12
- package/dist/papaparse/papaparse.d.ts +108 -12
- package/dist/papaparse/papaparse.d.ts.map +1 -1
- package/dist/papaparse/papaparse.js +274 -314
- package/package.json +4 -4
- package/src/csv-loader.ts +0 -1
- package/src/csv-writer.ts +0 -2
- package/src/papaparse/async-iterator-streamer.ts +11 -14
- package/src/papaparse/papaparse.ts +330 -342
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@loaders.gl/csv",
|
|
3
|
-
"version": "4.3.0-
|
|
3
|
+
"version": "4.3.0-beta.2",
|
|
4
4
|
"description": "Framework-independent loader for CSV and DSV table formats",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -44,12 +44,12 @@
|
|
|
44
44
|
"build-bundle-dev": "ocular-bundle ./bundle.ts --env=dev --output=dist/dist.dev.js"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@loaders.gl/loader-utils": "4.3.0-
|
|
48
|
-
"@loaders.gl/schema": "4.3.0-
|
|
47
|
+
"@loaders.gl/loader-utils": "4.3.0-beta.2",
|
|
48
|
+
"@loaders.gl/schema": "4.3.0-beta.2",
|
|
49
49
|
"d3-dsv": "^1.2.0"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
|
52
52
|
"@loaders.gl/core": "^4.0.0"
|
|
53
53
|
},
|
|
54
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "a61003f2bb56acbdaef07a03bc39d4c7830afdcc"
|
|
55
55
|
}
|
package/src/csv-loader.ts
CHANGED
package/src/csv-writer.ts
CHANGED
|
@@ -9,12 +9,12 @@
|
|
|
9
9
|
import Papa from './papaparse';
|
|
10
10
|
const {ChunkStreamer} = Papa;
|
|
11
11
|
|
|
12
|
-
export default
|
|
13
|
-
|
|
12
|
+
export default class AsyncIteratorStreamer extends ChunkStreamer {
|
|
13
|
+
textDecoder = new TextDecoder(this._config.encoding);
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
constructor(config = {}) {
|
|
16
|
+
super(config);
|
|
17
|
+
}
|
|
18
18
|
|
|
19
19
|
// Implement ChunkStreamer base class methods
|
|
20
20
|
|
|
@@ -27,7 +27,7 @@ export default function AsyncIteratorStreamer(config) {
|
|
|
27
27
|
// this._input.resume();
|
|
28
28
|
// };
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
async stream(asyncIterator) {
|
|
31
31
|
this._input = asyncIterator;
|
|
32
32
|
|
|
33
33
|
try {
|
|
@@ -55,17 +55,14 @@ export default function AsyncIteratorStreamer(config) {
|
|
|
55
55
|
// Inform ChunkStreamer base class of error
|
|
56
56
|
this._sendError(error);
|
|
57
57
|
}
|
|
58
|
-
}
|
|
58
|
+
}
|
|
59
59
|
|
|
60
|
-
|
|
60
|
+
_nextChunk() {
|
|
61
61
|
// Left empty, as async iterator automatically pulls next chunk
|
|
62
|
-
}
|
|
62
|
+
}
|
|
63
63
|
|
|
64
64
|
// HELPER METHODS
|
|
65
|
-
|
|
65
|
+
getStringChunk(chunk) {
|
|
66
66
|
return typeof chunk === 'string' ? chunk : this.textDecoder.decode(chunk, {stream: true});
|
|
67
|
-
}
|
|
67
|
+
}
|
|
68
68
|
}
|
|
69
|
-
|
|
70
|
-
AsyncIteratorStreamer.prototype = Object.create(ChunkStreamer.prototype);
|
|
71
|
-
AsyncIteratorStreamer.prototype.constructor = AsyncIteratorStreamer;
|