is-regexp

Check if a value is a regular expression

MIT 5 个版本
安装
npm install is-regexp
yarn add is-regexp
pnpm add is-regexp
bun add is-regexp
README

is-regexp

Check if a value is a regular expression

Install

$ npm install is-regexp

Usage

import isRegexp from 'is-regexp';

isRegexp('unicorn');
//=> false

isRegexp(/unicorn/);
//=> true

isRegexp(new RegExp('unicorn'));
//=> true

FAQ

Why not just use instanceof instead of this package?

  • is - Type check values

Get professional support for this package with a Tidelift subscription
Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies.
版本列表
3.1.0 2021-10-31
3.0.0 2021-04-07
2.1.0 2019-04-16
2.0.0 2018-03-22
1.0.0 2014-06-11