isOneOf
isOneOf(dataValue) ⇒ Array
Validate enums
Kind: global function
Returns: Array
- validatorConfigValue - array with allowed values
Param | Type | Description |
---|---|---|
dataValue | string | input value |
Example
js
import isOneOf from '@hiperf/validate/isOneOf';
isOneOf('Dog', ['Cat','Dog']); // true
isOneOf('Mouse', ['Cat','Dog']); // false