effect-io-ai

Package: effect
Module: Predicate

Predicate.isRegExp

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))

See

Signature

declare const isRegExp: (input: unknown) => input is RegExp

Source

Since v3.9.0