is-supported-regexp-flag
Check whether a RegExp flag is supported
Last updated 5 years ago by sindresorhus .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install is-supported-regexp-flag 
SYNC missed versions from official npm registry.

is-supported-regexp-flag

Check whether a RegExp flag is supported

Install

$ npm install is-supported-regexp-flag

Usage

import isSupportedRegexpFlag from 'is-supported-regexp-flag';

isSupportedRegexpFlag('g'); // As in `/foo/g`
//=> true

isSupportedRegexpFlag('u');
//=> false

The RegExp constructor throws if you're trying to use unsupported flags. This is a nicer way to check for support.

Current Tags

  • 2.0.0                                ...           latest (5 years ago)

4 Versions

  • 2.0.0                                ...           5 years ago
  • 1.0.1                                ...           9 years ago
  • 1.0.0                                ...           12 years ago
  • 0.1.0                                ...           12 years ago
Maintainers (1)
Downloads
Total 16
Today 0
This Week 4
This Month 8
Last Day 0
Last Week 3
Last Month 4
Dependencies (0)
None
Dev Dependencies (2)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE