@engine9-io/input-tools 2.0.1 → 2.0.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.
@@ -530,7 +530,11 @@ Worker.prototype.stream = async function (options) {
530
530
  try {
531
531
  await fsp.stat(filename);
532
532
  } catch (e) {
533
- debug(`Error reading file ${filename}, current directory: ${process.cwd()},__dirname:${__dirname}`);
533
+ debug(
534
+ `Error reading file ${filename}, current directory: ${process.cwd()},import.meta.dirname:${
535
+ import.meta.dirname
536
+ }`
537
+ );
534
538
  throw e;
535
539
  }
536
540
  stream = fs.createReadStream(filename);
package/index.js CHANGED
@@ -253,7 +253,7 @@ function getTimelineEntryUUID(inputObject, { defaults = {} } = {}) {
253
253
  // get a temp ID
254
254
  if (!o.input_id)
255
255
  throw new Error('Error generating timeline entry uuid -- remote_entry_id specified, but no input_id');
256
- const uuid = uuidv5(o.remote_entry_id, o.input_id);
256
+ const uuid = uuidv5(String(o.remote_entry_id), o.input_id);
257
257
  // Change out the ts to match the v7 sorting.
258
258
  // But because outside specified remote_entry_uuid
259
259
  // may not match this standard, uuid sorting isn't guaranteed
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@engine9-io/input-tools",
3
- "version": "2.0.1",
3
+ "version": "2.0.3",
4
4
  "type": "module",
5
5
  "description": "Tools for dealing with Engine9 inputs",
6
6
  "main": "index.js",
package/test/file.js CHANGED
@@ -16,8 +16,8 @@ it('Should list a directory', async () => {
16
16
  });
17
17
  it('Should be able to analyze CSV files with and without header lines', async () => {
18
18
  const futil = new FileUtilities({ accountId: 'test' });
19
- const f1 = await futil.columns({ filename: __dirname + '/sample/fileWithHead.csv' });
19
+ const f1 = await futil.columns({ filename: import.meta.dirname + '/sample/fileWithHead.csv' });
20
20
  assert.equal(f1.likelyHeaderLines, 1, 'Number of header lines should be 1');
21
- const f2 = await futil.columns({ filename: __dirname + '/sample/fileWithoutHead.csv' });
21
+ const f2 = await futil.columns({ filename: import.meta.dirname + '/sample/fileWithoutHead.csv' });
22
22
  assert.equal(f2.likelyHeaderLines, 0, 'Number of header lines should be 1');
23
23
  });