@loaders.gl/csv 4.3.0-alpha.7 → 4.3.0-beta.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loaders.gl/csv",
3
- "version": "4.3.0-alpha.7",
3
+ "version": "4.3.0-beta.1",
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-alpha.7",
48
- "@loaders.gl/schema": "4.3.0-alpha.7",
47
+ "@loaders.gl/loader-utils": "4.3.0-beta.1",
48
+ "@loaders.gl/schema": "4.3.0-beta.1",
49
49
  "d3-dsv": "^1.2.0"
50
50
  },
51
51
  "peerDependencies": {
52
52
  "@loaders.gl/core": "^4.0.0"
53
53
  },
54
- "gitHead": "73fb27872d89f3804dca37ebd568c6ba9609a98f"
54
+ "gitHead": "992d24e7d4e3015a91fa1cbfe87ee7dc1b333322"
55
55
  }
package/src/csv-loader.ts CHANGED
@@ -274,7 +274,6 @@ function isHeaderRow(row: string[]): boolean {
274
274
  */
275
275
  function readFirstRow(csvText: string): any[] {
276
276
  const result = Papa.parse(csvText, {
277
- download: false,
278
277
  dynamicTyping: true,
279
278
  preview: 1
280
279
  });
package/src/csv-writer.ts CHANGED
@@ -11,8 +11,6 @@ export type CSVWriterOptions = WriterOptions & {
11
11
  csv?: {
12
12
  useDisplayNames?: boolean;
13
13
  };
14
- /** @deprecated */
15
- useDisplayNames?: never;
16
14
  };
17
15
 
18
16
  export const CSVWriter = {
@@ -9,12 +9,12 @@
9
9
  import Papa from './papaparse';
10
10
  const {ChunkStreamer} = Papa;
11
11
 
12
- export default function AsyncIteratorStreamer(config) {
13
- config = config || {};
12
+ export default class AsyncIteratorStreamer extends ChunkStreamer {
13
+ textDecoder = new TextDecoder(this._config.encoding);
14
14
 
15
- ChunkStreamer.call(this, config);
16
-
17
- this.textDecoder = new TextDecoder(this._config.encoding);
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
- this.stream = async function (asyncIterator) {
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
- this._nextChunk = function nextChunk() {
60
+ _nextChunk() {
61
61
  // Left empty, as async iterator automatically pulls next chunk
62
- };
62
+ }
63
63
 
64
64
  // HELPER METHODS
65
- this.getStringChunk = function (chunk) {
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;