5etools-utils 0.5.1 → 0.5.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/lib/TestData.js +13 -6
- package/package.json +1 -1
package/lib/TestData.js
CHANGED
|
@@ -59,7 +59,7 @@ class DataTesterBase {
|
|
|
59
59
|
|
|
60
60
|
static addMessageBoundary () {
|
|
61
61
|
if (!this._MESSAGE.trim()) return;
|
|
62
|
-
if (this._MESSAGE.
|
|
62
|
+
if (this._MESSAGE.slice(-5) === "\n---\n") return;
|
|
63
63
|
this._MESSAGE = this._MESSAGE.trimEnd();
|
|
64
64
|
this._MESSAGE += `\n---\n`;
|
|
65
65
|
}
|
|
@@ -137,12 +137,23 @@ class EscapeCharacterCheck extends DataTesterBase {
|
|
|
137
137
|
});
|
|
138
138
|
if (this._errors.length) {
|
|
139
139
|
this._addMessage(`Unwanted escape characters in ${file}! See below:\n`);
|
|
140
|
-
this._addMessage(`\t${this._errors.join("\n\t")}`);
|
|
140
|
+
this._addMessage(`\t${this._errors.join("\n\t")}\n`);
|
|
141
141
|
}
|
|
142
142
|
}
|
|
143
143
|
}
|
|
144
144
|
|
|
145
145
|
class DataTester {
|
|
146
|
+
static register (
|
|
147
|
+
{
|
|
148
|
+
ClazzDataTesters,
|
|
149
|
+
},
|
|
150
|
+
) {
|
|
151
|
+
ClazzDataTesters.forEach(ClazzDataTester => {
|
|
152
|
+
ClazzDataTester.registerParsedPrimitiveHandlers(_ParsedJsonChecker);
|
|
153
|
+
ClazzDataTester.registerParsedFileCheckers(_ParsedJsonChecker);
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
|
|
146
157
|
static async pRun (
|
|
147
158
|
filePath,
|
|
148
159
|
ClazzDataTesters,
|
|
@@ -151,10 +162,6 @@ class DataTester {
|
|
|
151
162
|
fnIsIgnoredDirector,
|
|
152
163
|
} = {},
|
|
153
164
|
) {
|
|
154
|
-
ClazzDataTesters.forEach(ClazzDataTester => {
|
|
155
|
-
ClazzDataTester.registerParsedPrimitiveHandlers(_ParsedJsonChecker);
|
|
156
|
-
ClazzDataTester.registerParsedFileCheckers(_ParsedJsonChecker);
|
|
157
|
-
});
|
|
158
165
|
_ParsedJsonChecker.run(filePath, {fnIsIgnoredFile, fnIsIgnoredDirector});
|
|
159
166
|
|
|
160
167
|
for (const ClazzDataTester of ClazzDataTesters) {
|