1
0
mirror of https://github.com/thangisme/notes.git synced 2024-11-06 20:57:16 -05:00
notes/node_modules/is-supported-regexp-flag
Patrick Marsceill b7b0d0d7bf
Initial commit
2017-03-09 13:16:08 -05:00
..
index.js Initial commit 2017-03-09 13:16:08 -05:00
package.json Initial commit 2017-03-09 13:16:08 -05:00
readme.md Initial commit 2017-03-09 13:16:08 -05:00

is-supported-regexp-flag Build Status

Check whether a RegExp flag is supported. Mostly useful for y and u.

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