chore: add boolean test files omitted earlier
All checks were successful
/ test (pull_request) Successful in 18s

This commit is contained in:
Glen Whitney 2025-04-13 00:14:56 -07:00
parent 4b81fbe6e2
commit a7673216c1
2 changed files with 39 additions and 0 deletions

14
src/boolean/type.js Normal file
View file

@ -0,0 +1,14 @@
import {BooleanT} from './BooleanT.js'
import {onType} from '#core/helpers.js'
import {Returns, Type, TypeOfTypes, Undefined} from '#core/Type.js'
import {NumberT} from '#number/NumberT.js'
const bool = f => Returns(BooleanT, f)
export const boolean = onType(
BooleanT, bool(p => p),
NumberT, bool(a => !!a),
TypeOfTypes, bool(() => true),
Undefined, bool(() => false),
[], bool(() => false)
)