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 3.0.1 to 3.0.2

2

dist/expression-eval.js

@@ -1,2 +0,2 @@

var e=function(t,i){try{var s=!1;function c(){if("function"==typeof l){var e=l,r=e.apply,o=a;return Promise.resolve(n(t.arguments,i)).then(function(n){return Promise.resolve(r.call(e,o,n))})}}switch(t.type){case"ArrayExpression":return Promise.resolve(n(t.elements,i));case"BinaryExpression":return Promise.resolve(Promise.all([e(t.left,i),e(t.right,i)])).then(function(e){return o[t.operator](e[0],e[1])});case"CallExpression":var a,l,f,p="MemberExpression"===t.callee.type?Promise.resolve(r(t.callee,i)).then(function(e){a=(f=e)[0],l=f[1]}):Promise.resolve(e(t.callee,i)).then(function(e){l=e});return Promise.resolve(p&&p.then?p.then(c):c());case"ConditionalExpression":return Promise.resolve(e(t.test,i)).then(function(r){return Promise.resolve(e(r?t.consequent:t.alternate,i))});case"Identifier":return Promise.resolve(i[t.name]);case"Literal":return Promise.resolve(t.value);case"LogicalExpression":{function m(r){return s?r:Promise.resolve(Promise.all([e(t.left,i),e(t.right,i)])).then(function(e){return o[t.operator](e[0],e[1])})}var v="||"===t.operator?(s=!0,Promise.resolve(e(t.left,i)).then(function(r){return r||Promise.resolve(e(t.right,i))})):function(){if("&&"===t.operator)return s=!0,Promise.resolve(e(t.left,i)).then(function(r){return r?Promise.resolve(e(t.right,i)):r})}();return Promise.resolve(v&&v.then?v.then(m):m(v))}case"MemberExpression":return Promise.resolve(r(t,i)).then(function(e){return e[1]});case"ThisExpression":return Promise.resolve(i);case"UnaryExpression":var h=u[t.operator];return Promise.resolve(e(t.argument,i)).then(function(e){return h.call(u,e)});default:return Promise.resolve(void 0)}}catch(e){return Promise.reject(e)}},r=function(r,n){try{return Promise.resolve(e(r.object,n)).then(function(t){return r.computed?Promise.resolve(e(r.property,n)).then(function(e){return[t,t[e]]}):[t,t[r.property.name]]})}catch(e){return Promise.reject(e)}},n=function(r,n){try{return Promise.resolve(Promise.all(r.map(function(r){return e(r,n)})))}catch(e){return Promise.reject(e)}},t=require("jsep"),o={"||":function(e,r){return e||r},"&&":function(e,r){return e&&r},"|":function(e,r){return e|r},"^":function(e,r){return e^r},"&":function(e,r){return e&r},"==":function(e,r){return e==r},"!=":function(e,r){return e!=r},"===":function(e,r){return e===r},"!==":function(e,r){return e!==r},"<":function(e,r){return e<r},">":function(e,r){return e>r},"<=":function(e,r){return e<=r},">=":function(e,r){return e>=r},"<<":function(e,r){return e<<r},">>":function(e,r){return e>>r},">>>":function(e,r){return e>>>r},"+":function(e,r){return e+r},"-":function(e,r){return e-r},"*":function(e,r){return e*r},"/":function(e,r){return e/r},"%":function(e,r){return e%r}},u={"-":function(e){return-e},"+":function(e){return+e},"~":function(e){return~e},"!":function(e){return!e}};function i(e,r){return e.map(function(e){return c(e,r)})}function s(e,r){var n=c(e.object,r);return e.computed?[n,n[c(e.property,r)]]:[n,n[e.property.name]]}function c(e,r){switch(e.type){case"ArrayExpression":return i(e.elements,r);case"BinaryExpression":return o[e.operator](c(e.left,r),c(e.right,r));case"CallExpression":var n,t,a;if("MemberExpression"===e.callee.type?(n=(a=s(e.callee,r))[0],t=a[1]):t=c(e.callee,r),"function"!=typeof t)return;return t.apply(n,i(e.arguments,r));case"ConditionalExpression":return c(e.test,r)?c(e.consequent,r):c(e.alternate,r);case"Identifier":return r[e.name];case"Literal":return e.value;case"LogicalExpression":return"||"===e.operator?c(e.left,r)||c(e.right,r):"&&"===e.operator?c(e.left,r)&&c(e.right,r):o[e.operator](c(e.left,r),c(e.right,r));case"MemberExpression":return s(e,r)[1];case"ThisExpression":return r;case"UnaryExpression":return u[e.operator](c(e.argument,r));default:return}}module.exports={parse:t,eval:c,evalAsync:e,compile:function(e){return c.bind(null,t(e))},compileAsync:function(r){return e.bind(null,t(r))}};
var e,r=(e=require("jsep"))&&"object"==typeof e&&"default"in e?e.default:e,n=function(e,r){try{var s=!1;function c(){if("function"==typeof l){var n=l,t=n.apply,u=a;return Promise.resolve(o(e.arguments,r)).then(function(e){return Promise.resolve(t.call(n,u,e))})}}switch(e.type){case"ArrayExpression":return Promise.resolve(o(e.elements,r));case"BinaryExpression":return Promise.resolve(Promise.all([n(e.left,r),n(e.right,r)])).then(function(r){return u[e.operator](r[0],r[1])});case"CallExpression":var a,l,f,p="MemberExpression"===e.callee.type?Promise.resolve(t(e.callee,r)).then(function(e){a=(f=e)[0],l=f[1]}):Promise.resolve(n(e.callee,r)).then(function(e){l=e});return Promise.resolve(p&&p.then?p.then(c):c());case"ConditionalExpression":return Promise.resolve(n(e.test,r)).then(function(t){return Promise.resolve(n(t?e.consequent:e.alternate,r))});case"Identifier":return Promise.resolve(r[e.name]);case"Literal":return Promise.resolve(e.value);case"LogicalExpression":{function m(t){return s?t:Promise.resolve(Promise.all([n(e.left,r),n(e.right,r)])).then(function(r){return u[e.operator](r[0],r[1])})}var v="||"===e.operator?(s=!0,Promise.resolve(n(e.left,r)).then(function(t){return t||Promise.resolve(n(e.right,r))})):function(){if("&&"===e.operator)return s=!0,Promise.resolve(n(e.left,r)).then(function(t){return t?Promise.resolve(n(e.right,r)):t})}();return Promise.resolve(v&&v.then?v.then(m):m(v))}case"MemberExpression":return Promise.resolve(t(e,r)).then(function(e){return e[1]});case"ThisExpression":return Promise.resolve(r);case"UnaryExpression":var h=i[e.operator];return Promise.resolve(n(e.argument,r)).then(function(e){return h.call(i,e)});default:return Promise.resolve(void 0)}}catch(e){return Promise.reject(e)}},t=function(e,r){try{return Promise.resolve(n(e.object,r)).then(function(t){return e.computed?Promise.resolve(n(e.property,r)).then(function(e){return[t,t[e]]}):[t,t[e.property.name]]})}catch(e){return Promise.reject(e)}},o=function(e,r){try{return Promise.resolve(Promise.all(e.map(function(e){return n(e,r)})))}catch(e){return Promise.reject(e)}},u={"||":function(e,r){return e||r},"&&":function(e,r){return e&&r},"|":function(e,r){return e|r},"^":function(e,r){return e^r},"&":function(e,r){return e&r},"==":function(e,r){return e==r},"!=":function(e,r){return e!=r},"===":function(e,r){return e===r},"!==":function(e,r){return e!==r},"<":function(e,r){return e<r},">":function(e,r){return e>r},"<=":function(e,r){return e<=r},">=":function(e,r){return e>=r},"<<":function(e,r){return e<<r},">>":function(e,r){return e>>r},">>>":function(e,r){return e>>>r},"+":function(e,r){return e+r},"-":function(e,r){return e-r},"*":function(e,r){return e*r},"/":function(e,r){return e/r},"%":function(e,r){return e%r}},i={"-":function(e){return-e},"+":function(e){return+e},"~":function(e){return~e},"!":function(e){return!e}};function s(e,r){return e.map(function(e){return a(e,r)})}function c(e,r){var n=a(e.object,r);return e.computed?[n,n[a(e.property,r)]]:[n,n[e.property.name]]}function a(e,r){switch(e.type){case"ArrayExpression":return s(e.elements,r);case"BinaryExpression":return u[e.operator](a(e.left,r),a(e.right,r));case"CallExpression":var n,t,o;if("MemberExpression"===e.callee.type?(n=(o=c(e.callee,r))[0],t=o[1]):t=a(e.callee,r),"function"!=typeof t)return;return t.apply(n,s(e.arguments,r));case"ConditionalExpression":return a(e.test,r)?a(e.consequent,r):a(e.alternate,r);case"Identifier":return r[e.name];case"Literal":return e.value;case"LogicalExpression":return"||"===e.operator?a(e.left,r)||a(e.right,r):"&&"===e.operator?a(e.left,r)&&a(e.right,r):u[e.operator](a(e.left,r),a(e.right,r));case"MemberExpression":return c(e,r)[1];case"ThisExpression":return r;case"UnaryExpression":return i[e.operator](a(e.argument,r));default:return}}module.exports={parse:r,eval:a,evalAsync:n,compile:function(e){return a.bind(null,r(e))},compileAsync:function(e){return n.bind(null,r(e))}};
//# sourceMappingURL=expression-eval.js.map

@@ -1,2 +0,2 @@

var e=function(t,i){try{var s=!1;function c(){if("function"==typeof l){var e=l,r=e.apply,o=a;return Promise.resolve(n(t.arguments,i)).then(function(n){return Promise.resolve(r.call(e,o,n))})}}switch(t.type){case"ArrayExpression":return Promise.resolve(n(t.elements,i));case"BinaryExpression":return Promise.resolve(Promise.all([e(t.left,i),e(t.right,i)])).then(function(e){return o[t.operator](e[0],e[1])});case"CallExpression":var a,l,f,p="MemberExpression"===t.callee.type?Promise.resolve(r(t.callee,i)).then(function(e){a=(f=e)[0],l=f[1]}):Promise.resolve(e(t.callee,i)).then(function(e){l=e});return Promise.resolve(p&&p.then?p.then(c):c());case"ConditionalExpression":return Promise.resolve(e(t.test,i)).then(function(r){return Promise.resolve(e(r?t.consequent:t.alternate,i))});case"Identifier":return Promise.resolve(i[t.name]);case"Literal":return Promise.resolve(t.value);case"LogicalExpression":{function m(r){return s?r:Promise.resolve(Promise.all([e(t.left,i),e(t.right,i)])).then(function(e){return o[t.operator](e[0],e[1])})}var v="||"===t.operator?(s=!0,Promise.resolve(e(t.left,i)).then(function(r){return r||Promise.resolve(e(t.right,i))})):function(){if("&&"===t.operator)return s=!0,Promise.resolve(e(t.left,i)).then(function(r){return r?Promise.resolve(e(t.right,i)):r})}();return Promise.resolve(v&&v.then?v.then(m):m(v))}case"MemberExpression":return Promise.resolve(r(t,i)).then(function(e){return e[1]});case"ThisExpression":return Promise.resolve(i);case"UnaryExpression":var h=u[t.operator];return Promise.resolve(e(t.argument,i)).then(function(e){return h.call(u,e)});default:return Promise.resolve(void 0)}}catch(e){return Promise.reject(e)}},r=function(r,n){try{return Promise.resolve(e(r.object,n)).then(function(t){return r.computed?Promise.resolve(e(r.property,n)).then(function(e){return[t,t[e]]}):[t,t[r.property.name]]})}catch(e){return Promise.reject(e)}},n=function(r,n){try{return Promise.resolve(Promise.all(r.map(function(r){return e(r,n)})))}catch(e){return Promise.reject(e)}},t=require("jsep"),o={"||":function(e,r){return e||r},"&&":function(e,r){return e&&r},"|":function(e,r){return e|r},"^":function(e,r){return e^r},"&":function(e,r){return e&r},"==":function(e,r){return e==r},"!=":function(e,r){return e!=r},"===":function(e,r){return e===r},"!==":function(e,r){return e!==r},"<":function(e,r){return e<r},">":function(e,r){return e>r},"<=":function(e,r){return e<=r},">=":function(e,r){return e>=r},"<<":function(e,r){return e<<r},">>":function(e,r){return e>>r},">>>":function(e,r){return e>>>r},"+":function(e,r){return e+r},"-":function(e,r){return e-r},"*":function(e,r){return e*r},"/":function(e,r){return e/r},"%":function(e,r){return e%r}},u={"-":function(e){return-e},"+":function(e){return+e},"~":function(e){return~e},"!":function(e){return!e}};function i(e,r){return e.map(function(e){return c(e,r)})}function s(e,r){var n=c(e.object,r);return e.computed?[n,n[c(e.property,r)]]:[n,n[e.property.name]]}function c(e,r){switch(e.type){case"ArrayExpression":return i(e.elements,r);case"BinaryExpression":return o[e.operator](c(e.left,r),c(e.right,r));case"CallExpression":var n,t,a;if("MemberExpression"===e.callee.type?(n=(a=s(e.callee,r))[0],t=a[1]):t=c(e.callee,r),"function"!=typeof t)return;return t.apply(n,i(e.arguments,r));case"ConditionalExpression":return c(e.test,r)?c(e.consequent,r):c(e.alternate,r);case"Identifier":return r[e.name];case"Literal":return e.value;case"LogicalExpression":return"||"===e.operator?c(e.left,r)||c(e.right,r):"&&"===e.operator?c(e.left,r)&&c(e.right,r):o[e.operator](c(e.left,r),c(e.right,r));case"MemberExpression":return s(e,r)[1];case"ThisExpression":return r;case"UnaryExpression":return u[e.operator](c(e.argument,r));default:return}}module.exports={parse:t,eval:c,evalAsync:e,compile:function(e){return c.bind(null,t(e))},compileAsync:function(r){return e.bind(null,t(r))}};
import e from"jsep";var r=function(e,i){try{var s=!1;function c(){if("function"==typeof l){var r=l,n=r.apply,o=a;return Promise.resolve(t(e.arguments,i)).then(function(e){return Promise.resolve(n.call(r,o,e))})}}switch(e.type){case"ArrayExpression":return Promise.resolve(t(e.elements,i));case"BinaryExpression":return Promise.resolve(Promise.all([r(e.left,i),r(e.right,i)])).then(function(r){return o[e.operator](r[0],r[1])});case"CallExpression":var a,l,f,p="MemberExpression"===e.callee.type?Promise.resolve(n(e.callee,i)).then(function(e){a=(f=e)[0],l=f[1]}):Promise.resolve(r(e.callee,i)).then(function(e){l=e});return Promise.resolve(p&&p.then?p.then(c):c());case"ConditionalExpression":return Promise.resolve(r(e.test,i)).then(function(n){return Promise.resolve(r(n?e.consequent:e.alternate,i))});case"Identifier":return Promise.resolve(i[e.name]);case"Literal":return Promise.resolve(e.value);case"LogicalExpression":{function m(n){return s?n:Promise.resolve(Promise.all([r(e.left,i),r(e.right,i)])).then(function(r){return o[e.operator](r[0],r[1])})}var v="||"===e.operator?(s=!0,Promise.resolve(r(e.left,i)).then(function(n){return n||Promise.resolve(r(e.right,i))})):function(){if("&&"===e.operator)return s=!0,Promise.resolve(r(e.left,i)).then(function(n){return n?Promise.resolve(r(e.right,i)):n})}();return Promise.resolve(v&&v.then?v.then(m):m(v))}case"MemberExpression":return Promise.resolve(n(e,i)).then(function(e){return e[1]});case"ThisExpression":return Promise.resolve(i);case"UnaryExpression":var h=u[e.operator];return Promise.resolve(r(e.argument,i)).then(function(e){return h.call(u,e)});default:return Promise.resolve(void 0)}}catch(e){return Promise.reject(e)}},n=function(e,n){try{return Promise.resolve(r(e.object,n)).then(function(t){return e.computed?Promise.resolve(r(e.property,n)).then(function(e){return[t,t[e]]}):[t,t[e.property.name]]})}catch(e){return Promise.reject(e)}},t=function(e,n){try{return Promise.resolve(Promise.all(e.map(function(e){return r(e,n)})))}catch(e){return Promise.reject(e)}},o={"||":function(e,r){return e||r},"&&":function(e,r){return e&&r},"|":function(e,r){return e|r},"^":function(e,r){return e^r},"&":function(e,r){return e&r},"==":function(e,r){return e==r},"!=":function(e,r){return e!=r},"===":function(e,r){return e===r},"!==":function(e,r){return e!==r},"<":function(e,r){return e<r},">":function(e,r){return e>r},"<=":function(e,r){return e<=r},">=":function(e,r){return e>=r},"<<":function(e,r){return e<<r},">>":function(e,r){return e>>r},">>>":function(e,r){return e>>>r},"+":function(e,r){return e+r},"-":function(e,r){return e-r},"*":function(e,r){return e*r},"/":function(e,r){return e/r},"%":function(e,r){return e%r}},u={"-":function(e){return-e},"+":function(e){return+e},"~":function(e){return~e},"!":function(e){return!e}};function i(e,r){return e.map(function(e){return c(e,r)})}function s(e,r){var n=c(e.object,r);return e.computed?[n,n[c(e.property,r)]]:[n,n[e.property.name]]}function c(e,r){switch(e.type){case"ArrayExpression":return i(e.elements,r);case"BinaryExpression":return o[e.operator](c(e.left,r),c(e.right,r));case"CallExpression":var n,t,a;if("MemberExpression"===e.callee.type?(n=(a=s(e.callee,r))[0],t=a[1]):t=c(e.callee,r),"function"!=typeof t)return;return t.apply(n,i(e.arguments,r));case"ConditionalExpression":return c(e.test,r)?c(e.consequent,r):c(e.alternate,r);case"Identifier":return r[e.name];case"Literal":return e.value;case"LogicalExpression":return"||"===e.operator?c(e.left,r)||c(e.right,r):"&&"===e.operator?c(e.left,r)&&c(e.right,r):o[e.operator](c(e.left,r),c(e.right,r));case"MemberExpression":return s(e,r)[1];case"ThisExpression":return r;case"UnaryExpression":return u[e.operator](c(e.argument,r));default:return}}module.exports={parse:e,eval:c,evalAsync:r,compile:function(r){return c.bind(null,e(r))},compileAsync:function(n){return r.bind(null,e(n))}};
//# sourceMappingURL=expression-eval.module.js.map

