npm

Need private packages and team management tools?Check out npm Orgs. »

is-regexp-x

3.1.1 • Public • Published

Travis status Dependency status devDependency status npm version jsDelivr hits bettercodehub score Coverage Status

is-regexp-x

Is this value a JS regex?

Version: 2.2.0

module.exports(value)boolean

This method tests if a value is a regex.

Kind: Exported function
Returns: boolean - true if value is a regex; otherwise false.

Param Type Description
value * The value to test.

Example

import isRegex from 'is-regexp-x';
 
console.log(isRegex(undefined)); // false
console.log(isRegex(null)); // false
console.log(isRegex(false)); // false
console.log(isRegex(true)); // false
console.log(isRegex(42)); // false
console.log(isRegex('foo')); // false
console.log(isRegex(function () {})); // false
console.log(isRegex([])); // false
console.log(isRegex({}))); // false
 
console.log(isRegex(/a/g)); // true
console.log(isRegex(new RegExp('a', 'g'))); // true

install

npm i is-regexp-x

Downloadsweekly downloads

944

version

3.1.1

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability