Skip to content

Instantly share code, notes, and snippets.

@maciejcieslar
Created November 7, 2018 18:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maciejcieslar/35583d2e55f541d821bd4b23ff4f132f to your computer and use it in GitHub Desktop.
Save maciejcieslar/35583d2e55f541d821bd4b23ff4f132f to your computer and use it in GitHub Desktop.
const parsers = {
int: (number: string) => parseInt(number, 10),
float: (number: string) => parseFloat(number),
list: (val: string) => val.split(','),
collect: (val, memo) => {
memo.push(val)
return memo
},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment