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/runner";
isRegEx(/[a-z]+/); // Returns `true`