# or

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

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

{% code title="isPrimitive.js" %}

```javascript
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;
```

{% endcode %}

#### Related validators

{% content-ref url="compose" %}
[compose](https://antonioru.gitbook.io/deep-waters/composition/compose)
{% endcontent-ref %}

{% content-ref url="when" %}
[when](https://antonioru.gitbook.io/deep-waters/composition/when)
{% endcontent-ref %}

{% content-ref url="not" %}
[not](https://antonioru.gitbook.io/deep-waters/composition/not)
{% endcontent-ref %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://antonioru.gitbook.io/deep-waters/composition/or.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
