js-restructure
Advanced tools
Comparing version 1.0.4 to 1.0.5
@@ -5,8 +5,11 @@ module.exports = function matcher(obj, flags) { | ||
var re = new RegExp(props.reduce(function(p, c) { | ||
if(isNaN(c)) { | ||
throw new TypeError("Object with numeric keys are not supported"); | ||
} | ||
var val = obj[c]; | ||
if(val.source) val = val.source; // accept RE arguments | ||
if(c.indexOf("_") === 0) return p + val; | ||
if(c[0] === "_") return p + val; | ||
else return p + "(" + val + ")"; | ||
}, ""), flags || ""); | ||
props = props.filter(function(x) { return !x.startsWith("_"); }); | ||
props = props.filter(function(x) { return x[0] !== "_"; }); | ||
var parser = function(pattern) { | ||
@@ -23,2 +26,2 @@ var o = {}; | ||
return parser; | ||
}; | ||
}; |
{ | ||
"name": "js-restructure", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"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.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7560
132