注释了一个assert的边界

This commit is contained in:
Xu Chang 2024-02-05 15:49:05 +08:00
parent 36c1eb9d18
commit 745d7c6452
3 changed files with 6 additions and 3 deletions

View File

@ -750,7 +750,8 @@ export default class TreeStore extends CascadeStore {
}
if (row[`${attr}Id`] === undefined) {
// 说明一对多的外键没有取出来需要抛出RowUnexists异常
assert(typeof projection[attr] === 'object');
// 这个assert在count的情况下不满足 by Xc 20240205
// assert(typeof projection[attr] === 'object');
if (option?.ignoreAttrMiss) {
if (process.env.NODE_ENV === 'development') {
console.warn(`对象${entity}上的${attr}Id不能确定值可能会影响判定结果`);

View File

@ -752,7 +752,8 @@ class TreeStore extends CascadeStore_1.CascadeStore {
}
if (row[`${attr}Id`] === undefined) {
// 说明一对多的外键没有取出来需要抛出RowUnexists异常
(0, assert_1.assert)(typeof projection[attr] === 'object');
// 这个assert在count的情况下不满足 by Xc 20240205
// assert(typeof projection[attr] === 'object');
if (option?.ignoreAttrMiss) {
if (process.env.NODE_ENV === 'development') {
console.warn(`对象${entity}上的${attr}Id不能确定值可能会影响判定结果`);

View File

@ -926,7 +926,8 @@ export default class TreeStore<ED extends EntityDict & BaseEntityDict> extends C
}
if ((row as any)[`${attr}Id`] === undefined) {
// 说明一对多的外键没有取出来需要抛出RowUnexists异常
assert(typeof projection[attr] === 'object');
// 这个assert在count的情况下不满足 by Xc 20240205
// assert(typeof projection[attr] === 'object');
if (option?.ignoreAttrMiss) {
if (process.env.NODE_ENV === 'development') {
console.warn(`对象${entity as string}上的${attr}Id不能确定值可能会影响判定结果`);