Closed Chadtech closed 6 years ago
Cool, thanks for clarifying a use-case for this!
Could you do me a favour and restructure the example to be a valid doc-test? The assertion should be last and start with -->
. You can run the tests locally - npm i && npm test
should set everything up and run stuff.
Generally the examples are
input
|> someAction
--> expectedResult
-> it would be neat to keep that consistent!
Thanks for you contribution, @Chadtech <3
Done! Never used doc test before. Thats cool.
Oh shoot Im sorry. My example wasnt even right.
Eh, it was close enough 😄 Hence, the doc-tests. I'mma merge it, thanks for the contribution @Chadtech!
Here is a function to get the keys of a JSON object. It works just by using the core function
keyValuePairs
and then discards the values.We wrote this up this function at my job, where we needed to decode a list of urls, that werent just stored as strings but
{ < urlType > : String }
where theurlType
varied and it was the only information we cared about.