sync/lib/safe-regex.js

18 lines
348 B
JavaScript
Raw Normal View History

var starHeightSafe = require("safe-regex");
var parse = require("ret");
module.exports = function (re) {
if (re.source) {
re = re.source;
}
if (!starHeightSafe(re)) {
return false;
}
var node = parse(re);
console.log(require('util').inspect(node.stack));
console.log(parse.types);
return true;
};