import detectIndent from 'detect-indent' ; import redent from 'redent' ; export param { string } code returns { string } export default function indentCode ( code ) { if ( typeof code === 'string' ) { const indent = detectIndent ( code ) . indent || '\t' ; code = redent ( code , 0 , { indent } ) ; return code . trim ( ) ; } else { return code ; } }