semanticdb-core 1.1.25 → 1.1.26
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.
|
@@ -47,11 +47,11 @@ function isSchemaValid(schema, schemasDict) {
|
|
|
47
47
|
if (typeof schema.syno === 'string') {
|
|
48
48
|
schema.syno = schema.syno.split(',');
|
|
49
49
|
}
|
|
50
|
-
const schemaNames = [schema.name, ...(schema.syno || [])];
|
|
50
|
+
const schemaNames = [schema.name, ...(schema.syno || [])].filter(n => n.trim().length > 0);
|
|
51
51
|
let hierarchyNames = [];
|
|
52
52
|
if (schema.hierarchy) {
|
|
53
53
|
for (const h of schema.hierarchy) {
|
|
54
|
-
hierarchyNames = [...hierarchyNames, h.name, ...(h.syno || [])];
|
|
54
|
+
hierarchyNames = [...hierarchyNames, h.name, ...(h.syno || [])].filter(n => n.trim().length > 0);
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
// ==================== RULE: schema和hierarchy不能有名词重复 ====================
|
|
@@ -189,7 +189,7 @@ function isPropertyValid(property, schemaNames = [], hierarchyNames = []) {
|
|
|
189
189
|
propertySyno = syno.split(',');
|
|
190
190
|
}
|
|
191
191
|
// RULE: 属性名或者属性syno不能和schema名和schema syno一样
|
|
192
|
-
const propertyNames = [property.name || '', ...propertySyno];
|
|
192
|
+
const propertyNames = [property.name || '', ...propertySyno].filter(n => n.trim().length > 0);
|
|
193
193
|
const conflicts = _intersection(schemaNames, propertyNames);
|
|
194
194
|
if (conflicts.length > 0) {
|
|
195
195
|
return { valid: false, message: `属性${property.name}和Schema包含相同的关键词: ${conflicts.join(',')}` };
|