Skip to main content

Timeline for Deep pick using lodash/underscore

Current License: CC BY-SA 3.0

19 events
when toggle format what by license comment
Jun 11, 2015 at 21:50 history edited anon CC BY-SA 3.0
Changed it back to headers, rearranged the headers, and fixed some dodgy English, removed a random question (OP, you may wish to add this back, but please rephrase if you do)
Jun 8, 2015 at 2:28 history edited Jamal CC BY-SA 3.0
deleted 486 characters in body; edited tags
Jul 28, 2014 at 15:23 vote accept Pete
Jul 28, 2014 at 15:11 answer added megawac timeline score: 15
Jul 28, 2014 at 14:44 comment added megawac Also do you want it restricted to own properties or in properties
Jul 28, 2014 at 14:41 comment added megawac How do you want it handled I have a solution ready, always an object? or array if array otherwise object
Jul 28, 2014 at 14:38 comment added Pete @megawac Ahhh.. good catch.. hmm.. this adds more logic as I now need to convert the object back into an array... Going to give it a shot leveraging _.cloneDeep. It might be the better way to go than re-implementing the wheel of stepping through the object.
Jul 28, 2014 at 14:35 comment added megawac pick always returns an object. But your test cases want it to return an array? Your code fails testCase4 due to that consideration
Jul 28, 2014 at 14:01 comment added Pete @megawac I've updated the page with the requirements and test cases. I have this nagging feeling that this can easily be done with _.cloneDeep and _.pick together, but I haven't been able to connect the dots.
Jul 28, 2014 at 14:00 history edited Pete CC BY-SA 3.0
Updated requirements
Jul 28, 2014 at 12:47 history tweeted twitter.com/#!/StackCodeReview/status/493739490209722369
Jul 26, 2014 at 16:22 comment added megawac Can you provide some more examples, I read your code I'm not sure how you want to handle some cases
Jul 26, 2014 at 11:05 answer added user73428 timeline score: 5
Jul 25, 2014 at 19:04 history edited Pete CC BY-SA 3.0
Updated code with new version.
Jul 25, 2014 at 18:59 comment added Pete @ThomasJunk I think I've found what was wrong with this code. I'll have to update this post, but what was bothering me was that a lot of the code re-implements the logic that's already available in lodash/underscore. I think the better solution is to wrap the _.pick in logic that allows for a deep traverse, rather than re-implementing the pick functionality.
Jul 25, 2014 at 18:25 comment added Thomas Junk And what is your question? I haven't tested, but I think it does, what it should. On first sight, I find nothing to complain about. So I am fine with it :]
Jul 25, 2014 at 17:23 history edited Pete CC BY-SA 3.0
updated code with improvements
Jul 24, 2014 at 21:39 history edited Pete CC BY-SA 3.0
fixed grammar, improved clarity
Jul 24, 2014 at 21:32 history asked Pete CC BY-SA 3.0