import { DocumentData } from "../../../../client/firebase-admin" ; import { HubEventActions } from "./interfaces" ; export function isExistProperties ( obj , keys ) { if ( ! obj ) { return false ; } for ( const key of keys ) { if ( ! obj . hasOwnProperty ( key ) ) { return false ; } } return true ; } export function addHubEventToCollection ( repository , event ) { if ( ! Array . isArray ( repository . events ) ) { repository . events = [ ] ; } repository . events . unshift ( event . convertToHubEvent ( ) ) ; }