import deprecate from "./deprecate" ; param { Output } output param { Page } page param { Object } result return { Page } function decodePage ( output , page , result ) { const originalContent = page . getContent ( ) ; if ( ! result ) { return page ; } deprecate . disable ( "page.sections" ) ; if ( result . content != originalContent ) { page = page . set ( "content" , result . content ) ; } else if ( result . sections ) { page = page . set ( "content" , result . sections . map ( ( section ) => { return section . content ; } ) . join ( "\n" ) ) ; } deprecate . enable ( "page.sections" ) ; return page ; } export default decodePage ;