(input: unknown): input is RegExpChecks whether a value is a RegExp.
When to use
Use when you need a Predicate runtime guard for regular expressions.
Details
Uses instanceof RegExp.
Example (Guarding RegExp values)
import { Predicate } from "effect"
const data: unknown = /abc/
console.log(Predicate.isRegExp(data))guardsisDate
Source effect/Predicate.ts:13763 lines
export function function isRegExp(
input: unknown
): input is RegExp
Checks whether a value is a RegExp.
When to use
Use when you need a Predicate runtime guard for regular expressions.
Details
Uses instanceof RegExp.
Example (Guarding RegExp values)
import { Predicate } from "effect"
const data: unknown = /abc/
console.log(Predicate.isRegExp(data))
isRegExp(input: unknowninput: unknown): input: unknowninput is RegExp {
return input: unknowninput instanceof var RegExp: RegExpConstructorRegExp
}Referenced by 1 symbols