Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const getCommands = function({ pluginsCommands, netlifyConfig }) {
const commands = EVENTS.flatMap(event => getEventCommands({ event, pluginsCommands, netlifyConfig }))
const buildCommands = commands.filter(command => !isEndCommand(command) && !isErrorCommand(command))
const endCommands = commands.filter(isEndCommand)
const errorCommands = commands.filter(isErrorCommand)
const mainCommands = [...buildCommands, ...endCommands]
const commandsCount = mainCommands.length
return { mainCommands, buildCommands, endCommands, errorCommands, commandsCount }
}