All checks were successful
/ test (pull_request) Successful in 17s
Refactors each TypeDispatcher to have its own separate collection of types. Add isnan function which returns a boolean if that type is present, otherwise returns the number 1 for true, and 0 for fase.
12 lines
303 B
JavaScript
12 lines
303 B
JavaScript
import {plain, boolnum} from './helpers.js'
|
|
import {BooleanT} from '#boolean/BooleanT.js'
|
|
import {Returns} from '#core/Type.js'
|
|
import {NumberT} from '#number/NumberT.js'
|
|
|
|
const num = f => Returns(NumberT, f)
|
|
|
|
export const number = plain(a => a)
|
|
number.also(
|
|
BooleanT, boolnum,
|
|
[], num(() => 0)
|
|
)
|