import { isViewActivityValid } from './view'
function isRootActivityValid (activity: any) {
- return Array.isArray(activity['@context']) &&
+ return Array.isArray(activity['@context']) && (
(
(activity.type === 'Collection' || activity.type === 'OrderedCollection') &&
validator.isInt(activity.totalItems, { min: 0 }) &&
isActivityPubUrlValid(activity.id) &&
(isActivityPubUrlValid(activity.actor) || isActivityPubUrlValid(activity.actor.id))
)
+ )
}
const activityCheckers: { [ P in ActivityType ]: (activity: Activity) => boolean } = {