Skip to main content
Module

x/is_what/dist/isOneOf.js>isOneOf

JS type check (TypeScript supported) functions like `isPlainObject() isArray()` etc. A simple & small integration.
Latest
function isOneOf
import { isOneOf } from "https://deno.land/x/is_what@v5.0.2/dist/isOneOf.js";

A factory function that creates a function to check if the payload is one of the given types.

Examples

import { isOneOf, isNull, isUndefined } from 'is-what'

const isNullOrUndefined = isOneOf(isNull, isUndefined)

isNullOrUndefined(null) // true isNullOrUndefined(undefined) // true isNullOrUndefined(123) // false