1.0.5 • Published 5 years ago

the-match v1.0.5

Weekly downloads
1
License
ISC
Repository
-
Last release
5 years ago

一个提供 Option 和 Result 的 TypeScript 库

========

Example:

import { Some, Ok, Err, None, match } from 'the-match'

const o:Option<String>[]= [Some.new('some'),None.new()]
const r:Result<string,number>[] = [Err.new(0),Ok.new('Ok')]


match(r[0],
    (ok: string)=>`msg: ${ok}`,
    (err: number)=>`code: ${err}`
)

match<string,string>(o[0],
    (some: string)=>`some: ${some}`,
    ()=>`none`
)
1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago