Skip to content

Instantly share code, notes, and snippets.

@keyserfaty
Created October 13, 2016 17:05
Show Gist options
  • Select an option

  • Save keyserfaty/86d71c3845d8a92ba15dc74d71ca90df to your computer and use it in GitHub Desktop.

Select an option

Save keyserfaty/86d71c3845d8a92ba15dc74d71ca90df to your computer and use it in GitHub Desktop.
A small curry for future reference
import { omit, pipe, assoc } from 'ramda';
const stringifyJson = e => JSON.stringify(e, null, '\t');
const parsedJson = e => JSON.parse(e.replace('\t', ''));
const moduleDefinitionInput = pipe(omit(['staticDisplayName']), stringifyJson);
const moduleDefinitionOutput = pipe(parsedJson, assoc('staticDisplayName', staticDisplayName));
moduleDefinitionInput(content);
moduleDefinitionOutput(content);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment