Socket
Socket
Sign inDemoInstall

ts-expression-evaluator

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ts-expression-evaluator - npm Package Compare versions

Comparing version 1.3.8 to 1.3.9

2

build/main/lib/Handlers.d.ts
import * as t from './t';
export declare type HandlerTypes = 'BinaryExpression' | 'NumericLiteral' | 'StringLiteral' | 'BooleanLiteral' | 'ArrayExpression' | 'NullLiteral' | 'Identifier' | 'CallExpression' | 'MemberExpression' | 'LogicalExpression' | 'UnaryExpression' | 'ThisExpression';
export declare type HandlerTypes = 'BinaryExpression' | 'NumericLiteral' | 'StringLiteral' | 'BooleanLiteral' | 'ArrayExpression' | 'NullLiteral' | 'Identifier' | 'CallExpression' | 'MemberExpression' | 'LogicalExpression' | 'UnaryExpression' | 'ThisExpression' | 'ConditionalExpression';
export declare type Context = {

@@ -4,0 +4,0 @@ [key: string]: any;

@@ -45,2 +45,8 @@ "use strict";

},
ConditionalExpression: function (ast, context) {
if (t.isConditionalExpression(ast)) {
return Evaluator_1.evaluate(ast.test, context) ? Evaluator_1.evaluate(ast.consequent, context) : Evaluator_1.evaluate(ast.alternate, context);
}
throw new Error();
},
LogicalExpression: function (ast, context) {

@@ -47,0 +53,0 @@ if (t.isLogicalExpression(ast)) {

@@ -14,2 +14,3 @@ import * as t from '@babel/types';

export declare const isThisExpression: (ast: t.Expression) => ast is t.ThisExpression;
export declare const isConditionalExpression: (ast: t.Expression) => ast is t.ConditionalExpression;
export declare type Expression = t.Expression;

@@ -39,1 +39,4 @@ "use strict";

};
exports.isConditionalExpression = function (ast) {
return ast.type === 'ConditionalExpression';
};
import * as t from './t';
export declare type HandlerTypes = 'BinaryExpression' | 'NumericLiteral' | 'StringLiteral' | 'BooleanLiteral' | 'ArrayExpression' | 'NullLiteral' | 'Identifier' | 'CallExpression' | 'MemberExpression' | 'LogicalExpression' | 'UnaryExpression' | 'ThisExpression';
export declare type HandlerTypes = 'BinaryExpression' | 'NumericLiteral' | 'StringLiteral' | 'BooleanLiteral' | 'ArrayExpression' | 'NullLiteral' | 'Identifier' | 'CallExpression' | 'MemberExpression' | 'LogicalExpression' | 'UnaryExpression' | 'ThisExpression' | 'ConditionalExpression';
export declare type Context = {

@@ -4,0 +4,0 @@ [key: string]: any;

@@ -36,2 +36,8 @@ import * as t from './t';

},
ConditionalExpression: function (ast, context) {
if (t.isConditionalExpression(ast)) {
return evaluate(ast.test, context) ? evaluate(ast.consequent, context) : evaluate(ast.alternate, context);
}
throw new Error();
},
LogicalExpression: function (ast, context) {

@@ -38,0 +44,0 @@ if (t.isLogicalExpression(ast)) {

@@ -14,2 +14,3 @@ import * as t from '@babel/types';

export declare const isThisExpression: (ast: t.Expression) => ast is t.ThisExpression;
export declare const isConditionalExpression: (ast: t.Expression) => ast is t.ConditionalExpression;
export declare type Expression = t.Expression;

@@ -37,1 +37,4 @@ export var isIdentifier = function (ast) {

};
export var isConditionalExpression = function (ast) {
return ast.type === 'ConditionalExpression';
};
{
"name": "ts-expression-evaluator",
"version": "1.3.8",
"version": "1.3.9",
"description": "Context-based expression parse and evaluator.",

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

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