flat-file-parser
Advanced tools
Comparing version 0.7.1 to 0.7.2
@@ -8,4 +8,3 @@ import { FlatFileParser } from './main'; | ||
} | ||
export declare type lineProcessor = <T>( | ||
export declare type lineProcessor = ( | ||
line: string, | ||
@@ -15,6 +14,5 @@ originalParser: FlatFileParser, | ||
lineNumber: number | ||
) => T | null; | ||
export declare type processedCallbackLine = <TIn, TOut>( | ||
processedLineData?: TIn, | ||
) => any; | ||
export declare type processedCallbackLine = <TIn>( | ||
processedLineData: TIn, | ||
line: string, | ||
@@ -24,4 +22,3 @@ originalParser: FlatFileParser, | ||
lineNumber: number | ||
) => TOut; | ||
) => any; | ||
export declare type processedCallbackLoop = ( | ||
@@ -32,5 +29,8 @@ originalParser: FlatFileParser, | ||
) => void; | ||
export declare type lineProcessOutput = { | ||
data: any; | ||
completed: boolean; | ||
}; | ||
export declare type LineParser = { | ||
process: <T>( | ||
process: ( | ||
line: string, | ||
@@ -40,5 +40,5 @@ originalParser: FlatFileParser, | ||
lineNumber: number | ||
) => { data?: T; completed: boolean }; | ||
callback: <TIn, TOut>( | ||
processedLineData?: TIn, | ||
) => lineProcessOutput; | ||
callback: <TIn>( | ||
processedLineData: TIn, | ||
line: string, | ||
@@ -48,10 +48,9 @@ originalParser: FlatFileParser, | ||
lineNumber: number | ||
) => TOut; | ||
) => any; | ||
isLoop: () => boolean; | ||
loopCount: () => ?number; | ||
reLoop: () => ?processedCallbackLoop; | ||
loopCount: () => number | null; | ||
reLoop: () => processedCallbackLoop | null; | ||
isSkip: () => boolean; | ||
}; | ||
export declare function LineParser( | ||
export declare const LineParser: ( | ||
lineProcessor: lineProcessor, | ||
@@ -61,2 +60,2 @@ noOfLines?: number, | ||
lineParserType = LineParserType.default | ||
): LineParser; | ||
) => LineParser; |
@@ -9,11 +9,8 @@ import { Readable, ReadableOptions } from 'stream'; | ||
export * from './lineParser'; | ||
export interface FlatFileParserOptions { | ||
signal?: AbortSignal; | ||
} | ||
export interface FlatFileParserStreamOptions | ||
extends ReadableOptions, | ||
FlatFileParserOptions {} | ||
export declare type FlatFileParser = { | ||
@@ -24,3 +21,3 @@ open: (filePath: string) => FlatFileParser; | ||
noOfLines?: number, | ||
processedCallback: processedCallbackLine | ||
processedCallback?: processedCallbackLine | ||
) => FlatFileParser; | ||
@@ -39,4 +36,3 @@ loop: ( | ||
}; | ||
export declare function FlatFileParser(): FlatFileParser; | ||
export declare const FlatFileParser: () => FlatFileParser; | ||
export declare const flatFileParser: FlatFileParser; |
{ | ||
"name": "flat-file-parser", | ||
"version": "0.7.1", | ||
"version": "0.7.2", | ||
"description": "some Flat File Parser", | ||
"main": "index.js", | ||
"scripts": { | ||
"build": "gulp preBuild", | ||
"bdd-test": "cd tests && mocha ./**/**.spec.js --timeout 10000", | ||
"unit-test": "cd lib && mocha ./**/**.spec.js --timeout 10000", | ||
"test": "npm run bdd-test" | ||
@@ -18,3 +21,14 @@ }, | ||
}, | ||
"homepage": "https://github.com/turn-a-round/node-flat-file-parser#readme" | ||
"homepage": "https://github.com/turn-a-round/node-flat-file-parser#readme", | ||
"devDependencies": { | ||
"chai": "^4.3.6", | ||
"chai-as-promised": "^7.1.1", | ||
"custom-exception": "^0.1.2", | ||
"del": "^6.0.0", | ||
"gulp": "^4.0.2", | ||
"gulp-terser": "^2.1.0", | ||
"mocha": "^9.2.0", | ||
"node-abort-controller": "^3.0.1", | ||
"readable-stream": "^3.6.0" | ||
} | ||
} |
7260
92
9