@percy/config 1.7.1 → 1.8.1
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/dist/validate.js +13 -9
- package/package.json +3 -3
package/dist/validate.js
CHANGED
|
@@ -131,14 +131,18 @@ export function addSchema(schemas) {
|
|
|
131
131
|
ajv.removeSchema('/config');
|
|
132
132
|
|
|
133
133
|
for (let [key, schema] of entries(schemas)) {
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
134
|
+
if (key === '$config') {
|
|
135
|
+
assign(config, typeof schema === 'function' ? schema(config) : schema);
|
|
136
|
+
} else {
|
|
137
|
+
let $id = `/config/${key}`;
|
|
138
|
+
if (ajv.getSchema($id)) ajv.removeSchema($id);
|
|
139
|
+
assign(config.properties, {
|
|
140
|
+
[key]: {
|
|
141
|
+
$ref: $id
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
ajv.addSchema(schema, $id);
|
|
145
|
+
}
|
|
142
146
|
}
|
|
143
147
|
|
|
144
148
|
return ajv.addSchema(config, '/config');
|
|
@@ -155,7 +159,7 @@ function a(word) {
|
|
|
155
159
|
} // Default errors anywhere within these keywords can be confusing
|
|
156
160
|
|
|
157
161
|
|
|
158
|
-
const HIDE_NESTED_KEYWORDS = ['oneOf', 'anyOf', 'allOf', 'not'];
|
|
162
|
+
const HIDE_NESTED_KEYWORDS = ['oneOf', 'anyOf', 'allOf', 'if', 'then', 'else', 'not'];
|
|
159
163
|
|
|
160
164
|
function shouldHideError(key, path, error) {
|
|
161
165
|
var _parentSchema$errors;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@percy/config",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"test:types": "tsd"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@percy/logger": "1.
|
|
37
|
+
"@percy/logger": "1.8.1",
|
|
38
38
|
"ajv": "^8.6.2",
|
|
39
39
|
"cosmiconfig": "^7.0.0",
|
|
40
40
|
"yaml": "^2.0.0"
|
|
@@ -42,5 +42,5 @@
|
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"json-schema-typed": "^7.0.3"
|
|
44
44
|
},
|
|
45
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "497772c62e2fa2d763b350c40a0cfec918f7125f"
|
|
46
46
|
}
|