File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -624,7 +624,10 @@ const availableCommands = [
624624 name : 'history' ,
625625 match : ( cmd : any ) => / ^ h i s t o r y ( \s + c l e a r ) ? / . test ( cmd ) ,
626626 exec ( action : any , put : any , store : any ) {
627- const match = action . cmd . match ( / ^ : h i s t o r y ( \s + c l e a r ) ? / )
627+ const match = action . cmd
628+ . trim ( )
629+ . toLowerCase ( )
630+ . match ( / ^ : h i s t o r y ( \s + c l e a r ) ? / )
628631 if ( match [ 0 ] !== match . input ) {
629632 return put (
630633 frames . add ( {
@@ -869,10 +872,10 @@ ${param}`)
869872]
870873
871874// First to match wins
872- const interpret = ( cmd : any ) => {
875+ const interpret = ( cmd : string ) => {
873876 return availableCommands . reduce ( ( match : any , candidate ) => {
874877 if ( match ) return match
875- const isMatch = candidate . match ( cmd . toLowerCase ( ) )
878+ const isMatch = candidate . match ( cmd . toLowerCase ( ) . trim ( ) )
876879 return isMatch ? candidate : null
877880 } , null )
878881}
You can’t perform that action at this time.
0 commit comments