|
|
@@ -111,7 +111,23 @@ export type IPageInfoAll = IPageInfo | IPageInfoForEntity | IPageInfoForOperatio
|
|
|
|
|
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
|
export const isIPageInfoForEntity = (pageInfo: any | undefined): pageInfo is IPageInfoForEntity => {
|
|
|
- return pageInfo != null;
|
|
|
+ const requiredProperties: (keyof IPageInfoForEntity)[] = [
|
|
|
+ 'isV5Compatible',
|
|
|
+ 'isEmpty',
|
|
|
+ 'isDeletable',
|
|
|
+ 'isAbleToDeleteCompletely',
|
|
|
+ 'isRevertible',
|
|
|
+ 'bookmarkCount',
|
|
|
+ 'sumOfLikers',
|
|
|
+ 'likerIds',
|
|
|
+ 'sumOfSeenUsers',
|
|
|
+ 'seenUserIds',
|
|
|
+ 'contentAge',
|
|
|
+ 'descendantCount',
|
|
|
+ 'commentCount',
|
|
|
+ ];
|
|
|
+
|
|
|
+ return pageInfo != null && requiredProperties.every(prop => prop in pageInfo);
|
|
|
};
|
|
|
|
|
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|