Skip to content

isOneOf

isOneOf(dataValue) ⇒ Array

Validate enums

Kind: global function
Returns: Array - validatorConfigValue - array with allowed values

ParamTypeDescription
dataValuestringinput value

Example

js
import isOneOf from '@hiperf/validate/isOneOf';

isOneOf('Dog', ['Cat','Dog']); // true
isOneOf('Mouse', ['Cat','Dog']); // false