convention_builder 1.8.0 → 1.8.2
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/module/index.js +18 -1
- package/dist/node/index.js +18 -1
- package/package.json +1 -1
package/dist/module/index.js
CHANGED
|
@@ -10681,9 +10681,23 @@ var require_convention_builder = __commonJS({
|
|
|
10681
10681
|
* @param {} attribute
|
|
10682
10682
|
*/
|
|
10683
10683
|
cleanGenericSection({ attribute }) {
|
|
10684
|
-
|
|
10684
|
+
let isObject = attribute.match(/\./);
|
|
10685
10685
|
this.unmodifiedAttributes.add(attribute);
|
|
10686
10686
|
this.modifiedAttributes.delete(attribute);
|
|
10687
|
+
if (isObject) {
|
|
10688
|
+
bury(this.overlay.properties.attributes.properties, attribute.replace(".value", ""), void 0, false);
|
|
10689
|
+
let firstLevel = attribute.split(/\./)[0];
|
|
10690
|
+
let siblingModifications = Array.from(this.modifiedAttributes).filter((attr) => attr != attribute).filter((attr) => attr.includes(`${firstLevel}.`));
|
|
10691
|
+
let isOnlyModification = siblingModifications.length == 0;
|
|
10692
|
+
console.log(`${attribute} is only modification? ${isOnlyModification}, there are ${siblingModifications.join(", ")}`);
|
|
10693
|
+
if (isOnlyModification) {
|
|
10694
|
+
delete this.overlay.properties.attributes.properties[firstLevel];
|
|
10695
|
+
}
|
|
10696
|
+
;
|
|
10697
|
+
} else {
|
|
10698
|
+
delete this.overlay.properties.attributes.properties[attribute];
|
|
10699
|
+
}
|
|
10700
|
+
;
|
|
10687
10701
|
this.updateSchema();
|
|
10688
10702
|
}
|
|
10689
10703
|
/**
|
|
@@ -10917,6 +10931,9 @@ var require_convention_builder = __commonJS({
|
|
|
10917
10931
|
let overlayNames = Object.keys(overlays);
|
|
10918
10932
|
this.overlays = {};
|
|
10919
10933
|
overlayNames.forEach((ovrl) => {
|
|
10934
|
+
overlays[ovrl].baseSchemataFolder = this.baseSchemataFolder;
|
|
10935
|
+
delete overlays[ovrl].baseSchema;
|
|
10936
|
+
delete overlays[ovrl].schema;
|
|
10920
10937
|
this.overlays[ovrl] = new SchemaOverlay(overlays[ovrl]);
|
|
10921
10938
|
this.overlays[ovrl].updateSchema();
|
|
10922
10939
|
});
|
package/dist/node/index.js
CHANGED
|
@@ -10674,9 +10674,23 @@ var require_convention_builder = __commonJS({
|
|
|
10674
10674
|
* @param {} attribute
|
|
10675
10675
|
*/
|
|
10676
10676
|
cleanGenericSection({ attribute }) {
|
|
10677
|
-
|
|
10677
|
+
let isObject = attribute.match(/\./);
|
|
10678
10678
|
this.unmodifiedAttributes.add(attribute);
|
|
10679
10679
|
this.modifiedAttributes.delete(attribute);
|
|
10680
|
+
if (isObject) {
|
|
10681
|
+
bury(this.overlay.properties.attributes.properties, attribute.replace(".value", ""), void 0, false);
|
|
10682
|
+
let firstLevel = attribute.split(/\./)[0];
|
|
10683
|
+
let siblingModifications = Array.from(this.modifiedAttributes).filter((attr) => attr != attribute).filter((attr) => attr.includes(`${firstLevel}.`));
|
|
10684
|
+
let isOnlyModification = siblingModifications.length == 0;
|
|
10685
|
+
console.log(`${attribute} is only modification? ${isOnlyModification}, there are ${siblingModifications.join(", ")}`);
|
|
10686
|
+
if (isOnlyModification) {
|
|
10687
|
+
delete this.overlay.properties.attributes.properties[firstLevel];
|
|
10688
|
+
}
|
|
10689
|
+
;
|
|
10690
|
+
} else {
|
|
10691
|
+
delete this.overlay.properties.attributes.properties[attribute];
|
|
10692
|
+
}
|
|
10693
|
+
;
|
|
10680
10694
|
this.updateSchema();
|
|
10681
10695
|
}
|
|
10682
10696
|
/**
|
|
@@ -10910,6 +10924,9 @@ var require_convention_builder = __commonJS({
|
|
|
10910
10924
|
let overlayNames = Object.keys(overlays);
|
|
10911
10925
|
this.overlays = {};
|
|
10912
10926
|
overlayNames.forEach((ovrl) => {
|
|
10927
|
+
overlays[ovrl].baseSchemataFolder = this.baseSchemataFolder;
|
|
10928
|
+
delete overlays[ovrl].baseSchema;
|
|
10929
|
+
delete overlays[ovrl].schema;
|
|
10913
10930
|
this.overlays[ovrl] = new SchemaOverlay2(overlays[ovrl]);
|
|
10914
10931
|
this.overlays[ovrl].updateSchema();
|
|
10915
10932
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "convention_builder",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.2",
|
|
4
4
|
"description": "Helper tools that offer a high level interface that transforms a convention description into it's json schema.",
|
|
5
5
|
"main": "./dist/node/index.js",
|
|
6
6
|
"browser": "./dist/browser/index.js",
|