param { SummaryArticle } return { Object } import SummaryArticle from "../models/summaryArticle" ; function encodeSummaryArticle ( article , recursive ? ) { let articles = undefined ; if ( recursive !== false ) { articles = article . getArticles ( ) . map ( ( article ) => encodeSummaryArticle ( article ) ) . toJS ( ) ; } return { title : article . getTitle ( ) , level : article . getLevel ( ) , depth : article . getDepth ( ) , anchor : article . getAnchor ( ) , url : article . getUrl ( ) , path : article . getPath ( ) , ref : article . getRef ( ) , articles : articles , } ; } export default encodeSummaryArticle ;