File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
src/packages/pongo/src/commandLine Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -38,10 +38,16 @@ const calculateColumnWidths = (
3838 return columnWidths ;
3939} ;
4040
41+ let shouldDisplayResultsAsTable = false ;
42+
43+ const printResultsAsTable = ( print ?: boolean ) =>
44+ ( shouldDisplayResultsAsTable = print === undefined || print === true ) ;
45+
4146// eslint-disable-next-line @typescript-eslint/no-explicit-any
42- const printOutput = ( obj : any ) : string => {
43- return Array . isArray ( obj ) ? displayResultsAsTable ( obj ) : prettyJson ( obj ) ;
44- } ;
47+ const printOutput = ( obj : any ) : string =>
48+ Array . isArray ( obj ) && shouldDisplayResultsAsTable
49+ ? displayResultsAsTable ( obj )
50+ : prettyJson ( obj ) ;
4551
4652// eslint-disable-next-line @typescript-eslint/no-explicit-any
4753const displayResultsAsTable = ( results : any [ ] ) : string => {
@@ -209,6 +215,7 @@ const startRepl = async (options: {
209215 shell . context . setLogLevel = setLogLevel ;
210216 shell . context . setLogStyle = setLogStyle ;
211217 shell . context . prettifyLogs = prettifyLogs ;
218+ shell . context . printResultsAsTable = printResultsAsTable ;
212219 shell . context . LogStyle = LogStyle ;
213220 shell . context . LogLevel = LogLevel ;
214221
You can’t perform that action at this time.
0 commit comments