1
Fork 0

typescript(option): fix: fixed wrong types for bind, bindAsync, and probably other helpers as well

Signed-off-by: prescientmoon <git@moonythm.dev>
This commit is contained in:
Matei Adriel 2019-12-23 15:00:29 +02:00 committed by prescientmoon
parent ff81096e6f
commit 0abd53917b
Signed by: prescientmoon
SSH key fingerprint: SHA256:UUF9JT2s8Xfyv76b8ZuVL7XrmimH4o49p4b+iexbVH4
17 changed files with 169 additions and 4 deletions
typescript/option/src

View file

@ -1,4 +1,5 @@
export * from './bind'
export * from './bindAsync'
export * from './count'
export * from './exists'
export * from './filter'
@ -13,8 +14,7 @@ export * from './isNone'
export * from './isSome'
export * from './iter'
export * from './map'
export * from './mapAsync'
export * from './toArray'
export * from './toNullable'
export * from './withDefault'
export * from './mapAsync'
export * from './bindAsync'

View file

@ -1,8 +1,8 @@
import { Option } from './types'
export type Mapper<T, U> = (v: T) => U
export type Binder<T, U> = Mapper<T, Option<U>>
export type Predicate<T> = Mapper<T, boolean>
export type Binder<T, U> = (v: T) => Option<U>
export type Predicate<T> = (v: T) => boolean
export type Folder<T, U> = (s: U, v: T) => U
export type BackFolder<T, U> = (v: T, s: U) => U
export type Nullable<T> = T | null