@engine9-io/input-tools 1.7.6 → 1.7.7

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.
@@ -153,7 +153,7 @@ Worker.prototype.detectEncoding.metadata = {
153
153
  Internal method to transform a file into a stream of objects.
154
154
  */
155
155
  Worker.prototype.fileToObjectStream = async function (options) {
156
- const { filename, columns, limit: limitOption } = options;
156
+ const { filename, columns, limit: limitOption,format:formatOverride } = options;
157
157
 
158
158
  // handle stream item
159
159
  if (options.stream) {
@@ -203,14 +203,15 @@ Worker.prototype.fileToObjectStream = async function (options) {
203
203
  } else {
204
204
  stream.setEncoding(encoding);
205
205
  }
206
+ let format=formatOverride || postfix;
206
207
 
207
- if (postfix === 'csv') {
208
+ if (format === 'csv') {
208
209
  const csvTransforms = this.csvToObjectTransforms({ ...options });
209
210
  transforms = transforms.concat(csvTransforms.transforms);
210
- } else if (postfix === 'txt') {
211
+ } else if (format === 'txt') {
211
212
  const csvTransforms = this.csvToObjectTransforms({ ...options, delimiter: '\t' });
212
213
  transforms = transforms.concat(csvTransforms.transforms);
213
- } else if (postfix === 'jsonl') {
214
+ } else if (format === 'jsonl') {
214
215
  /* Type of JSON that has the names in an array in the first record,
215
216
  and the values in JSON arrays thereafter
216
217
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@engine9-io/input-tools",
3
- "version": "1.7.6",
3
+ "version": "1.7.7",
4
4
  "description": "Tools for dealing with Engine9 inputs",
5
5
  "main": "index.js",
6
6
  "scripts": {