mirror of
https://github.com/thangisme/notes.git
synced 2024-12-22 12:56:38 -05:00
.. | ||
index.js | ||
package.json | ||
readme.md |
is-supported-regexp-flag
Check whether a RegExp flag is supported. Mostly useful for
y
andu
.
Install
$ npm install --save is-supported-regexp-flag
Usage
var isSupportedRegexpFlag = require('is-supported-regexp-flag');
isSupportedRegexpFlag('g'); // as in /foo/g
//=> true
isSupportedRegexpFlag('u');
//=> false
RegExp throws if you're trying to use unsupported flags. This is a nicer way to check for support.
License
MIT © Sindre Sorhus