🌊
Deep Waters
  • What is Deep Waters
  • 📌Getting started
    • Installation
  • 🍰Composition
    • compose
    • when
    • or
    • not
  • 👁️ Validators
    • arrayOf
    • arrayOfShape
    • between
    • biggerThan
    • contains
    • equals
    • every
    • hasProp
    • hasShape
    • isCreditCard
      • isVISA
      • isMastercard
      • isAmericanExpress
      • isDinersClub
      • isDiscover
      • isJCB
    • isDateFormat [TD]
    • isDivisibleBy [TD]
    • isEmail [TD]
    • isEmpty [TD]
    • isEmptyString [TD]
    • isIP [TD]
      • isIPv6 [TD]
      • isIPv4 [TD]
    • isNumeric [TD]
    • isPhone [TD]
    • isPrimitive [TD]
    • isRequired [TD]
    • isURL [TD]
    • matchesPattern [TD]
    • maxLenght [TD]
    • minLength [TD]
    • ofLength [TD]
    • ofUniqueItems [TD]
    • ofClass
    • oneOfValues [TD]
    • smallerThan
  • ✅Type validators
    • isBigInt
    • isBoolean
    • isBuffer
    • isDate
    • isError
    • isFunction
    • isInt8Array
    • isMap
    • isNull
    • isNumber
    • isObject
    • isRegExp
    • isSet
    • isString
    • isSymbol
    • isUint8Array
    • isUndefined
    • isWeakMap
    • isWeakSet
  • github repository
Powered by GitBook
On this page

Was this helpful?

  1. 🍰Composition

or

or :: [ Function ] → a → Boolean

Takes a list of validators [validators][validators][validators] then returns a new function that receives a value vvv(of any type) and reports whether the vvv is valid for at least one of the previously defined [validators][validators][validators].

It is largely used within the library itself to evaluate or conditions:

isPrimitive.js
import or from './or';
import isBigInt from './isBigInt';
import isString from './isString';
import isFunction from './isFunction';
import isBoolean from './isBoolean';
import isNumber from './isNumber';
import isSymbol from './isSymbol';
import isUndefined from './isUndefined';
import isNull from './isNull';

/**
 * Receives a value and reports whether it is a primitive of not
 * @type {function(*=): boolean}
 */
const isPrimitive = or(isString, isFunction, isBoolean, isNumber, isBigInt, isSymbol, isNull, isUndefined);

export default isPrimitive;

Related validators

PreviouswhenNextnot

Last updated 5 years ago

Was this helpful?

compose
when
not