5etools-utils 0.1.7 → 0.1.8

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 -1
  2. package/package.json +1 -1
package/lib/TestJson.js CHANGED
@@ -19,11 +19,13 @@ class JsonTester {
19
19
  dirSchema,
20
20
  dir = ".",
21
21
  tagLog = LOG_TAG,
22
+ fnGetSchemaId = () => "homebrew.json",
22
23
  },
23
24
  ) {
24
25
  this._dirSchema = dirSchema;
25
26
  this._dir = dir;
26
27
  this._tagLog = tagLog;
28
+ this._fnGetSchemaId = fnGetSchemaId;
27
29
 
28
30
  // region Set up validator
29
31
  this._ajv = new Ajv({
@@ -113,7 +115,7 @@ class JsonTester {
113
115
  .forEach(filePath => {
114
116
  const data = uf.readJSON(filePath);
115
117
  this._addImplicits(data);
116
- const valid = this._ajv.validate("homebrew.json", data);
118
+ const valid = this._ajv.validate(this._fnGetSchemaId(filePath), data);
117
119
 
118
120
  if (!valid) this._handleError({filePath, errors, errorsFull, data});
119
121
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "5etools-utils",
3
- "version": "0.1.7",
3
+ "version": "0.1.8",
4
4
  "description": "Shared utilities for the 5etools ecosystem.",
5
5
  "type": "module",
6
6
  "main": "lib/Api.js",