import { CustomRefactorTemplate } from '~/core/types' ; export function resolveRefactorTemplate ( arr = [ ] ) { return arr . map ( ( i ) => { if ( typeof i === 'string' ) { return { templates : [ i ] , } ; } const templates = i . templates || [ ] ; if ( i . template && typeof i . template === 'string' ) templates . push ( i . template ) ; return { ... i , templates , } ; } ) ; }