text: import TS from 'trie-search'
  
  export default ({ commands = [] } = {}) => {
      const parsedCommands = commands.map(command => {
          const aliases = Array.isArray(command.aliases)
              ? command.aliases
              : [command.aliases]
  
          return {
              ...command,
              tokens: [command.name, ...aliases].join(' '),
          }
      })
      const searcher = new TS(['tokens'])
      searcher.addAll(parsedCommands)
      return searcher
  }
  