mirror of
				https://github.com/vvsviridov/enm-cli.git
				synced 2025-11-04 06:03:37 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			16 lines
		
	
	
		
			412 B
		
	
	
	
		
			JavaScript
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			16 lines
		
	
	
		
			412 B
		
	
	
	
		
			JavaScript
		
	
	
		
			Executable File
		
	
	
	
	
const chalk = require('chalk')
 | 
						|
 | 
						|
 | 
						|
async function nextAttributes(input) {
 | 
						|
  this.commands = this.configCommands
 | 
						|
  this.choices = this.attributes
 | 
						|
    .map(({ key, value }) => ({
 | 
						|
      value: key,
 | 
						|
      short: key,
 | 
						|
      name: `${key} ${chalk.dim(typeof value !== 'object' || value === null ? value : '...')}`
 | 
						|
    }))
 | 
						|
    .sort((a, b) => a.value > b.value ? 1 : -1)
 | 
						|
}
 | 
						|
 | 
						|
 | 
						|
module.exports = nextAttributes |