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

causaly-parser

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

causaly-parser - npm Package Compare versions

Comparing version 0.1.0 to 0.2.0

52

dist/index.js
'use strict';
var context = (function () {
var parser = (function () {
function peg$subclass(child, parent) {

@@ -760,2 +760,52 @@ function ctor() {

var AND = 'AND';
var OR = 'OR';
var NOT = 'NOT';
var operators = Object.freeze({
AND: AND,
OR: OR,
NOT: NOT
});
function compile(ast, parentOperator) {
if (!Array.isArray(ast)) {
return ast;
}
var operator = operators[ast[0]]; // eslint-disable-line import/namespace
var expr = ast.slice(operator ? 1 : 0).reduce(function (buf, e, i, arr) {
if (operator === NOT) {
buf += `${operator} `;
}
if (Array.isArray(e)) {
buf += compile(e, operator);
} else {
buf += e;
}
if (i !== arr.length - 1 && operator !== NOT) {
buf += ` ${operator} `;
}
return buf;
}, '');
if (parentOperator && operator !== NOT) {
return `(${expr})`;
}
return expr;
}
var context = {
parse: parser.parse,
compile,
operators
};
var index = {

@@ -762,0 +812,0 @@ context

2

package.json
{
"name": "causaly-parser",
"version": "0.1.0",
"version": "0.2.0",
"description": "Set of parsers for the causaly query language",

@@ -5,0 +5,0 @@ "keywords": [

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