z-pattern-matching/z

does not work with typescript

Open

#35 geöffnet am 1. Dez. 2017

Auf GitHub ansehen
 (3 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)JavaScript (78 Forks)batch import
bughelp wanted

Repository-Metriken

Stars
 (1.714 Stars)
PR-Merge-Metriken
 (Keine gemergten PRs in 30 T)

Beschreibung

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.

Contributor Guide