isRegEx
Validates if the supplied input is a regular expression (RegExp
instance).
Signature
isRegEx(input: any): boolean
Parameters
Name | Type | Optional | Description |
---|---|---|---|
input | any | No | Input to validate. |
Return value
Returns true
if the input is a regular expression.
Example
import { isRegEx } from "@tripetto/builder";
isRegEx(/[a-z]+/); // Returns `true`