Last active
April 1, 2020 02:01
-
-
Save manakuro/0ff7f1e5f1a14b400731a404cdeb2a09 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
const generateQuery = (params, callbacks) => { | |
let query = {} | |
try { | |
callbacks.forEach(c => { | |
query = c(query, params) | |
}) | |
} catch(err) { | |
// error handing | |
} | |
return query | |
} | |
const result = generateQuery({ email: '[email protected]', maxAge: 20 }, [email, maxAge, limit]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment