Created
May 26, 2021 14:23
-
-
Save sergueyarellano/5bc37e1a3c414572c2877d8b6add7559 to your computer and use it in GitHub Desktop.
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
function substituteOperators (restrictions) { | |
const operators = { | |
'less than': (a, b) => a < b | |
} | |
return restrictions.map(substituteOperator(operators)) | |
} | |
function substituteOperator (operators) { | |
return restriction => { | |
restriction.operator = operators[restriction.operator] | |
return restriction | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment