/compare-regexes

compare if two RegExp Objects are equal

Primary LanguageJavaScriptISC LicenseISC

compare-regexes

compare if two RegExp Objects are equal

Build StatusCode Coverage 100%ISC License

API

var isRegexEqual = require('compare-regexes')

isRegexEqual(RegExp Object, RegExp Object)

Usage

var isRegexEqual = require('compare-regexes');

var regex1 = new RegExp('[a-z]', 'i');
var regex2 = /[a-z]/i;
var regex3 = /[a-z]/;

isRegexEqual(regex1, regex2);// should return true
isRegexEqual(regex1, regex3);// should return false

Development

this projet has been set up with a precommit that forces you to follow a code style, no jshint issues and 100% of code coverage before commit

to run test

npm test

to run jshint

npm run jshint

to run code style

npm run code-style

to run check code coverage

npm run check-coverage

to open the code coverage report

npm run open-coverage