z-pattern-matching/z

does not work with typescript

Open

#35 aperta il 1 dic 2017

Vedi su GitHub
 (3 commenti) (0 reazioni) (0 assegnatari)JavaScript (78 fork)batch import
bughelp wanted

Metriche repository

Star
 (1714 star)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

Strange but when I use some of the snippets with typescript, it always returns the result of the first param. For example

import {matches} from 'z';

const person = { name: 'Maria' }
matches(person)(
  (x = { name: 'John' }) => console.log('John you are not welcome!'),
  (x)                    => console.log(`Hey ${x.name}, you are welcome!`)
)

returns John you are not welcome.

Guida contributor