Drenmi/sludge

View on GitHub
src/guards/exitMustExist.js

Summary

Maintainability
A
0 mins
Test Coverage
function exitMustExist(actor, { direction }) {
const MESSAGE = `There is no exit ${direction} of here.`
 
if(actor.room.exits[direction]) {
return true
} else {
return MESSAGE
}
}
 
module.exports = exitMustExist