nanomath/src/number/type.js
Glen Whitney b2b41d6348
All checks were successful
/ test (pull_request) Successful in 17s
feat: factories can depend on the presence of types
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.
2025-04-13 01:35:10 -07:00

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)
)