Big news!Introducing Socket AI - ChatGPT-Powered Threat Analysis.Learn more
Socket
Socket

is-regex

Package Overview
Dependencies
2
Maintainers
1
Versions
12
Issues
File Explorer

Advanced tools

is-regex

Is this value a JS regex? Works cross-realm/iframe, and despite ES6 @@toStringTag

    1.1.4latest
    GitHub
    npm

Version published
Maintainers
1
Weekly downloads
31,921,873
increased by8.31%

Weekly downloads

Changelog

Source

v1.1.4 - 2021-08-05

Commits

  • [Dev Deps] update auto-changelog, core-js, eslint, tape 4b17cad
  • [Refactor] use has-tostringtag to behave correctly in the presence of symbol shams 2dad4af

Readme

Source

is-regex Version Badge

github actions coverage dependency status dev dependency status License Downloads

npm badge

Is this value a JS regex? This module works cross-realm/iframe, and despite ES6 @@toStringTag.

Example

var isRegex = require('is-regex'); var assert = require('assert'); assert.notOk(isRegex(undefined)); assert.notOk(isRegex(null)); assert.notOk(isRegex(false)); assert.notOk(isRegex(true)); assert.notOk(isRegex(42)); assert.notOk(isRegex('foo')); assert.notOk(isRegex(function () {})); assert.notOk(isRegex([])); assert.notOk(isRegex({})); assert.ok(isRegex(/a/g)); assert.ok(isRegex(new RegExp('a', 'g')));

Tests

Simply clone the repo, npm install, and run npm test

Keywords

FAQs

Last updated on 06 Aug 2021

Did you know?

Socket installs a Github app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.

Install Socket
Socket
Socket SOC 2 Logo

Product

  • Package Issues
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc