Hyperlinkv0.8.0-beta.28

Predicate

Predicate.isRegExpfunctioneffect/Predicate.ts:1376
(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))
guardsisDate
export function isRegExp(input: unknown): input is RegExp {
  return input instanceof RegExp
}
Referenced by 1 symbols