Created
October 13, 2016 17:05
-
-
Save keyserfaty/86d71c3845d8a92ba15dc74d71ca90df to your computer and use it in GitHub Desktop.
A small curry for future reference
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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