Created
November 5, 2019 23:46
-
-
Save katelynsills/c4b315b887fc859354eeda841ac04134 to your computer and use it in GitHub Desktop.
Simplified version of offer safety
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
const refundOk = payoutRules.every((payoutRule, i) => { | |
if (payoutRule.kind === 'offer') { | |
return extentOpsArray[i].includes( | |
extents[i], | |
payoutRule.units.extent | |
); | |
} | |
return true; | |
}); | |
const winningsOk = payoutRules.every((payoutRule, i) => { | |
if (payoutRule.kind === 'want') { | |
return extentOpsArray[i].includes( | |
extents[i], | |
payoutRule.units.extent | |
); | |
} | |
return true; | |
}); | |
return refundOk || winningsOk; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment