Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/isx/is_reg_exp.ts>isRegExp

Collection of validation functions for JavaScript data
Go to Latest
function isRegExp
import { isRegExp } from "https://deno.land/x/isx@1.1.1/is_reg_exp.ts";

Whether the input is RegExp of not.

Examples

Example 1

import { isRegExp } from "https://deno.land/x/isx@$VERSION/is_reg_exp.ts";
import { assertEquals } from "https://deno.land/std/testing/asserts.ts";
assertEquals(isRegExp(new RegExp("")), true);
assertEquals(isRegExp({}), false);

Parameters

input: unknown
  • Any input.

Returns

input is RegExp