function isRegExp
Usage in Deno
import { isRegExp } from "node:util";
isRegExp(object: unknown): object is RegExp
Deprecated
Since v4.0.0 - Deprecated
Returns true
if the given object
is a RegExp
. Otherwise, returns false
.
const util = require('node:util'); util.isRegExp(/some regexp/); // Returns: true util.isRegExp(new RegExp('another regexp')); // Returns: true util.isRegExp({}); // Returns: false
object is RegExp