import { RecordProxy } from "relay-runtime" ; import { MAX_REPLY_INDENT_DEPTH } from "coral-stream/constants" ; param comment param depth export default function getFlattenedReplyAncestorID ( comment , depth ) { const iterations = depth - ( MAX_REPLY_INDENT_DEPTH - 1 ) ; let cur = comment ; for ( let i = 0 ; i < iterations ; i ++ ) { cur = cur . getLinkedRecord ( "parent" ) ; } return cur . getValue ( "id" ) ; }