effect-io-ai

Package: effect
Module: Predicate

Predicate.isRegExp

A refinement that checks if a value is a RegExp.

Example

import * as assert from "node:assert"
import { Predicate } from "effect"

assert.strictEqual(Predicate.isRegExp(/a/), true)
assert.strictEqual(Predicate.isRegExp(new RegExp("a")), true)

assert.strictEqual(Predicate.isRegExp("/a/"), false)

Signature

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

Source

Since v3.9.0