z-pattern-matching/z

does not work with typescript

Open

#35 ouverte le 1 déc. 2017

Voir sur GitHub
 (3 commentaires) (0 réactions) (0 assignés)JavaScript (78 forks)batch import
bughelp wanted

Métriques du dépôt

Stars
 (1 714 stars)
Métriques de merge PR
 (Aucune PR mergée en 30 j)

Description

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.

Guide contributeur