Created
July 28, 2016 17:16
-
-
Save toddself/2f80e944c99b95ca7f0e6109eedbcfd8 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
// params: | |
// * data:object | |
// * [key:string]?:string - a key/value pair. both must be strings. | |
function reduceHash (data) { | |
return Object.keys(data).reduce((acc, k) => { | |
acc.push.apply(acc, [k, data[k]]) | |
return acc | |
}, []) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
client.hmset(sessionKey, reduceHash(session), done)