@@ -63,7 +63,7 @@ export const createStdout = (formatterOrText, name = 'VueCommandStdout') => mark
63
63
64
64
render ( ) {
65
65
if ( isFunction ( formatterOrText ) ) {
66
- // This is automatically called with the given arguments
66
+ // This is automatically called with the bound arguments
67
67
return formatterOrText ( )
68
68
}
69
69
@@ -85,19 +85,17 @@ export const textFormatter = (text, innerHtml = false) => {
85
85
// Creates a command not found component
86
86
export const createCommandNotFound = ( command , notFoundText = 'command not found' , name = 'VueCommandNotFound' ) => {
87
87
const text = `${ command } : ${ notFoundText } `
88
- return createStdout ( textFormatter ( text ) , name )
88
+ return createStdout ( text , name )
89
89
}
90
90
91
91
// Creates a new query component
92
- // TODO Add name
93
92
export const createQuery = ( ) => markRaw ( VueCommandQuery )
94
93
95
94
// A simple query parser which trims the query and splits the arguments by
96
95
// spaces
97
96
export const defaultParser = query => split ( trim ( query ) , ' ' )
98
97
99
98
// Formats the given elements as a list
100
- // TODO Use HTML to enforce a new line
101
99
export const listFormatter = ( ...lis ) => {
102
100
return ( ) => {
103
101
const ul = [ ]
@@ -118,13 +116,11 @@ export const tableFormatter = rows => {
118
116
const tbody = [ ]
119
117
forEach ( rows , row => {
120
118
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 ) )
124
121
} )
125
122
126
- const tr = h ( 'tr' , trs )
127
- tbody . push ( tr )
123
+ tbody . push ( h ( 'tr' , trs ) )
128
124
} )
129
125
130
126
return h ( 'table' , tbody )
0 commit comments