@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.
- package/file/FileUtilities.js +5 -1
- package/index.js +1 -1
- package/package.json +1 -1
- package/test/file.js +2 -2
package/file/FileUtilities.js
CHANGED
|
@@ -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(
|
|
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
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:
|
|
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:
|
|
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
|
});
|