Merge branch 'dev' of gitea.51mars.com:Oak-Team/oak-domain into dev

This commit is contained in:
Xu Chang 2024-08-03 19:30:20 +08:00
commit ceafb7f68a
3 changed files with 10 additions and 6 deletions

View File

@ -715,7 +715,9 @@ function analyzeSchemaDefinition(node, moduleName, filename, path, program, refe
}
}
else {
throw new Error(`对象${moduleName}中定义的属性${attrName}是不可识别的数组类别`);
schemaAttrs.push(attrNode);
analyzeExternalAttrImport(type.elementType, program, importAttrFrom, relativePath);
// throw new Error(`对象${moduleName}中定义的属性${attrName}是不可识别的数组类别`);
}
}
else {
@ -1398,7 +1400,7 @@ function constructSchema(statements, entity) {
}
}
else {
(0, assert_1.default)(ts.isUnionTypeNode(type) || ts.isLiteralTypeNode(type), `${entity}有非法的属性类型定义${name.text}`);
// assert(ts.isUnionTypeNode(type!) || ts.isLiteralTypeNode(type!), `${entity}有非法的属性类型定义${(<ts.Identifier>name).text}`);
members.push(factory.createPropertySignature(undefined, name, questionToken, questionToken ? factory.createUnionTypeNode([
type,
factory.createLiteralTypeNode(factory.createNull())

View File

@ -1,6 +1,6 @@
{
"name": "oak-domain",
"version": "5.0.18",
"version": "5.0.19",
"author": {
"name": "XuChang"
},

View File

@ -977,7 +977,9 @@ function analyzeSchemaDefinition(
}
}
else {
throw new Error(`对象${moduleName}中定义的属性${attrName}是不可识别的数组类别`);
schemaAttrs.push(attrNode);
analyzeExternalAttrImport(type.elementType, program, importAttrFrom, relativePath);
// throw new Error(`对象${moduleName}中定义的属性${attrName}是不可识别的数组类别`);
}
}
else {
@ -1898,14 +1900,14 @@ function constructSchema(statements: Array<ts.Statement>, entity: string) {
}
}
else {
assert(ts.isUnionTypeNode(type!) || ts.isLiteralTypeNode(type!), `${entity}有非法的属性类型定义${(<ts.Identifier>name).text}`);
// assert(ts.isUnionTypeNode(type!) || ts.isLiteralTypeNode(type!), `${entity}有非法的属性类型定义${(<ts.Identifier>name).text}`);
members.push(
factory.createPropertySignature(
undefined,
name,
questionToken,
questionToken ? factory.createUnionTypeNode([
type,
type!,
factory.createLiteralTypeNode(factory.createNull())
]) : type
)