Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const getInstructions = function({ pluginsHooks, config }) {
const instructions = LIFECYCLE.flatMap(hook => getHookInstructions({ hook, pluginsHooks, config }))
const buildInstructions = instructions.filter(
instruction => !isEndInstruction(instruction) && !isErrorInstruction(instruction),
)
const endInstructions = instructions.filter(isEndInstruction)
const errorInstructions = instructions.filter(isErrorInstruction)
const mainInstructions = [...buildInstructions, ...endInstructions]
const instructionsCount = mainInstructions.length
return { mainInstructions, buildInstructions, endInstructions, errorInstructions, instructionsCount }
}