Open junosuarez opened 10 years ago
I read (Object)=>Boolean|(Object)=>Array<Boolean>
as object to return Boolean or function
I would express what you want as (Object)=>Boolean|Array<Boolean>
I wrote this again
Any | (SendObject<Any> & {
pretty?: Boolean,
space?: String,
replace?: Function
})
I used brackets to make it clear, but I think |
goes first, then &
See https://github.com/Raynos/send-data/blob/master/docs.mli#L13
Consider this signature:
(Object)=>Boolean|(Object)=>Array<Boolean>
This would match one function with a return type of either
Boolean
orArray<Boolean>
Here,
|
is being used to match the complete function expression on either side. Would it be more clear to instead standardize on(Object)=>Boolean|Array<Boolean>
, with the|
operating on the most proximate type?