web-csv-toolbox 0.9.0 → 0.10.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/dist/cjs/Lexer.cjs +1 -1
- package/dist/cjs/Lexer.cjs.map +1 -1
- package/dist/cjs/LexerTransformer.cjs +1 -1
- package/dist/cjs/LexerTransformer.cjs.map +1 -1
- package/dist/cjs/RecordAssembler.cjs +1 -1
- package/dist/cjs/RecordAssembler.cjs.map +1 -1
- package/dist/cjs/RecordAssemblerTransformer.cjs +1 -1
- package/dist/cjs/RecordAssemblerTransformer.cjs.map +1 -1
- package/dist/cjs/_virtual/web_csv_toolbox_wasm_bg.wasm.cjs +1 -1
- package/dist/cjs/assertCommonOptions.cjs +1 -1
- package/dist/cjs/assertCommonOptions.cjs.map +1 -1
- package/dist/cjs/common/errors.cjs +2 -0
- package/dist/cjs/common/errors.cjs.map +1 -0
- package/dist/cjs/commonParseErrorHandling.cjs +2 -0
- package/dist/cjs/commonParseErrorHandling.cjs.map +1 -0
- package/dist/cjs/getOptionsFromResponse.cjs +1 -1
- package/dist/cjs/getOptionsFromResponse.cjs.map +1 -1
- package/dist/cjs/parseBinaryToArraySync.cjs +1 -1
- package/dist/cjs/parseBinaryToArraySync.cjs.map +1 -1
- package/dist/cjs/parseBinaryToIterableIterator.cjs +1 -1
- package/dist/cjs/parseBinaryToIterableIterator.cjs.map +1 -1
- package/dist/cjs/parseBinaryToStream.cjs +1 -1
- package/dist/cjs/parseBinaryToStream.cjs.map +1 -1
- package/dist/cjs/parseResponse.cjs +1 -1
- package/dist/cjs/parseResponse.cjs.map +1 -1
- package/dist/cjs/parseResponseToStream.cjs +1 -1
- package/dist/cjs/parseResponseToStream.cjs.map +1 -1
- package/dist/cjs/parseString.cjs +1 -1
- package/dist/cjs/parseString.cjs.map +1 -1
- package/dist/cjs/parseStringToArraySync.cjs +1 -1
- package/dist/cjs/parseStringToArraySync.cjs.map +1 -1
- package/dist/cjs/parseStringToArraySyncWASM.cjs +1 -1
- package/dist/cjs/parseStringToArraySyncWASM.cjs.map +1 -1
- package/dist/cjs/parseStringToIterableIterator.cjs +1 -1
- package/dist/cjs/parseStringToIterableIterator.cjs.map +1 -1
- package/dist/cjs/parseStringToStream.cjs +1 -1
- package/dist/cjs/parseStringToStream.cjs.map +1 -1
- package/dist/cjs/utils/convertBinaryToString.cjs.map +1 -0
- package/dist/cjs/utils/pipeline.cjs +1 -1
- package/dist/cjs/utils/pipeline.cjs.map +1 -1
- package/dist/cjs/web-csv-toolbox.cjs +1 -1
- package/dist/es/Lexer.js +6 -0
- package/dist/es/Lexer.js.map +1 -1
- package/dist/es/LexerTransformer.js +12 -3
- package/dist/es/LexerTransformer.js.map +1 -1
- package/dist/es/RecordAssembler.js +3 -2
- package/dist/es/RecordAssembler.js.map +1 -1
- package/dist/es/RecordAssemblerTransformer.js +14 -5
- package/dist/es/RecordAssemblerTransformer.js.map +1 -1
- package/dist/es/_virtual/web_csv_toolbox_wasm_bg.wasm.js +1 -1
- package/dist/es/assertCommonOptions.js +8 -7
- package/dist/es/assertCommonOptions.js.map +1 -1
- package/dist/es/common/errors.js +20 -0
- package/dist/es/common/errors.js.map +1 -0
- package/dist/es/commonParseErrorHandling.js +13 -0
- package/dist/es/commonParseErrorHandling.js.map +1 -0
- package/dist/es/getOptionsFromResponse.js +1 -1
- package/dist/es/getOptionsFromResponse.js.map +1 -1
- package/dist/es/parseBinaryToArraySync.js +8 -3
- package/dist/es/parseBinaryToArraySync.js.map +1 -1
- package/dist/es/parseBinaryToIterableIterator.js +8 -3
- package/dist/es/parseBinaryToIterableIterator.js.map +1 -1
- package/dist/es/parseBinaryToStream.js +8 -3
- package/dist/es/parseBinaryToStream.js.map +1 -1
- package/dist/es/parseResponse.js +9 -4
- package/dist/es/parseResponse.js.map +1 -1
- package/dist/es/parseResponseToStream.js +9 -4
- package/dist/es/parseResponseToStream.js.map +1 -1
- package/dist/es/parseString.js +6 -1
- package/dist/es/parseString.js.map +1 -1
- package/dist/es/parseStringToArraySync.js +9 -4
- package/dist/es/parseStringToArraySync.js.map +1 -1
- package/dist/es/parseStringToArraySyncWASM.js +9 -2
- package/dist/es/parseStringToArraySyncWASM.js.map +1 -1
- package/dist/es/parseStringToIterableIterator.js +9 -4
- package/dist/es/parseStringToIterableIterator.js.map +1 -1
- package/dist/es/parseStringToStream.js +15 -10
- package/dist/es/parseStringToStream.js.map +1 -1
- package/dist/es/utils/convertBinaryToString.js.map +1 -0
- package/dist/es/utils/pipeline.js +1 -1
- package/dist/es/utils/pipeline.js.map +1 -1
- package/dist/es/web-csv-toolbox.js +7 -6
- package/dist/es/web-csv-toolbox.js.map +1 -1
- package/dist/types/Lexer.d.ts +2 -1
- package/dist/types/LexerTransformer.d.ts +11 -8
- package/dist/types/LexerTransformer.test.d.ts +1 -0
- package/dist/types/RecordAssembler.d.ts +2 -1
- package/dist/types/RecordAssemblerTransformer.d.ts +4 -1
- package/dist/types/assertCommonOptions.d.ts +4 -2
- package/dist/types/common/errors.d.ts +34 -0
- package/dist/types/common/types.d.ts +2 -1
- package/dist/types/commonParseErrorHandling.d.ts +8 -0
- package/dist/types/escapeField.d.ts +2 -1
- package/dist/types/getOptionsFromResponse.d.ts +10 -1
- package/dist/types/loadWASM.d.ts +2 -1
- package/dist/types/loadWASM.web.d.ts +2 -1
- package/dist/types/parse.d.ts +2 -1
- package/dist/types/parseBinary.d.ts +2 -1
- package/dist/types/parseBinaryToArraySync.d.ts +2 -1
- package/dist/types/parseBinaryToArraySync.test.d.ts +1 -0
- package/dist/types/parseBinaryToIterableIterator.d.ts +10 -1
- package/dist/types/parseBinaryToStream.d.ts +2 -1
- package/dist/types/parseResponse.d.ts +2 -1
- package/dist/types/parseResponseToStream.d.ts +2 -1
- package/dist/types/parseString.d.ts +2 -1
- package/dist/types/parseStringStream.d.ts +2 -1
- package/dist/types/parseStringStreamToStream.d.ts +2 -1
- package/dist/types/parseStringToArraySync.d.ts +2 -1
- package/dist/types/parseStringToArraySyncWASM.d.ts +2 -1
- package/dist/types/parseStringToIterableIterator.d.ts +2 -1
- package/dist/types/parseStringToStream.d.ts +2 -1
- package/dist/types/parseUint8ArrayStream.d.ts +2 -1
- package/dist/types/parseUint8ArrayStreamToStream.d.ts +2 -1
- package/dist/types/utils/convertBinaryToString.d.ts +12 -0
- package/dist/types/web-csv-toolbox.d.ts +13 -12
- package/dist/web-csv-toolbox.umd.cjs +1 -1
- package/dist/web-csv-toolbox.umd.cjs.map +1 -1
- package/dist/web_csv_toolbox_wasm_bg.wasm +0 -0
- package/package.json +7 -3
- package/dist/cjs/convertBinaryToString.cjs.map +0 -1
- package/dist/es/convertBinaryToString.js.map +0 -1
- package/dist/types/convertBinaryToString.d.ts +0 -2
- /package/dist/cjs/{convertBinaryToString.cjs → utils/convertBinaryToString.cjs} +0 -0
- /package/dist/es/{convertBinaryToString.js → utils/convertBinaryToString.js} +0 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Common error handling for parsing CSV data.
|
|
3
|
+
*
|
|
4
|
+
* @param error - The error to handle.
|
|
5
|
+
* @throws {ParseError} When an error occurs while parsing the CSV data.
|
|
6
|
+
* @throws {InvalidOptionError} When an invalid option is provided.
|
|
7
|
+
*/
|
|
8
|
+
export declare function commonParseErrorHandling(error: unknown): never;
|
|
@@ -1,2 +1,11 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ParseBinaryOptions } from './common/types.ts';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Extracts the options from the response object.
|
|
5
|
+
*
|
|
6
|
+
* @param response - The response object from which to extract the options.
|
|
7
|
+
* @param options - The options to merge with the extracted options.
|
|
8
|
+
* @returns The options extracted from the response.
|
|
9
|
+
* @throws {RangeError} - The content type is not supported.
|
|
10
|
+
*/
|
|
2
11
|
export declare function getOptionsFromResponse<Header extends ReadonlyArray<string>>(response: Response, options?: ParseBinaryOptions<Header>): ParseBinaryOptions<Header>;
|
package/dist/types/loadWASM.d.ts
CHANGED
package/dist/types/parse.d.ts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { CSVRecord, ParseBinaryOptions } from './common/types.ts';
|
|
2
|
+
|
|
2
3
|
export declare function parseBinaryToArraySync<Header extends ReadonlyArray<string>>(binary: Uint8Array | ArrayBuffer, options?: ParseBinaryOptions<Header>): CSVRecord<Header>[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,2 +1,11 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { CSVRecord, ParseBinaryOptions } from './common/types.ts';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Parses the given binary data into an iterable iterator of CSV records.
|
|
5
|
+
*
|
|
6
|
+
* @param binary - The binary data to parse.
|
|
7
|
+
* @param options - The parse options.
|
|
8
|
+
* @returns An iterable iterator of CSV records.
|
|
9
|
+
* @throws {ParseError} When an error occurs while parsing the CSV data.
|
|
10
|
+
*/
|
|
2
11
|
export declare function parseBinaryToIterableIterator<Header extends ReadonlyArray<string>>(binary: Uint8Array | ArrayBuffer, options?: ParseBinaryOptions<Header>): IterableIterator<CSVRecord<Header>>;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { CSVRecord, ParseBinaryOptions } from './common/types.ts';
|
|
2
|
+
|
|
2
3
|
export declare function parseBinaryToStream<Header extends ReadonlyArray<string>>(binary: Uint8Array | ArrayBuffer, options?: ParseBinaryOptions<Header>): ReadableStream<CSVRecord<Header>>;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { CSVRecord, ParseBinaryOptions } from './common/types.ts';
|
|
2
|
+
|
|
2
3
|
export declare function parseResponseToStream<Header extends ReadonlyArray<string>>(response: Response, options?: ParseBinaryOptions<Header>): ReadableStream<CSVRecord<Header>>;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { CSVRecord, ParseOptions } from './common/types.ts';
|
|
2
|
+
|
|
2
3
|
export declare function parseStringStreamToStream<Header extends ReadonlyArray<string>>(stream: ReadableStream<string>, options?: ParseOptions<Header>): ReadableStream<CSVRecord<Header>>;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { CSVRecord, ParseOptions } from './common/types.ts';
|
|
2
|
+
|
|
2
3
|
export declare function parseStringToArraySync<Header extends ReadonlyArray<string>>(csv: string, options?: ParseOptions<Header>): CSVRecord<Header>[];
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { CSVRecord, ParseOptions } from './common/types.ts';
|
|
2
|
+
|
|
2
3
|
export declare function parseStringToIterableIterator<Header extends ReadonlyArray<string>>(csv: string, options?: ParseOptions<Header>): IterableIterator<CSVRecord<Header>>;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { CSVRecord, ParseOptions } from './common/types.ts';
|
|
2
|
+
|
|
2
3
|
export declare function parseStringToStream<Header extends ReadonlyArray<string>>(csv: string, options?: ParseOptions<Header>): ReadableStream<CSVRecord<Header>>;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { CSVRecord, ParseBinaryOptions } from './common/types.ts';
|
|
2
|
+
|
|
2
3
|
export declare function parseUint8ArrayStreamToStream<Header extends readonly string[]>(stream: ReadableStream<Uint8Array>, options?: ParseBinaryOptions<Header>): ReadableStream<CSVRecord<Header>>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { BinaryOptions } from '../common/types.ts';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Converts a binary string to a string.
|
|
5
|
+
*
|
|
6
|
+
* @param binary - The binary string to convert.
|
|
7
|
+
* @param options - The options for parsing the binary string.
|
|
8
|
+
* @returns The converted string.
|
|
9
|
+
* @throws {RangeError} The given charset is not supported.
|
|
10
|
+
* @throws {TypeError} The encoded data was not valid.
|
|
11
|
+
*/
|
|
12
|
+
export declare function convertBinaryToString(binary: Uint8Array | ArrayBuffer, options: BinaryOptions): string;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
5
|
-
export * from
|
|
6
|
-
export * from
|
|
7
|
-
export * from
|
|
8
|
-
export * from
|
|
9
|
-
export * from
|
|
10
|
-
export * from
|
|
11
|
-
export * from
|
|
12
|
-
export * from
|
|
1
|
+
export * from './common/constants.ts';
|
|
2
|
+
export * from './common/errors.ts';
|
|
3
|
+
export * from './common/types.ts';
|
|
4
|
+
export * from './LexerTransformer.ts';
|
|
5
|
+
export * from './loadWASM.ts';
|
|
6
|
+
export * from './parse.ts';
|
|
7
|
+
export * from './parseBinary.ts';
|
|
8
|
+
export * from './parseResponse.ts';
|
|
9
|
+
export * from './parseString.ts';
|
|
10
|
+
export * from './parseStringStream.ts';
|
|
11
|
+
export * from './parseStringToArraySyncWASM.ts';
|
|
12
|
+
export * from './parseUint8ArrayStream.ts';
|
|
13
|
+
export * from './RecordAssemblerTransformer.ts';
|