@fast-csv/parse
Advanced tools
Comparing version 4.2.0 to 4.3.0
@@ -8,5 +8,5 @@ /// <reference types="node" /> | ||
export { ParserOptions, ParserOptionsArgs } from './ParserOptions'; | ||
export declare const parse: <I extends Row, O extends Row>(args?: ParserOptionsArgs | undefined) => CsvParserStream<I, O>; | ||
export declare const parseStream: <I extends Row, O extends Row>(stream: NodeJS.ReadableStream, options?: ParserOptionsArgs | undefined) => CsvParserStream<I, O>; | ||
export declare const parseFile: <I extends Row, O extends Row>(location: string, options?: ParserOptionsArgs) => CsvParserStream<I, O>; | ||
export declare const parseString: <I extends Row, O extends Row>(string: string, options?: ParserOptionsArgs | undefined) => CsvParserStream<I, O>; | ||
export declare const parse: <I extends Row<any>, O extends Row<any>>(args?: ParserOptionsArgs | undefined) => CsvParserStream<I, O>; | ||
export declare const parseStream: <I extends Row<any>, O extends Row<any>>(stream: NodeJS.ReadableStream, options?: ParserOptionsArgs | undefined) => CsvParserStream<I, O>; | ||
export declare const parseFile: <I extends Row<any>, O extends Row<any>>(location: string, options?: ParserOptionsArgs) => CsvParserStream<I, O>; | ||
export declare const parseString: <I extends Row<any>, O extends Row<any>>(string: string, options?: ParserOptionsArgs | undefined) => CsvParserStream<I, O>; |
@@ -23,3 +23,3 @@ "use strict"; | ||
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); | ||
} | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -26,0 +26,0 @@ exports.parseString = exports.parseFile = exports.parseStream = exports.parse = void 0; |
@@ -24,3 +24,3 @@ "use strict"; | ||
if (!scanner.hasMoreData) { | ||
throw new Error(`Parse Error: missing closing: '${this.parserOptions.quote}' in line: at '${scanner.lineFromCursor.replace(/[\r\n]/g, "\\n'")}'`); | ||
throw new Error(`Parse Error: missing closing: '${this.parserOptions.quote || ''}' in line: at '${scanner.lineFromCursor.replace(/[\r\n]/g, "\\n'")}'`); | ||
} | ||
@@ -27,0 +27,0 @@ return null; |
@@ -24,3 +24,3 @@ "use strict"; | ||
} | ||
const match = lineFromCursor.match(regex); | ||
const match = regex.exec(lineFromCursor); | ||
if (match == null) { | ||
@@ -52,3 +52,3 @@ return null; | ||
advancePastLine() { | ||
const match = this.lineFromCursor.match(ROW_DELIMITER); | ||
const match = ROW_DELIMITER.exec(this.lineFromCursor); | ||
if (!match) { | ||
@@ -55,0 +55,0 @@ if (this.hasMoreData) { |
@@ -1,4 +0,4 @@ | ||
export declare type RowMap = Record<string, any>; | ||
export declare type RowArray = any[]; | ||
export declare type Row = RowMap | RowArray; | ||
export declare type RowMap<V = any> = Record<string, V>; | ||
export declare type RowArray<V = any> = V[]; | ||
export declare type Row<V = any> = RowMap<V> | RowArray<V>; | ||
export interface RowValidationResult<R extends Row> { | ||
@@ -14,3 +14,3 @@ row: R | null; | ||
export declare type RowTransformFunction<I extends Row, O extends Row> = SyncRowTransform<I, O> | AsyncRowTransform<I, O>; | ||
export declare const isSyncTransform: <I extends Row, O extends Row>(transform: RowTransformFunction<I, O>) => transform is SyncRowTransform<I, O>; | ||
export declare const isSyncTransform: <I extends Row<any>, O extends Row<any>>(transform: RowTransformFunction<I, O>) => transform is SyncRowTransform<I, O>; | ||
export declare type RowValidateCallback = (error?: Error | null, isValid?: boolean, reason?: string) => void; | ||
@@ -20,4 +20,4 @@ export declare type SyncRowValidate<R extends Row> = (row: R) => boolean; | ||
export declare type RowValidate<R extends Row> = AsyncRowValidate<R> | SyncRowValidate<R>; | ||
export declare const isSyncValidate: <R extends Row>(validate: RowValidate<R>) => validate is SyncRowValidate<R>; | ||
export declare const isSyncValidate: <R extends Row<any>>(validate: RowValidate<R>) => validate is SyncRowValidate<R>; | ||
export declare type HeaderArray = (string | undefined | null)[]; | ||
export declare type HeaderTransformFunction = (headers: HeaderArray) => HeaderArray; |
@@ -6,2 +6,10 @@ # Change Log | ||
# [4.3.0](https://github.com/C2FO/fast-csv/compare/v4.2.0...v4.3.0) (2020-05-27) | ||
**Note:** Version bump only for package @fast-csv/parse | ||
# [4.2.0](https://github.com/C2FO/fast-csv/compare/v4.1.6...v4.2.0) (2020-05-19) | ||
@@ -8,0 +16,0 @@ |
{ | ||
"name": "@fast-csv/parse", | ||
"version": "4.2.0", | ||
"version": "4.3.0", | ||
"description": "fast-csv parsing package", | ||
@@ -56,7 +56,7 @@ "keywords": [ | ||
"@types/lodash.uniq": "4.5.6", | ||
"@types/sinon": "9.0.1", | ||
"@types/sinon": "9.0.4", | ||
"lodash.partition": "4.6.0", | ||
"sinon": "9.0.2" | ||
}, | ||
"gitHead": "041295d2ed17eab7e5036b1a4911f03fefafeab6" | ||
"gitHead": "fbfd5fee20d1d494cd22ced2c506db3146d89af7" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
83035