@datapos/datapos-tool-csv-parse 0.0.61 → 0.0.63
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/datapos-tool-csv-parse.es.js +915 -872
- package/dist/types/src/index.d.ts +16 -11
- package/package.json +2 -2
|
@@ -1,20 +1,25 @@
|
|
|
1
1
|
import { Options as ParseOptions, Parser } from 'csv-parse/browser/esm';
|
|
2
|
+
import { RecordDelimiterId, ValueDelimiterId } from '@datapos/datapos-shared';
|
|
2
3
|
import { RetrieveRecordsOptions, RetrieveRecordsSummary } from '@datapos/datapos-shared/component/connector';
|
|
4
|
+
/**
|
|
5
|
+
* Schema.
|
|
6
|
+
*/
|
|
7
|
+
interface SchemaConfig {
|
|
8
|
+
recordDelimiter: RecordDelimiterId;
|
|
9
|
+
valueDelimiter: ValueDelimiterId;
|
|
10
|
+
}
|
|
3
11
|
/** Tool. */
|
|
4
12
|
declare class Tool {
|
|
5
13
|
/** Build parser. */
|
|
6
14
|
buildParser(options: ParseOptions): Parser;
|
|
7
|
-
/**
|
|
15
|
+
/**
|
|
16
|
+
* Determine schema configuration.
|
|
17
|
+
*/
|
|
18
|
+
determineSchemaConfig(text: string, delimiters: string[]): Promise<SchemaConfig>;
|
|
19
|
+
/**
|
|
20
|
+
* Parse stream.
|
|
21
|
+
*/
|
|
8
22
|
parseStream(retrieveRecordsOptions: RetrieveRecordsOptions, parseOptions: ParseOptions, url: string, abortController: AbortController, chunk: (records: (string[] | Record<string, unknown>)[]) => void): Promise<RetrieveRecordsSummary>;
|
|
9
|
-
/** Parse string. */
|
|
10
|
-
parseString(): void;
|
|
11
|
-
/** Construct row buffer. */
|
|
12
|
-
private constructRowBuffer;
|
|
13
|
-
/** Construct summary. */
|
|
14
|
-
private constructSummary;
|
|
15
|
-
/** Ignore best-effort cleanup errors to keep teardown noise-free. */
|
|
16
|
-
private ignoreErrors;
|
|
17
23
|
}
|
|
18
|
-
/** Exports */
|
|
19
24
|
export type { Options as ParseOptions, Parser } from 'csv-parse/browser/esm';
|
|
20
|
-
export { Tool };
|
|
25
|
+
export { type SchemaConfig, Tool };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@datapos/datapos-tool-csv-parse",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.63",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"private": false,
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
],
|
|
27
27
|
"prettier": "@datapos/datapos-development/prettierrc",
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@datapos/datapos-shared": "^0.3.
|
|
29
|
+
"@datapos/datapos-shared": "^0.3.412",
|
|
30
30
|
"csv-parse": "^6.1.0"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|