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 { else {
throw new Error(`对象${moduleName}中定义的属性${attrName}是不可识别的数组类别`); schemaAttrs.push(attrNode);
analyzeExternalAttrImport(type.elementType, program, importAttrFrom, relativePath);
// throw new Error(`对象${moduleName}中定义的属性${attrName}是不可识别的数组类别`);
} }
} }
else { else {
@ -1398,7 +1400,7 @@ function constructSchema(statements, entity) {
} }
} }
else { 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([ members.push(factory.createPropertySignature(undefined, name, questionToken, questionToken ? factory.createUnionTypeNode([
type, type,
factory.createLiteralTypeNode(factory.createNull()) factory.createLiteralTypeNode(factory.createNull())

View File

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

View File

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