Last active
August 16, 2021 18:35
-
-
Save mvcds/a6bd470be771338378a8d57f4a3e6732 to your computer and use it in GitHub Desktop.
Testing data or rules 1
This file contains hidden or 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
// canBuyProduct is a simple rule | |
function canBuyProduct({ age }: User, { kind }: Product): boolean { | |
const result = age >= this.ageRestriction[kind] | |
if (!result) { | |
logger.warn('front-end exposed user to invalid product') | |
} | |
return result | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment