Skip to content

Instantly share code, notes, and snippets.

@gilligan
Last active August 29, 2015 14:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gilligan/e94d01d3a8b32b087f63 to your computer and use it in GitHub Desktop.
Save gilligan/e94d01d3a8b32b087f63 to your computer and use it in GitHub Desktop.
var _ = require('lodash');
// https://lodash.com/docs#transform
function t (obj) {
return _.transform(obj.fragments, function (result, val, key) {
accu[key.replace(obj.typ + '.', '')] = val;
return accu;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment