ffc-pay-etl-framework 1.1.7 → 1.1.8-alpha.2

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.
@@ -7,9 +7,11 @@ const { parse } = require("csv-parse");
7
7
  * @param {Object} options
8
8
  * @param {String} [options.path]
9
9
  * @param {ReadableStream} [options.stream]
10
+ * @param {Number} [options.startingLine]
10
11
  * @returns StreamReader
11
12
  */
12
13
  function CSVLoader(options) {
14
+ var _a;
13
15
  let csvLoader;
14
16
  if (options.path) {
15
17
  csvLoader = fs.createReadStream(options.path);
@@ -18,10 +20,11 @@ function CSVLoader(options) {
18
20
  csvLoader = options.stream;
19
21
  }
20
22
  let lineCount = 1;
23
+ let fromLine = (_a = options.startingLine) !== null && _a !== void 0 ? _a : 2;
21
24
  csvLoader._columns = options.columns;
22
25
  csvLoader.pump = (csvLoader) => {
23
26
  return csvLoader
24
- .pipe(parse({ delimiter: ",", from_line: 2 }))
27
+ .pipe(parse({ delimiter: ",", from_line: fromLine }))
25
28
  .pipe(new Transform({
26
29
  readableObjectMode: true,
27
30
  writableObjectMode: true,
@@ -4,11 +4,13 @@
4
4
  * @param {Object} options
5
5
  * @param {String} [options.path]
6
6
  * @param {ReadableStream} [options.stream]
7
+ * @param {Number} [options.startingLine]
7
8
  * @returns StreamReader
8
9
  */
9
10
  export function CSVLoader(options: {
10
11
  path?: string;
11
12
  stream?: ReadableStream;
13
+ startingLine?: number;
12
14
  }): ReadableStream<any> | fs.ReadStream;
13
15
  import fs = require("fs");
14
16
  //# sourceMappingURL=csvloader.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"csvloader.d.ts","sourceRoot":"","sources":["../../../../src/loaders/csvloader.js"],"names":[],"mappings":";AAKA;;;;;;GAMG;AACH;IAJ4B,IAAI;IACI,MAAM,GAA/B,cAAc;wCAqCxB"}
1
+ {"version":3,"file":"csvloader.d.ts","sourceRoot":"","sources":["../../../../src/loaders/csvloader.js"],"names":[],"mappings":";AAKA;;;;;;;GAOG;AACH;IAL4B,IAAI;IACI,MAAM,GAA/B,cAAc;IACG,YAAY;wCAsCvC"}
@@ -9,6 +9,7 @@ const { parse } = require("csv-parse");
9
9
  * @param {Object} options
10
10
  * @param {String} [options.path]
11
11
  * @param {ReadableStream} [options.stream]
12
+ * @param {Number} [options.startingLine]
12
13
  * @returns StreamReader
13
14
  */
14
15
  function CSVLoader(options) {
@@ -20,10 +21,11 @@ function CSVLoader(options) {
20
21
  csvLoader = options.stream;
21
22
  }
22
23
  let lineCount = 1;
24
+ let fromLine = options.startingLine ?? 2;
23
25
  csvLoader._columns = options.columns;
24
26
  csvLoader.pump = (csvLoader) => {
25
27
  return csvLoader
26
- .pipe(parse({ delimiter: ",", from_line: 2 }))
28
+ .pipe(parse({ delimiter: ",", from_line: fromLine }))
27
29
  .pipe(new Transform({
28
30
  readableObjectMode: true,
29
31
  writableObjectMode: true,
@@ -4,11 +4,13 @@
4
4
  * @param {Object} options
5
5
  * @param {String} [options.path]
6
6
  * @param {ReadableStream} [options.stream]
7
+ * @param {Number} [options.startingLine]
7
8
  * @returns StreamReader
8
9
  */
9
10
  export function CSVLoader(options: {
10
11
  path?: string;
11
12
  stream?: ReadableStream;
13
+ startingLine?: number;
12
14
  }): ReadableStream<any> | fs.ReadStream;
13
15
  import fs = require("fs");
14
16
  //# sourceMappingURL=csvloader.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"csvloader.d.ts","sourceRoot":"","sources":["../../../../src/loaders/csvloader.js"],"names":[],"mappings":";AAKA;;;;;;GAMG;AACH;IAJ4B,IAAI;IACI,MAAM,GAA/B,cAAc;wCAqCxB"}
1
+ {"version":3,"file":"csvloader.d.ts","sourceRoot":"","sources":["../../../../src/loaders/csvloader.js"],"names":[],"mappings":";AAKA;;;;;;;GAOG;AACH;IAL4B,IAAI;IACI,MAAM,GAA/B,cAAc;IACG,YAAY;wCAsCvC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ffc-pay-etl-framework",
3
- "version": "1.1.7",
3
+ "version": "1.1.8-alpha.2",
4
4
  "publisher": "Defra",
5
5
  "main": "dist/cjs/index.js",
6
6
  "private": false,