@percy/config 1.30.9-beta.3 → 1.30.9
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 +17 -0
- package/package.json +4 -4
package/dist/validate.js
CHANGED
|
@@ -290,6 +290,23 @@ export function validate(data, key = '/config') {
|
|
|
290
290
|
}
|
|
291
291
|
});
|
|
292
292
|
}
|
|
293
|
+
if (data.algorithmConfiguration) {
|
|
294
|
+
const pathStr = 'algorithmConfiguration';
|
|
295
|
+
const algorithmType = data.algorithm;
|
|
296
|
+
if (!algorithmType) {
|
|
297
|
+
errors.set(pathStr, {
|
|
298
|
+
path: pathStr,
|
|
299
|
+
message: 'algorithmConfiguration needs algorigthm to be passed'
|
|
300
|
+
});
|
|
301
|
+
}
|
|
302
|
+
const nonAlgoConfigTypes = ['layout'];
|
|
303
|
+
if (nonAlgoConfigTypes.includes(algorithmType)) {
|
|
304
|
+
errors.set(pathStr, {
|
|
305
|
+
path: pathStr,
|
|
306
|
+
message: `algorithmConfiguration is not applicable for '${algorithmType}' algorithm`
|
|
307
|
+
});
|
|
308
|
+
}
|
|
309
|
+
}
|
|
293
310
|
const errorArray = Array.from(errors.values());
|
|
294
311
|
return errorArray.length > 0 ? errorArray : undefined;
|
|
295
312
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@percy/config",
|
|
3
|
-
"version": "1.30.9
|
|
3
|
+
"version": "1.30.9",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
},
|
|
10
10
|
"publishConfig": {
|
|
11
11
|
"access": "public",
|
|
12
|
-
"tag": "
|
|
12
|
+
"tag": "latest"
|
|
13
13
|
},
|
|
14
14
|
"engines": {
|
|
15
15
|
"node": ">=14"
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"test:types": "tsd"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@percy/logger": "1.30.9
|
|
41
|
+
"@percy/logger": "1.30.9",
|
|
42
42
|
"ajv": "^8.6.2",
|
|
43
43
|
"cosmiconfig": "^8.0.0",
|
|
44
44
|
"yaml": "^2.0.0"
|
|
@@ -46,5 +46,5 @@
|
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"json-schema-typed": "^7.0.3"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "bb6e994542280596015cb57f884fe3359be01c22"
|
|
50
50
|
}
|