Skip to content

Instantly share code, notes, and snippets.

@gilligan
Created December 12, 2015 21:42
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/75f1b2277f92c751a476 to your computer and use it in GitHub Desktop.
Save gilligan/75f1b2277f92c751a476 to your computer and use it in GitHub Desktop.
const type = content.type;
const removeTypePrefix = R.replace(`${type}.`, '');
const adjustKeyPrefixes = R.map(R.adjust(removeTypePrefix, 0));
const mapKeys = R.pipe(
R.toPairs,
adjustKeyPrefixes,
R.fromPairs
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment