5etools-utils 0.2.0 → 0.2.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.
Files changed (2) hide show
  1. package/lib/TestJson.js +3 -3
  2. package/package.json +1 -1
package/lib/TestJson.js CHANGED
@@ -130,14 +130,14 @@ class JsonTester {
130
130
  this._addImplicits(data);
131
131
 
132
132
  const isValid = this._ajv.validate(this._fnGetSchemaId(filePath), data);
133
- if (isValid) return {};
133
+ if (isValid) return {errors: [], errorsFull: []};
134
134
 
135
135
  return this._getErrors({filePath, data});
136
136
  }
137
137
 
138
138
  _doRunOnDir ({isFailFast, dir, errors, errorsFull, ...opts} = {}) {
139
139
  for (const filePath of uf.listJsonFiles(dir, opts)) {
140
- const {errors: errorsFile = [], errorsFull: errorsFullFile = []} = this.getFileErrors({filePath});
140
+ const {errors: errorsFile, errorsFull: errorsFullFile} = this.getFileErrors({filePath});
141
141
  errors.push(...errorsFile);
142
142
  errorsFull.push(...errorsFullFile);
143
143
  if (isFailFast && (errorsFile.length || errorsFullFile.length)) break;
@@ -243,7 +243,7 @@ class JsonTester {
243
243
  });
244
244
  }
245
245
 
246
- await Promise.all(workers.map(it => it.dIsActive.promise));
246
+ await Promise.all(workers.map(it => it.dIsActive?.promise));
247
247
  await Promise.all(workers.map(it => it.terminate()));
248
248
 
249
249
  return {errors, errorsFull};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "5etools-utils",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "description": "Shared utilities for the 5etools ecosystem.",
5
5
  "type": "module",
6
6
  "main": "lib/Api.js",