z-pattern-matching/z

does not work with typescript

Open

#35 建立於 2017年12月1日

在 GitHub 查看
 (3 留言) (0 反應) (0 負責人)JavaScript (78 fork)batch import
bughelp wanted

倉庫指標

Star
 (1,714 star)
PR 合併指標
 (30 天內沒有已合併 PR)

描述

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.

貢獻者指南