Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save scrooby/698f29844995f39341a4ceb02434c3b3 to your computer and use it in GitHub Desktop.
Save scrooby/698f29844995f39341a4ceb02434c3b3 to your computer and use it in GitHub Desktop.
flatten object to key value pairs
const identifiers = {
id: 1,
referenceNumber: '123'
};
const convert = R.compose(R.map(R.zipObj(['key', 'value'])), R.toPairs);
convert(identifiers);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment