JSPM

is-supported-regexp-flag

0.1.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 530013
  • Score
    100M100P100Q202166F
  • License MIT

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

Package Exports

  • is-supported-regexp-flag

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (is-supported-regexp-flag) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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