Last active
December 4, 2018 03:58
-
-
Save pateketrueke/7f473b462ca7ecd3f648853ba6e44e2a to your computer and use it in GitHub Desktop.
Hakifile.js 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
module.exports = haki => { | |
haki.setGenerator('the:truth', { | |
description: "Display if it's true, or not", | |
arguments: ['verb', 'value'], | |
abortOnFail: true, | |
actions(input) { | |
const { verb, value } = input; | |
if (verb === 'is' && parseInt(value, 10) === 42) { | |
console.log('Gotcha!'); | |
return; | |
} | |
throw new Error('Is not true'); | |
}, | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment