Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

regexp-tree

Package Overview
Dependencies
Maintainers
1
Versions
114
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

regexp-tree - npm Package Compare versions

Comparing version 0.1.16 to 0.1.17

12

dist/optimizer/index.js

@@ -31,6 +31,14 @@ /**

optimize: function optimize(regexp) {
var transformsWhitelist = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
_ref$whitelist = _ref.whitelist,
whitelist = _ref$whitelist === undefined ? [] : _ref$whitelist,
_ref$blacklist = _ref.blacklist,
blacklist = _ref$blacklist === undefined ? [] : _ref$blacklist;
var transformToApply = transformsWhitelist.length > 0 ? transformsWhitelist : Object.keys(optimizationTransforms);
var transformsRaw = whitelist.length > 0 ? whitelist : Object.keys(optimizationTransforms);
var transformToApply = transformsRaw.filter(function (transform) {
return !blacklist.includes(transform);
});
var ast = regexp;

@@ -37,0 +45,0 @@ if (regexp instanceof RegExp) {

11

dist/regexp-tree.js

@@ -75,5 +75,5 @@ /**

* });
*
* The value for a node type may also be an object with functions pre and post.
* This enables more context-aware analyses, e.g. measuring star height.
*
* The value for a node type may also be an object with functions pre and post.
* This enables more context-aware analyses, e.g. measuring star height.
*/

@@ -136,3 +136,6 @@ traverse: function traverse(ast, handlers, options) {

optimize: function optimize(regexp, whitelist) {
return optimizer.optimize(regexp, whitelist);
var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
blacklist = _ref.blacklist;
return optimizer.optimize(regexp, { whitelist: whitelist, blacklist: blacklist });
},

@@ -139,0 +142,0 @@

{
"name": "regexp-tree",
"version": "0.1.16",
"version": "0.1.17",
"license": "MIT",

@@ -5,0 +5,0 @@ "description": "Regular Expressions parser in JavaScript",

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc