Skip to content

Instantly share code, notes, and snippets.

@jonathanconway
Created August 9, 2013 13:29
Show Gist options
  • Save jonathanconway/6193584 to your computer and use it in GitHub Desktop.
Save jonathanconway/6193584 to your computer and use it in GitHub Desktop.
Copies values from the left to the right, where they already exist in the left. (For .NET folks, it's the Javascript equivalent of AutoMapper.)
_.mixin({
extendPick: function (objectA, objectB) {
return _.extend(objectA, _.pick(objectB, _.keys(objectA)));
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment