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

expression-eval

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

expression-eval - npm Package Compare versions

Comparing version 1.3.1 to 1.4.0

.travis.yml

5

index.js

@@ -86,2 +86,7 @@ var jsep = require('jsep');

case 'LogicalExpression':
if (node.operator === '||') {
return evaluate( node.left, context ) || evaluate( node.right, context );
} else if (node.operator === '&&') {
return evaluate( node.left, context ) && evaluate( node.right, context );
}
return binops[ node.operator ]( evaluate( node.left, context ), evaluate( node.right, context ) );

@@ -88,0 +93,0 @@

2

package.json
{
"name": "expression-eval",
"version": "1.3.1",
"version": "1.4.0",
"description": "JavaScript expression parsing and evaluation.",

@@ -5,0 +5,0 @@ "main": "index.js",

# expression-eval
[![Latest NPM release](https://img.shields.io/npm/v/expression-eval.svg)](https://www.npmjs.com/package/expression-eval)
[![License](https://img.shields.io/npm/l/expression-eval.svg)](https://github.com/donmccurdy/expression-eval/blob/master/LICENSE)
[![Build Status](https://travis-ci.com/donmccurdy/expression-eval.svg?branch=master)](https://travis-ci.com/donmccurdy/expression-eval)
JavaScript expression parsing and evaluation.

@@ -4,0 +8,0 @@

@@ -63,2 +63,8 @@ const expr = require('./');

// logical expression lazy evaluation
{expr: 'true || throw()', expected: true },
{expr: 'false || true', expected: true },
{expr: 'false && throw()', expected: false },
{expr: 'true && false', expected: false },
// member expression

@@ -96,3 +102,3 @@ {expr: 'foo.bar', expected: 'baz' },

isArray: Array.isArray,
throw: () => { throw new Error('Should not be called.'); }
};

@@ -105,3 +111,8 @@

tests++;
var val = expr.compile(o.expr)(context);
try {
var val = expr.compile(o.expr)(context);
} catch (e) {
console.error(`Error: ${o.expr}, expected ${o.expected}`);
throw e;
}
assert.equal(val, o.expected, `Failed: ${o.expr} (${val}) === ${o.expected}`);

@@ -108,0 +119,0 @@ passed++;

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