Socket
Socket
Sign inDemoInstall

regexgen

Package Overview
Dependencies
2
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.2.3 to 1.2.4

2

package.json
{
"name": "regexgen",
"version": "1.2.3",
"version": "1.2.4",
"description": "Generate regular expressions that match a set of strings",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -20,2 +20,6 @@ const jsesc = require('jsesc');

get length() {
return this.options[0].length;
}
toString() {

@@ -22,0 +26,0 @@ return this.options.map(o => parens(o, this)).join('|');

@@ -87,2 +87,10 @@ const assert = require('assert');

});
it('should sort alternations of alternations correctly', function () {
let r = regexgen(['aef', 'aghz', 'ayz', 'abcdz', 'abcd']);
let s = 'abcdz';
assert.deepEqual(s.match(r)[0], s);
assert.deepEqual(r, /a(?:(?:bcd|gh|y)z|bcd|ef)/);
});
});
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc