@engine9-io/input-tools 1.7.1 → 1.7.3

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.
package/ForEachEntry.js CHANGED
@@ -117,7 +117,7 @@ class ForEachEntry {
117
117
  if (binding.path === 'output.timeline') {
118
118
  const { stream: streamImpl, promises, files } = await this.getOutputStream({
119
119
  name: bindingName,
120
- postfix: '.timeline.csv',
120
+ postfix: binding.options?.postfix || '.timeline.csv',
121
121
  validatorFunction: (data) => {
122
122
  if (!data) return true;
123
123
  if (typeof data !== 'object') throw new Error('Invalid timeline data push, must be an object');
@@ -134,7 +134,7 @@ class ForEachEntry {
134
134
  } else if (binding.path === 'output.stream') {
135
135
  const { stream: streamImpl, promises, files } = await this.getOutputStream({
136
136
  name: bindingName,
137
- postfix: '.output.csv',
137
+ postfix: binding.options?.postfix || '.timeline.csv',
138
138
  });
139
139
  newStreams.push(streamImpl);
140
140
  transformArguments[bindingName] = streamImpl;
@@ -190,7 +190,6 @@ Worker.prototype.fileToObjectStream = async function (options) {
190
190
 
191
191
  debug(`Reading file ${filename} with encoding:`, encoding);
192
192
 
193
- const head = null;
194
193
  let transforms = [];
195
194
 
196
195
  if (postfix === 'gz') {
@@ -270,13 +269,14 @@ Worker.prototype.fileToObjectStream = async function (options) {
270
269
  },
271
270
  flush(cb) {
272
271
  // If there's no records at all, push a dummy record, and specify 0 records
272
+ // Don't push dummy records anymore -- legacy cruft
273
273
  debug(`Completed reading file, records=${count}`);
274
- if (count === 0) {
274
+ /* if (count === 0) {
275
275
  const o = { _is_placeholder: true };
276
276
 
277
277
  if (head) head.forEach((c) => { o[c] = null; });
278
278
  this.push(o);
279
- }
279
+ } */
280
280
  cb();
281
281
  },
282
282
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@engine9-io/input-tools",
3
- "version": "1.7.1",
3
+ "version": "1.7.3",
4
4
  "description": "Tools for dealing with Engine9 inputs",
5
5
  "main": "index.js",
6
6
  "scripts": {