package
ES6 spec-compliant RegExp.prototype.flags shim.
npm install regexp.prototype.flagsGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Tagged topics.
An ES6 spec-compliant RegExp.prototype.flags shim. Invoke its "shim" method to shim RegExp.prototype.flags if it is unavailable.
Note: RegExp#flags requires a true ES5 environment - specifically, one with ES5 getters.
This package implements the es-shim API interface. It works in an ES5-supported environment and complies with the spec.
Most common usage:
var flags = require('regexp.prototype.flags');
var assert = require('assert');
assert(flags(/a/) === '');
assert(flags(new RegExp('a')) === '');
assert(flags(/a/mig) === 'gim');
assert(flags(new RegExp('a', 'mig')) === 'gim');
if (!RegExp.prototype.flags) {
Simply clone the repo, npm install, and run npm test
Estimated unpacked size across 19 packages.
371.7 kB
Includes dependencies.
6 direct dependencies.
^1.2.0
1.2.0
^1.0.8
1.0.9
^1.3.0
1.3.0
^1.0.1
1.0.1
^1.2.1
1.2.1
^2.0.2
2.0.2