export const commentHrefToIds = ( commentHref ) => { const match = commentHref . match ( /\/questions\/(\d+)\/[^\/]+(?:\/\d+)?[^#]*#comment(\d+)_(\d+)/ ) ! ; const [ , questionId , commentId , postId ] = match . map ( Number ) ; return { questionId , commentId , postId , isAnswer : postId !== questionId } ; } ;