-
-
Save AlexzanderFlores/e8ad5c88bfd501c607c2f1fdd8107da2 to your computer and use it in GitHub Desktop.
Syntax based validation example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This is written in JS but the handler will still have TS support as expected | |
module.exports = (command) => { | |
const { instance, commandName, commandObject } = command | |
if (commandObject.testOnly !== true || instance.testServers.length) { | |
return | |
} | |
throw new Error( | |
`Command "${commandName}" is a test only command, but no test servers were specified.` | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment