@engine9-io/input-tools 1.5.0 → 1.5.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.
@@ -725,10 +725,10 @@ Worker.prototype.download.metadata = {
725
725
  };
726
726
 
727
727
  Worker.prototype.head = async function (options) {
728
- const { stream } = await this.fileToObjectStream(options);
728
+ const limit = options.limit || 3;
729
+ const { stream } = await this.fileToObjectStream({ ...options, limit });
729
730
  const chunks = [];
730
731
 
731
- const limit = options.limit || 3;
732
732
  let counter = 0;
733
733
  // eslint-disable-next-line no-restricted-syntax
734
734
  for await (const chunk of stream) {
package/file/Parquet.js CHANGED
@@ -45,7 +45,7 @@ Worker.prototype.schema.metadata = {
45
45
  };
46
46
 
47
47
  function cleanColumnName(name) {
48
- name.toLowerCase().replace(/[^a-z0-9_]/g, '_');
48
+ return name.toLowerCase().replace(/[^a-z0-9_]/g, '_');
49
49
  }
50
50
 
51
51
  Worker.prototype.stream = async function (options) {
@@ -60,11 +60,10 @@ Worker.prototype.stream = async function (options) {
60
60
  if (typeof options.columns === 'string') requestedColumns = options.columns.split(',').map((d) => d.trim());
61
61
  else requestedColumns = options.columns.map((d) => (d.name ? d.name.trim() : d.trim()));
62
62
  requestedColumns.forEach((c) => {
63
- columns = columns.concat(
64
- fieldList.filter((f) => (
65
- f.name === c || cleanColumnName(f.name) === cleanColumnName(c)
66
- )).map((f) => f.name),
67
- );
63
+ const matchingCols = fieldList.filter((f) => (
64
+ f.name === c || cleanColumnName(f.name) === cleanColumnName(c)
65
+ )).map((f) => f.name);
66
+ columns = columns.concat(matchingCols);
68
67
  });
69
68
  }
70
69
  let limit = 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@engine9-io/input-tools",
3
- "version": "1.5.0",
3
+ "version": "1.5.2",
4
4
  "description": "Tools for dealing with Engine9 inputs",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -17,7 +17,7 @@
17
17
  },
18
18
  "dependencies": {
19
19
  "@aws-sdk/client-s3": "^3.723.0",
20
- "@dsnp/parquetjs": "^1.8.6",
20
+ "@dsnp/parquetjs": "^1.8.7",
21
21
  "archiver": "^7.0.1",
22
22
  "async-mutex": "^0.5.0",
23
23
  "csv": "^6.3.11",