Skip to content

Commit

Permalink
continue
Browse files Browse the repository at this point in the history
  • Loading branch information
big-camel committed Mar 5, 2023
1 parent 17d1d38 commit 0cd9166
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/engine/src/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ class Schema implements SchemaInterface {
}

rules.forEach((rule) => {
const rules = this.data[`${rule.type}s`];
if (isSchemaRule(rule)) {
//删除全局属性已有的规则
if (rule.attributes) {
Expand Down Expand Up @@ -88,23 +89,22 @@ class Schema implements SchemaInterface {
}
});
}
const rules = this.data[`${rule.type}s`];
if (rules) {
if (isMerge) {
this.data[`${rule.type}s`].map((item) => {
this.data[`${rule.type}s`] = rules.map((item) => {
if (item.name === rule.name) {
item.attributes = merge(
Object.assign({}, item.attributes),
rule.attributes,
);
}
item;
return item;
});
} else {
this.data[`${rule.type}s`].push(rule);
rules.push(rule);
}
}
} else if (!!this.data[`${rule.type}s`]) {
} else if (!!rules) {
this.data.globals[rule.type] = merge(
Object.assign({}, this.data.globals[rule.type]),
rule.attributes,
Expand Down

0 comments on commit 0cd9166

Please sign in to comment.