Created
January 16, 2019 17:36
-
-
Save vieiralucas/0ec735807c61aae688d32add7e4befd2 to your computer and use it in GitHub Desktop.
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
| interface ILocation { | |
| cc: string | |
| admin1: string | |
| admin2: string | |
| } | |
| const location: Option<Partial<ILocation>> = some({cc: 'BR', admin1: 'SC'}) | |
| const first = 100 | |
| const offset = 10 | |
| const params = [ | |
| first, | |
| offset, | |
| ...location | |
| .map(l => [l.cc, l.admin1, l.admin2].filter(v => v !== undefined) | |
| .getOrElse([]), | |
| ] | |
| // o tipo de params eh (number | string | undefined)[] | |
| // pra mim deveria ser (number | string)[] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment