1.0.0-a2 • Published 2 years ago

@discall/types v1.0.0-a2

Weekly downloads
-
License
Apache-2.0
Repository
-
Last release
2 years ago

@discall/types

types of discall interface and checkers

check most of types you want.

Example


isNumber(1) // true
isNumber('') // false

isUnion(isNumber, isString)(item) // item is number | string

isTypeTuple(isNumber, isNumber)(item) // item is [number, number]

isTypeArray(isBoolean)(item) // item is boolean[]

// more thins:
/*
    isFunction,
    isTypeNull,
    isTypeUndefined,
    isTypeRecord,
    isTypeObject,
    isLiteral,
    isAny,

    and Discall interfaces
*/