chore: add boolean test files omitted earlier
All checks were successful
/ test (pull_request) Successful in 18s
All checks were successful
/ test (pull_request) Successful in 18s
This commit is contained in:
parent
4b81fbe6e2
commit
a7673216c1
2 changed files with 39 additions and 0 deletions
14
src/boolean/type.js
Normal file
14
src/boolean/type.js
Normal 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)
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue