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

js-restructure

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

js-restructure - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

21

index.js
module.exports = function matcher(obj) {
"use strict";
var props = Object.getOwnPropertyNames(obj);
var re = new RegExp(props.reduce(function(p, c) {
return p + (c.startsWith("_") ? obj[c] : ("("+obj[c] + ")");
}));
props = props.filter(function(x) { return !x.startsWith("_"); });
return function(pattern) {
"use strict";
var props = Object.getOwnPropertyNames(obj);
var re = new RegExp(props.reduce(function(p, c) {
if(c.indexOf("_") === 0) return p + obj[c];
else return p + "(" + obj[c] + ")";
}, ""));
props = props.filter(function(x) { return !x.startsWith("_"); });
return function(pattern) {
var o = {};
var res = re.exec(pattern);
if(res === null) return null;
for(var i = 0; i < res.length; i++) {

@@ -16,3 +17,3 @@ o[props[i]] = res[i + 1];

return o;
};
}
};
};
{
"name": "js-restructure",
"version": "1.0.1",
"version": "1.0.2",
"description": "This package provides a nifty way to match against regular expressions\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001bconstruct and match against regular expressions.",
"main": "index.js",
"scripts": {
"test": "mocha"
"test": "mocha tests"
},

@@ -19,3 +19,6 @@ "repository": {

"author": "Benjamin Gruenbaum",
"license": "MIT"
"license": "MIT",
"devDependencies": {
"mocha": "^2.3.4"
}
}
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