enjoy-typechecks
v1.1.0
Published
Predicate functions for checking JavaScript and enjoy.js types
Maintainers
Readme
Typecheck predicate functions for enjoy.js
This is a collection of type checkers. It also checks for some types that only exist in enjoy.js projects, but it's useful even for non-enjoy projects as well.
The following general type checkers are part of the module:
- isArgumentsObject(a): Checks if
ais an arguments object. - isArray(a): Checks if
ais a real array. - isArrayLike(a): Checks if
ais iterable like an array, e.g. a DOMElement or Arguments. - isBoolean(a): Checks if
ais a boolean. - isChar(a): Checks if
ais a string containing only one character. - isCollection(a): Checks if
ais a collection of values (array or object). - isDate(a): Checks if
ais a Date object. - isError(a): Checks if
ais an Error object. - isFiniteNumber(a): Checks if
ais an actual number (not NaN or +/-Infinity). - isFloat(a): Checks if
ais a real number (but not an integer). - isFunction(a): Checks if
ais a function. - isInfiniteNumber(a): Checks if
ais an infinite number like NaN or Infinity. - isInfinity(a): Checks if
ais positive or negative infinity. - isInteger(a): Checks if
ais an integer. - isMathObject(a): Checks if
ais the JavaScript built-in Math object. - isNegativeInfinity(a): Checks if
ais -Infinity. - isNull(a): Checks if
ais null. - isNumber(a): Checks if
ais a number (including NaN or +/-Infinity). - isPositiveInfinity(a): Checks if
ais Infinity. - isPrimitive(a): Checks if
ais a primitive type (everything but an object/array). - isRegExp(a): Checks if
ais a regular expression object. - isString(a): Checks if
ais a string. - isUndefined(a): Checks if
ais undefined.
The module also contains these enjoy-specific type checkers:
- isDerivable(a): Checks if
ais an enjoy.js derivable object. - isMethod(a): Checks if
ais an enjoy.js multimethod. - isType(a): Checks if
ais an enjoy.js type object.
