refactor: reorganize body evaluation a bit
This commit is contained in:
@@ -218,17 +218,17 @@ const getHoppReqBody = (item: Item): HoppRESTReqBody => {
|
|||||||
),
|
),
|
||||||
|
|
||||||
// Back-up plan, assume language from raw language defintion
|
// Back-up plan, assume language from raw language defintion
|
||||||
// If that too failed, just assume "text/plain"
|
O.alt(() =>
|
||||||
O.getOrElse(() =>
|
|
||||||
pipe(
|
pipe(
|
||||||
body.options?.raw?.language,
|
body.options?.raw?.language,
|
||||||
O.fromNullable,
|
O.fromNullable,
|
||||||
O.map((lang) => PMRawLanguageOptionsToContentTypeMap[lang]),
|
O.map((lang) => PMRawLanguageOptionsToContentTypeMap[lang])
|
||||||
|
|
||||||
O.getOrElse((): ValidContentTypes => "text/plain")
|
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
|
|
||||||
|
// If that too failed, just assume "text/plain"
|
||||||
|
O.getOrElse((): ValidContentTypes => "text/plain"),
|
||||||
|
|
||||||
O.of
|
O.of
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user