web-csv-toolbox 0.10.0 → 0.10.2-next-574bee290399ac05fcd73c60c757421d23b317de

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.
Files changed (42) hide show
  1. package/dist/cjs/_virtual/web_csv_toolbox_wasm_bg.wasm.cjs +1 -1
  2. package/dist/cjs/common/errors.cjs +1 -1
  3. package/dist/cjs/common/errors.cjs.map +1 -1
  4. package/dist/cjs/web-csv-toolbox.cjs +1 -1
  5. package/dist/es/_virtual/web_csv_toolbox_wasm_bg.wasm.js +1 -1
  6. package/dist/es/common/errors.js +1 -1
  7. package/dist/es/common/errors.js.map +1 -1
  8. package/dist/es/web-csv-toolbox.js +1 -0
  9. package/dist/es/web-csv-toolbox.js.map +1 -1
  10. package/dist/types/Lexer.d.ts +2 -1
  11. package/dist/types/LexerTransformer.d.ts +3 -2
  12. package/dist/types/RecordAssembler.d.ts +2 -1
  13. package/dist/types/RecordAssemblerTransformer.d.ts +3 -2
  14. package/dist/types/assertCommonOptions.d.ts +2 -1
  15. package/dist/types/common/errors.d.ts +10 -2
  16. package/dist/types/common/types.d.ts +2 -1
  17. package/dist/types/escapeField.d.ts +2 -1
  18. package/dist/types/getOptionsFromResponse.d.ts +2 -1
  19. package/dist/types/loadWASM.d.ts +2 -1
  20. package/dist/types/loadWASM.web.d.ts +2 -1
  21. package/dist/types/parse.d.ts +2 -1
  22. package/dist/types/parseBinary.d.ts +2 -1
  23. package/dist/types/parseBinaryToArraySync.d.ts +2 -1
  24. package/dist/types/parseBinaryToIterableIterator.d.ts +2 -1
  25. package/dist/types/parseBinaryToStream.d.ts +2 -1
  26. package/dist/types/parseResponse.d.ts +2 -1
  27. package/dist/types/parseResponseToStream.d.ts +2 -1
  28. package/dist/types/parseString.d.ts +2 -1
  29. package/dist/types/parseStringStream.d.ts +2 -1
  30. package/dist/types/parseStringStreamToStream.d.ts +2 -1
  31. package/dist/types/parseStringToArraySync.d.ts +2 -1
  32. package/dist/types/parseStringToArraySyncWASM.d.ts +2 -1
  33. package/dist/types/parseStringToIterableIterator.d.ts +2 -1
  34. package/dist/types/parseStringToStream.d.ts +2 -1
  35. package/dist/types/parseUint8ArrayStream.d.ts +2 -1
  36. package/dist/types/parseUint8ArrayStreamToStream.d.ts +2 -1
  37. package/dist/types/utils/convertBinaryToString.d.ts +2 -1
  38. package/dist/types/web-csv-toolbox.d.ts +13 -12
  39. package/dist/web-csv-toolbox.umd.cjs +1 -1
  40. package/dist/web-csv-toolbox.umd.cjs.map +1 -1
  41. package/dist/web_csv_toolbox_wasm_bg.wasm +0 -0
  42. package/package.json +7 -4
@@ -1,4 +1,5 @@
1
- import type { CommonOptions } from "./common/types.ts";
1
+ import { CommonOptions } from './common/types.ts';
2
+
2
3
  /**
3
4
  * Asserts that the provided options object contains all the required properties.
4
5
  * Throws an error if any required property is missing
@@ -1,4 +1,5 @@
1
- import type { Position } from "./types.js";
1
+ import { Position } from './types.js';
2
+
2
3
  /**
3
4
  * Error class for invalid option errors.
4
5
  */
@@ -16,8 +17,15 @@ export interface ParseErrorOptions extends ErrorOptions {
16
17
  }
17
18
  /**
18
19
  * Error class for parse errors.
20
+ *
21
+ * @remarks
22
+ * This error is thrown when a parsing error occurs.
23
+ * {@link ParseError} is a subclass of {@link !SyntaxError}.
24
+ *
25
+ * This is in reference to the specification
26
+ * that the error thrown when a parse error occurs in the {@link !JSON.parse} function is {@link !SyntaxError}.
19
27
  */
20
- export declare class ParseError extends Error {
28
+ export declare class ParseError extends SyntaxError {
21
29
  /**
22
30
  * The position where the error occurred.
23
31
  */
@@ -1,4 +1,5 @@
1
- import type { Field, FieldDelimiter, RecordDelimiter } from "./constants.ts";
1
+ import { Field, FieldDelimiter, RecordDelimiter } from './constants.ts';
2
+
2
3
  /**
3
4
  * Position object.
4
5
  */
@@ -1,4 +1,5 @@
1
- import type { CommonOptions } from "./common/types.ts";
1
+ import { CommonOptions } from './common/types.ts';
2
+
2
3
  export interface EscapeFieldOptions extends CommonOptions {
3
4
  quote?: true;
4
5
  }
@@ -1,4 +1,5 @@
1
- import type { ParseBinaryOptions } from "./common/types.ts";
1
+ import { ParseBinaryOptions } from './common/types.ts';
2
+
2
3
  /**
3
4
  * Extracts the options from the response object.
4
5
  *
@@ -1,4 +1,5 @@
1
- import { type InitInput } from "web-csv-toolbox-wasm";
1
+ import { InitInput } from 'web-csv-toolbox-wasm';
2
+
2
3
  /**
3
4
  * Load WASM module.
4
5
  *
@@ -1,4 +1,5 @@
1
- import { type InitInput } from "web-csv-toolbox-wasm";
1
+ import { InitInput } from 'web-csv-toolbox-wasm';
2
+
2
3
  /**
3
4
  * Load WASM module.
4
5
  *
@@ -1,4 +1,5 @@
1
- import type { CSVBinary, CSVRecord, CSVString, ParseBinaryOptions, ParseOptions } from "./common/types.ts";
1
+ import { CSVBinary, CSVRecord, CSVString, ParseBinaryOptions, ParseOptions } from './common/types.ts';
2
+
2
3
  /**
3
4
  * Parse CSV to records.
4
5
  *
@@ -1,4 +1,5 @@
1
- import type { CSVRecord, ParseBinaryOptions } from "./common/types.ts";
1
+ import { CSVRecord, ParseBinaryOptions } from './common/types.ts';
2
+
2
3
  /**
3
4
  * Parse a binary from an {@link !Uint8Array}.
4
5
  *
@@ -1,2 +1,3 @@
1
- import type { CSVRecord, ParseBinaryOptions } from "./common/types.ts";
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>[];
@@ -1,4 +1,5 @@
1
- import type { CSVRecord, ParseBinaryOptions } from "./common/types.ts";
1
+ import { CSVRecord, ParseBinaryOptions } from './common/types.ts';
2
+
2
3
  /**
3
4
  * Parses the given binary data into an iterable iterator of CSV records.
4
5
  *
@@ -1,2 +1,3 @@
1
- import type { CSVRecord, ParseBinaryOptions } from "./common/types.ts";
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,4 +1,5 @@
1
- import type { CSVRecord, ParseOptions } from "./common/types.ts";
1
+ import { CSVRecord, ParseOptions } from './common/types.ts';
2
+
2
3
  /**
3
4
  * Parse HTTP Response what contains CSV to records,
4
5
  * ideal for smaller data sets.
@@ -1,2 +1,3 @@
1
- import type { CSVRecord, ParseBinaryOptions } from "./common/types.ts";
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,4 +1,5 @@
1
- import type { CSVRecord, ParseOptions } from "./common/types.ts";
1
+ import { CSVRecord, ParseOptions } from './common/types.ts';
2
+
2
3
  /**
3
4
  * Parse CSV string to records.
4
5
  *
@@ -1,4 +1,5 @@
1
- import type { CSVRecord, ParseOptions } from "./common/types.ts";
1
+ import { CSVRecord, ParseOptions } from './common/types.ts';
2
+
2
3
  /**
3
4
  * Parse CSV string stream to records.
4
5
  *
@@ -1,2 +1,3 @@
1
- import type { CSVRecord, ParseOptions } from "./common/types.ts";
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 type { CSVRecord, ParseOptions } from "./common/types.ts";
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,4 +1,5 @@
1
- import type { CSVRecord, CommonOptions } from "./common/types.ts";
1
+ import { CSVRecord, CommonOptions } from './common/types.ts';
2
+
2
3
  /**
3
4
  * Parse CSV string to record of arrays.
4
5
  *
@@ -1,2 +1,3 @@
1
- import type { CSVRecord, ParseOptions } from "./common/types.ts";
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 type { CSVRecord, ParseOptions } from "./common/types.ts";
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,4 +1,5 @@
1
- import type { CSVRecord, ParseBinaryOptions } from "./common/types.ts";
1
+ import { CSVRecord, ParseBinaryOptions } from './common/types.ts';
2
+
2
3
  /**
3
4
  * Parse CSV to records.
4
5
  * This function is for parsing a binary stream.
@@ -1,2 +1,3 @@
1
- import type { CSVRecord, ParseBinaryOptions } from "./common/types.ts";
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>>;
@@ -1,4 +1,5 @@
1
- import type { BinaryOptions } from "../common/types.ts";
1
+ import { BinaryOptions } from '../common/types.ts';
2
+
2
3
  /**
3
4
  * Converts a binary string to a string.
4
5
  *
@@ -1,12 +1,13 @@
1
- export * from "./common/constants.ts";
2
- export * from "./common/types.ts";
3
- export * from "./LexerTransformer.ts";
4
- export * from "./loadWASM.ts";
5
- export * from "./parse.ts";
6
- export * from "./parseBinary.ts";
7
- export * from "./parseResponse.ts";
8
- export * from "./parseString.ts";
9
- export * from "./parseStringStream.ts";
10
- export * from "./parseStringToArraySyncWASM.ts";
11
- export * from "./parseUint8ArrayStream.ts";
12
- export * from "./RecordAssemblerTransformer.ts";
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';