Guest User

Untitled

a guest
Jan 17th, 2019
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. interface ILocation {
  2. cc: string
  3. admin1: string
  4. admin2: string
  5. }
  6.  
  7. const location: Option<Partial<ILocation>> = some({cc: 'BR', admin1: 'SC'})
  8. const first = 100
  9. const offset = 10
  10.  
  11. const params = [
  12. first,
  13. offset,
  14. ...location
  15. .map(l => [l.cc, l.admin1, l.admin2].filter(v => v !== undefined)
  16. .getOrElse([]),
  17. ]
  18.  
  19. // o tipo de params eh (number | string | undefined)[]
  20. // pra mim deveria ser (number | string)[]
Add Comment
Please, Sign In to add comment