@@ -63,7 +63,7 @@ export const createStdout = (formatterOrText, name = 'VueCommandStdout') => mark
6363
6464 render ( ) {
6565 if ( isFunction ( formatterOrText ) ) {
66- // This is automatically called with the given arguments
66+ // This is automatically called with the bound arguments
6767 return formatterOrText ( )
6868 }
6969
@@ -85,19 +85,17 @@ export const textFormatter = (text, innerHtml = false) => {
8585// Creates a command not found component
8686export const createCommandNotFound = ( command , notFoundText = 'command not found' , name = 'VueCommandNotFound' ) => {
8787 const text = `${ command } : ${ notFoundText } `
88- return createStdout ( textFormatter ( text ) , name )
88+ return createStdout ( text , name )
8989}
9090
9191// Creates a new query component
92- // TODO Add name
9392export const createQuery = ( ) => markRaw ( VueCommandQuery )
9493
9594// A simple query parser which trims the query and splits the arguments by
9695// spaces
9796export const defaultParser = query => split ( trim ( query ) , ' ' )
9897
9998// Formats the given elements as a list
100- // TODO Use HTML to enforce a new line
10199export const listFormatter = ( ...lis ) => {
102100 return ( ) => {
103101 const ul = [ ]
@@ -118,13 +116,11 @@ export const tableFormatter = rows => {
118116 const tbody = [ ]
119117 forEach ( rows , row => {
120118 const trs = [ ]
121- forEach ( row , cell => {
122- const td = h ( 'td' , cell )
123- trs . push ( td )
119+ forEach ( row , td => {
120+ trs . push ( h ( 'td' , td ) )
124121 } )
125122
126- const tr = h ( 'tr' , trs )
127- tbody . push ( tr )
123+ tbody . push ( h ( 'tr' , trs ) )
128124 } )
129125
130126 return h ( 'table' , tbody )
0 commit comments