available-regexp-flags
TypeScript icon, indicating that this package has built-in type declarations

1.0.4 • Public • Published

available-regexp-flags Version Badge

github actions coverage License Downloads

npm badge

Which regular expression flags does the current environment support?

Example

var flags = require('available-regexp-flags');
var properties = require('available-regexp-flags/properties');

flags.forEach((flag) => {
	assert.doesNotThrow(() => {
		const r = new RegExp('foo', flag);

		var propertyName = properties[flag];
		assert.equal(r[propertyName], true);
	});
});

Tests

Simply clone the repo, npm install, and run npm test

/available-regexp-flags/

    Package Sidebar

    Install

    npm i available-regexp-flags

    Weekly Downloads

    20

    Version

    1.0.4

    License

    MIT

    Unpacked Size

    17.5 kB

    Total Files

    13

    Last publish

    Collaborators

    • ljharb