Created
October 17, 2011 02:19
-
-
Save boxxxie/1291800 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 object2array(obj,prefix){ | |
| var keys = _.keys(obj); | |
| var vals = _.values(obj); | |
| var firstStep = _(_.zip(keys,vals)).chain() | |
| .map(function(keyVal){ | |
| var key = keyVal[0]; | |
| var val = keyVal[1]; | |
| return {name: applyPrefix(key,prefix), value:val}; | |
| }) | |
| .value(); | |
| var completed = _.filter(firstStep,valueIsSimple); | |
| var toBeWorkedOn = _.filter(firstStep,valueIsComplex); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment