Socket
Socket
Sign inDemoInstall

safe-regex

Package Overview
Dependencies
1
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.0.0 to 0.0.1

6

index.js

@@ -14,2 +14,8 @@ var parse = require('ret');

if (node.options) {
for (var i = 0, len = node.options.length; i < len; i++) {
var ok = walk({ stack: node.options[i] }, starHeight);
if (!ok) return false;
}
}
var stack = node.stack || (node.value && node.value.stack);

@@ -16,0 +22,0 @@ if (!stack) return true;

2

package.json
{
"name": "safe-regex",
"version": "0.0.0",
"version": "0.0.1",
"description": "detect possibly catastrophic, exponential-time regular expressions",

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

@@ -23,2 +23,3 @@ var safe = require('../');

/(x+x+)+y/,
/foo|(x+x+)+y/,
/(a+){10}y/,

@@ -30,3 +31,3 @@ /(a+){2}y/,

test('unsafe regex', function (t) {
t.plan(good.length);
t.plan(bad.length);
bad.forEach(function (re) {

@@ -33,0 +34,0 @@ t.equal(safe(re), false);

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