-
-
Save variousauthors/bbf084aa70b09da11d71f4d66bc95b33 to your computer and use it in GitHub Desktop.
serialization different function formation
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
const serializePackageItem = R.pick([ | |
'offeringOptions', | |
'offeringId', | |
'offeringPackageOptionId', | |
'durationAmount', | |
'durationTypeId', | |
'startDate', | |
'selectedPackageOptionItems' | |
]) | |
const omitOfferings = overProp('selectedPackageOptionItems', R.map(R.ommit('offering'))) | |
const whenHasPackageItems = R.when(R.has('selectedPackageOptionItems')) | |
const serializePackageItems = R.compose( | |
whenHasPackageItems(omitOfferings), | |
serializePackageItem | |
) | |
const serializeOfferingOptionsFields = overProp('offeringOptions', R.map(serializePackageItems)) | |
const serializePreviewFilter = R.compose( | |
serializeOfferingOptionsFields, | |
addMinMaxAge, | |
addCustomItems, | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment