From d3ebdd02209231ef0cbe0773f9f2c3ff54b13065 Mon Sep 17 00:00:00 2001 From: Kevin Van Der Werff Date: Tue, 22 Oct 2019 19:23:16 +0200 Subject: [PATCH] :art: add RawResource "type" --- utils/pure.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/utils/pure.js b/utils/pure.js index 710df32..5750366 100644 --- a/utils/pure.js +++ b/utils/pure.js @@ -8,6 +8,13 @@ import * as R from 'ramda' // resources: [Resource], // } +// const RawResource = { +// title: String, +// desc: String, +// url: String, +// tags: [String] +// } + // const Resource = { // title: String, // cleanTitle: String, @@ -53,7 +60,7 @@ export const partiallyIncludesElOf = R.curry((list1, list2) => list2) ) -// addCleanTitleAndPath :: Object -> Resource +// addCleanTitleAndPath :: RawResource -> Resource const addCleanTitleAndPath = R.curry((slug, obj) => { const cleanTitle = cleanStringAndRemoveSpaces(obj.title) return { @@ -63,7 +70,7 @@ const addCleanTitleAndPath = R.curry((slug, obj) => { } }) -// transformToResources :: [Object] -> [Resource] +// transformToResources :: [RawResource] -> [Resource] export const transformToResources = categories => { const resourcesLens = R.lens(R.prop('resources'), R.assoc('resources')) return R.map(category =>