@@ -1,2 +0,2 @@

!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r():"function"==typeof define&&define.amd?define(r):r()}(0,function(){var e=function(t,i){try{var s=!1;function c(){if("function"==typeof l){var e=l,r=e.apply,o=a;return Promise.resolve(n(t.arguments,i)).then(function(n){return Promise.resolve(r.call(e,o,n))})}}switch(t.type){case"ArrayExpression":return Promise.resolve(n(t.elements,i));case"BinaryExpression":return Promise.resolve(Promise.all([e(t.left,i),e(t.right,i)])).then(function(e){return o[t.operator](e[0],e[1])});case"CallExpression":var a,l,f,p="MemberExpression"===t.callee.type?Promise.resolve(r(t.callee,i)).then(function(e){a=(f=e)[0],l=f[1]}):Promise.resolve(e(t.callee,i)).then(function(e){l=e});return Promise.resolve(p&&p.then?p.then(c):c());case"ConditionalExpression":return Promise.resolve(e(t.test,i)).then(function(r){return Promise.resolve(e(r?t.consequent:t.alternate,i))});case"Identifier":return Promise.resolve(i[t.name]);case"Literal":return Promise.resolve(t.value);case"LogicalExpression":{function m(r){return s?r:Promise.resolve(Promise.all([e(t.left,i),e(t.right,i)])).then(function(e){return o[t.operator](e[0],e[1])})}var v="||"===t.operator?(s=!0,Promise.resolve(e(t.left,i)).then(function(r){return r||Promise.resolve(e(t.right,i))})):function(){if("&&"===t.operator)return s=!0,Promise.resolve(e(t.left,i)).then(function(r){return r?Promise.resolve(e(t.right,i)):r})}();return Promise.resolve(v&&v.then?v.then(m):m(v))}case"MemberExpression":return Promise.resolve(r(t,i)).then(function(e){return e[1]});case"ThisExpression":return Promise.resolve(i);case"UnaryExpression":var h=u[t.operator];return Promise.resolve(e(t.argument,i)).then(function(e){return h.call(u,e)});default:return Promise.resolve(void 0)}}catch(e){return Promise.reject(e)}},r=function(r,n){try{return Promise.resolve(e(r.object,n)).then(function(t){return r.computed?Promise.resolve(e(r.property,n)).then(function(e){return[t,t[e]]}):[t,t[r.property.name]]})}catch(e){return Promise.reject(e)}},n=function(r,n){try{return Promise.resolve(Promise.all(r.map(function(r){return e(r,n)})))}catch(e){return Promise.reject(e)}},t=require("jsep"),o={"||":function(e,r){return e||r},"&&":function(e,r){return e&&r},"|":function(e,r){return e|r},"^":function(e,r){return e^r},"&":function(e,r){return e&r},"==":function(e,r){return e==r},"!=":function(e,r){return e!=r},"===":function(e,r){return e===r},"!==":function(e,r){return e!==r},"<":function(e,r){return e<r},">":function(e,r){return e>r},"<=":function(e,r){return e<=r},">=":function(e,r){return e>=r},"<<":function(e,r){return e<<r},">>":function(e,r){return e>>r},">>>":function(e,r){return e>>>r},"+":function(e,r){return e+r},"-":function(e,r){return e-r},"*":function(e,r){return e*r},"/":function(e,r){return e/r},"%":function(e,r){return e%r}},u={"-":function(e){return-e},"+":function(e){return+e},"~":function(e){return~e},"!":function(e){return!e}};function i(e,r){return e.map(function(e){return c(e,r)})}function s(e,r){var n=c(e.object,r);return e.computed?[n,n[c(e.property,r)]]:[n,n[e.property.name]]}function c(e,r){switch(e.type){case"ArrayExpression":return i(e.elements,r);case"BinaryExpression":return o[e.operator](c(e.left,r),c(e.right,r));case"CallExpression":var n,t,a;if("MemberExpression"===e.callee.type?(n=(a=s(e.callee,r))[0],t=a[1]):t=c(e.callee,r),"function"!=typeof t)return;return t.apply(n,i(e.arguments,r));case"ConditionalExpression":return c(e.test,r)?c(e.consequent,r):c(e.alternate,r);case"Identifier":return r[e.name];case"Literal":return e.value;case"LogicalExpression":return"||"===e.operator?c(e.left,r)||c(e.right,r):"&&"===e.operator?c(e.left,r)&&c(e.right,r):o[e.operator](c(e.left,r),c(e.right,r));case"MemberExpression":return s(e,r)[1];case"ThisExpression":return r;case"UnaryExpression":return u[e.operator](c(e.argument,r));default:return}}module.exports={parse:t,eval:c,evalAsync:e,compile:function(e){return c.bind(null,t(e))},compileAsync:function(r){return e.bind(null,t(r))}}});
!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(require("jsep")):"function"==typeof define&&define.amd?define(["jsep"],r):r(e.jsep)}(this,function(e){e=e&&e.hasOwnProperty("default")?e.default:e;var r=function(e,i){try{var s=!1;function c(){if("function"==typeof l){var r=l,n=r.apply,o=a;return Promise.resolve(t(e.arguments,i)).then(function(e){return Promise.resolve(n.call(r,o,e))})}}switch(e.type){case"ArrayExpression":return Promise.resolve(t(e.elements,i));case"BinaryExpression":return Promise.resolve(Promise.all([r(e.left,i),r(e.right,i)])).then(function(r){return o[e.operator](r[0],r[1])});case"CallExpression":var a,l,f,p="MemberExpression"===e.callee.type?Promise.resolve(n(e.callee,i)).then(function(e){a=(f=e)[0],l=f[1]}):Promise.resolve(r(e.callee,i)).then(function(e){l=e});return Promise.resolve(p&&p.then?p.then(c):c());case"ConditionalExpression":return Promise.resolve(r(e.test,i)).then(function(n){return Promise.resolve(r(n?e.consequent:e.alternate,i))});case"Identifier":return Promise.resolve(i[e.name]);case"Literal":return Promise.resolve(e.value);case"LogicalExpression":{function m(n){return s?n:Promise.resolve(Promise.all([r(e.left,i),r(e.right,i)])).then(function(r){return o[e.operator](r[0],r[1])})}var v="||"===e.operator?(s=!0,Promise.resolve(r(e.left,i)).then(function(n){return n||Promise.resolve(r(e.right,i))})):function(){if("&&"===e.operator)return s=!0,Promise.resolve(r(e.left,i)).then(function(n){return n?Promise.resolve(r(e.right,i)):n})}();return Promise.resolve(v&&v.then?v.then(m):m(v))}case"MemberExpression":return Promise.resolve(n(e,i)).then(function(e){return e[1]});case"ThisExpression":return Promise.resolve(i);case"UnaryExpression":var h=u[e.operator];return Promise.resolve(r(e.argument,i)).then(function(e){return h.call(u,e)});default:return Promise.resolve(void 0)}}catch(e){return Promise.reject(e)}},n=function(e,n){try{return Promise.resolve(r(e.object,n)).then(function(t){return e.computed?Promise.resolve(r(e.property,n)).then(function(e){return[t,t[e]]}):[t,t[e.property.name]]})}catch(e){return Promise.reject(e)}},t=function(e,n){try{return Promise.resolve(Promise.all(e.map(function(e){return r(e,n)})))}catch(e){return Promise.reject(e)}},o={"||":function(e,r){return e||r},"&&":function(e,r){return e&&r},"|":function(e,r){return e|r},"^":function(e,r){return e^r},"&":function(e,r){return e&r},"==":function(e,r){return e==r},"!=":function(e,r){return e!=r},"===":function(e,r){return e===r},"!==":function(e,r){return e!==r},"<":function(e,r){return e<r},">":function(e,r){return e>r},"<=":function(e,r){return e<=r},">=":function(e,r){return e>=r},"<<":function(e,r){return e<<r},">>":function(e,r){return e>>r},">>>":function(e,r){return e>>>r},"+":function(e,r){return e+r},"-":function(e,r){return e-r},"*":function(e,r){return e*r},"/":function(e,r){return e/r},"%":function(e,r){return e%r}},u={"-":function(e){return-e},"+":function(e){return+e},"~":function(e){return~e},"!":function(e){return!e}};function i(e,r){return e.map(function(e){return c(e,r)})}function s(e,r){var n=c(e.object,r);return e.computed?[n,n[c(e.property,r)]]:[n,n[e.property.name]]}function c(e,r){switch(e.type){case"ArrayExpression":return i(e.elements,r);case"BinaryExpression":return o[e.operator](c(e.left,r),c(e.right,r));case"CallExpression":var n,t,a;if("MemberExpression"===e.callee.type?(n=(a=s(e.callee,r))[0],t=a[1]):t=c(e.callee,r),"function"!=typeof t)return;return t.apply(n,i(e.arguments,r));case"ConditionalExpression":return c(e.test,r)?c(e.consequent,r):c(e.alternate,r);case"Identifier":return r[e.name];case"Literal":return e.value;case"LogicalExpression":return"||"===e.operator?c(e.left,r)||c(e.right,r):"&&"===e.operator?c(e.left,r)&&c(e.right,r):o[e.operator](c(e.left,r),c(e.right,r));case"MemberExpression":return s(e,r)[1];case"ThisExpression":return r;case"UnaryExpression":return u[e.operator](c(e.argument,r));default:return}}module.exports={parse:e,eval:c,evalAsync:r,compile:function(r){return c.bind(null,e(r))},compileAsync:function(n){return r.bind(null,e(n))}}});
//# sourceMappingURL=expression-eval.umd.js.map
{
"name": "expression-eval",
"version": "3.0.1",
"version": "3.0.2",
"description": "JavaScript expression parsing and evaluation.",

@@ -18,3 +18,3 @@ "source": "index.js",

"test": "node test.js",
"preversion": "npm run test",
"preversion": "npm run build && npm run test",
"postversion": "git push && git push --tags && npm publish"

@@ -21,0 +21,0 @@ },

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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