@percy/config 1.0.7 → 1.1.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/utils/normalize.js +10 -8
- package/package.json +3 -3
package/dist/utils/normalize.js
CHANGED
|
@@ -25,23 +25,25 @@ export function normalize(object, options) {
|
|
|
25
25
|
};
|
|
26
26
|
let keycase = (_options = options) !== null && _options !== void 0 && _options.kebab ? kebabcase : camelcase;
|
|
27
27
|
return merge([object, (_options2 = options) === null || _options2 === void 0 ? void 0 : _options2.overrides], (path, value) => {
|
|
28
|
-
var _options3, _schemas$shift
|
|
28
|
+
var _options3, _schemas$shift;
|
|
29
29
|
|
|
30
30
|
let schemas = getSchema((_options3 = options) === null || _options3 === void 0 ? void 0 : _options3.schema, path.map(camelcase));
|
|
31
|
-
let skip = ((_schemas$shift = schemas.shift()) === null || _schemas$shift === void 0 ? void 0 : _schemas$shift.normalize) === false
|
|
31
|
+
let skip = ((_schemas$shift = schemas.shift()) === null || _schemas$shift === void 0 ? void 0 : _schemas$shift.normalize) === false;
|
|
32
|
+
let mapped = []; // skip normalizing paths of class instances
|
|
32
33
|
|
|
33
34
|
if (!skip && typeof value === 'object' && value !== null && value !== void 0 && value.constructor) {
|
|
34
35
|
skip = Object.getPrototypeOf(value) !== Object.prototype;
|
|
35
36
|
}
|
|
36
37
|
|
|
37
|
-
|
|
38
|
-
var _schemas$i;
|
|
38
|
+
for (let [i, k] of path.entries()) {
|
|
39
|
+
var _options4, _options4$skip, _schemas$i;
|
|
39
40
|
|
|
40
|
-
|
|
41
|
+
skip || (skip = (_options4 = options) === null || _options4 === void 0 ? void 0 : (_options4$skip = _options4.skip) === null || _options4$skip === void 0 ? void 0 : _options4$skip.call(_options4, mapped.concat(k)));
|
|
42
|
+
mapped.push(skip ? k : keycase(k));
|
|
41
43
|
skip || (skip = ((_schemas$i = schemas[i]) === null || _schemas$i === void 0 ? void 0 : _schemas$i.normalize) === false);
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
return [
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
return [mapped];
|
|
45
47
|
});
|
|
46
48
|
}
|
|
47
49
|
export default normalize;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@percy/config",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.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.1.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": "d74af6a294f89fcb23c4ec598bb68a884ce47907"
|
|
46
46
|
}
|