diff --git a/dist/browser/math-expression-evaluator.js b/dist/browser/math-expression-evaluator.js index 0255d3d..10e67ca 100644 --- a/dist/browser/math-expression-evaluator.js +++ b/dist/browser/math-expression-evaluator.js @@ -1,4 +1,14 @@ -/******/ (() => { // webpackBootstrap +(function webpackUniversalModuleDefinition(root, factory) { + if(typeof exports === 'object' && typeof module === 'object') + module.exports = factory(); + else if(typeof define === 'function' && define.amd) + define([], factory); + else if(typeof exports === 'object') + exports["Mexp"] = factory(); + else + root["Mexp"] = factory(); +})(self, function() { +return /******/ (() => { // webpackBootstrap /******/ var __webpack_modules__ = ({ /***/ 28: @@ -993,5 +1003,7 @@ module.exports=Mexp; /******/ // This entry module is referenced by other modules so it can't be inlined /******/ var __webpack_exports__ = __webpack_require__(28); /******/ +/******/ return __webpack_exports__; /******/ })() -; \ No newline at end of file +; +}); \ No newline at end of file diff --git a/dist/browser/math-expression-evaluator.min.js b/dist/browser/math-expression-evaluator.min.js index aec3dd8..ad418b5 100644 --- a/dist/browser/math-expression-evaluator.min.js +++ b/dist/browser/math-expression-evaluator.min.js @@ -1 +1 @@ -(()=>{var t={28:(t,e,a)=>{var n=a(733);n.prototype.formulaEval=function(){"use strict";for(var t,e,a,n=[],o=this.value,h=0;h"+e.value+""+o[h].show+""+t.value+"",type:10}):n.push({value:(1!=e.type?"(":"")+e.value+(1!=e.type?")":"")+""+t.value+"",type:1})):2===o[h].type||9===o[h].type?(t=n.pop(),e=n.pop(),n.push({value:(1!=e.type?"(":"")+e.value+(1!=e.type?")":"")+o[h].show+(1!=t.type?"(":"")+t.value+(1!=t.type?")":""),type:o[h].type})):12===o[h].type&&(t=n.pop(),e=n.pop(),a=n.pop(),n.push({value:o[h].show+"("+a.value+","+e.value+","+t.value+")",type:12}));return n[0].value},t.exports=n},618:(t,e,a)=>{"use strict";var n=a(178);function o(t,e){for(var a=0;ag.length-2?g.length-1:t.length-v;a>0;a--)if(void 0!==g[a])for(o=0;o0&&a{"use strict";var e=function(t){this.value=t};e.math={isDegree:!0,acos:function(t){return e.math.isDegree?180/Math.PI*Math.acos(t):Math.acos(t)},add:function(t,e){return t+e},asin:function(t){return e.math.isDegree?180/Math.PI*Math.asin(t):Math.asin(t)},atan:function(t){return e.math.isDegree?180/Math.PI*Math.atan(t):Math.atan(t)},acosh:function(t){return Math.log(t+Math.sqrt(t*t-1))},asinh:function(t){return Math.log(t+Math.sqrt(t*t+1))},atanh:function(t){return Math.log((1+t)/(1-t))},C:function(t,a){var n=1,o=t-a,h=a;h{var n=a(618);n.prototype.toPostfix=function(){"use strict";for(var t,e,a,o,h,p=[],u=[{value:"(",type:4,pre:0}],s=this.value,r=1;ra)u.push(t);else{for(;a>=o&&!i||i&&o{var n=a(477);n.prototype.postfixEval=function(t){"use strict";(t=t||{}).PI=Math.PI,t.E=Math.E;for(var e,a,o,h=[],p=this.value,u=void 0!==t.n,s=0;s1)throw new n.Exception("Uncaught Syntax error");return h[0].value>1e15?"Infinity":parseFloat(h[0].value.toFixed(15))},n.eval=function(t,e,a){return void 0===e?this.lex(t).toPostfix().postfixEval():void 0===a?void 0!==e.length?this.lex(t,e).toPostfix().postfixEval():this.lex(t).toPostfix().postfixEval(e):this.lex(t,e).toPostfix().postfixEval(a)},t.exports=n}},e={};(function a(n){var o=e[n];if(void 0!==o)return o.exports;var h=e[n]={exports:{}};return t[n](h,h.exports,a),h.exports})(28)})(); \ No newline at end of file +!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Mexp=e():t.Mexp=e()}(self,(function(){return t={28:(t,e,a)=>{var n=a(733);n.prototype.formulaEval=function(){"use strict";for(var t,e,a,n=[],o=this.value,p=0;p"+e.value+""+o[p].show+""+t.value+"",type:10}):n.push({value:(1!=e.type?"(":"")+e.value+(1!=e.type?")":"")+""+t.value+"",type:1})):2===o[p].type||9===o[p].type?(t=n.pop(),e=n.pop(),n.push({value:(1!=e.type?"(":"")+e.value+(1!=e.type?")":"")+o[p].show+(1!=t.type?"(":"")+t.value+(1!=t.type?")":""),type:o[p].type})):12===o[p].type&&(t=n.pop(),e=n.pop(),a=n.pop(),n.push({value:o[p].show+"("+a.value+","+e.value+","+t.value+")",type:12}));return n[0].value},t.exports=n},618:(t,e,a)=>{"use strict";var n=a(178);function o(t,e){for(var a=0;ag.length-2?g.length-1:t.length-v;a>0;a--)if(void 0!==g[a])for(o=0;o0&&a{"use strict";var e=function(t){this.value=t};e.math={isDegree:!0,acos:function(t){return e.math.isDegree?180/Math.PI*Math.acos(t):Math.acos(t)},add:function(t,e){return t+e},asin:function(t){return e.math.isDegree?180/Math.PI*Math.asin(t):Math.asin(t)},atan:function(t){return e.math.isDegree?180/Math.PI*Math.atan(t):Math.atan(t)},acosh:function(t){return Math.log(t+Math.sqrt(t*t-1))},asinh:function(t){return Math.log(t+Math.sqrt(t*t+1))},atanh:function(t){return Math.log((1+t)/(1-t))},C:function(t,a){var n=1,o=t-a,p=a;p{var n=a(618);n.prototype.toPostfix=function(){"use strict";for(var t,e,a,o,p,h=[],u=[{value:"(",type:4,pre:0}],s=this.value,r=1;ra)u.push(t);else{for(;a>=o&&!i||i&&o{var n=a(477);n.prototype.postfixEval=function(t){"use strict";(t=t||{}).PI=Math.PI,t.E=Math.E;for(var e,a,o,p=[],h=this.value,u=void 0!==t.n,s=0;s1)throw new n.Exception("Uncaught Syntax error");return p[0].value>1e15?"Infinity":parseFloat(p[0].value.toFixed(15))},n.eval=function(t,e,a){return void 0===e?this.lex(t).toPostfix().postfixEval():void 0===a?void 0!==e.length?this.lex(t,e).toPostfix().postfixEval():this.lex(t).toPostfix().postfixEval(e):this.lex(t,e).toPostfix().postfixEval(a)},t.exports=n}},e={},a=function a(n){var o=e[n];if(void 0!==o)return o.exports;var p=e[n]={exports:{}};return t[n](p,p.exports,a),p.exports}(28),a;var t,e,a})); \ No newline at end of file diff --git a/webpack.config.js b/webpack.config.js index 9a557e2..8901015 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,13 +1,17 @@ const webpack = require('webpack') const TerserPlugin = require('terser-webpack-plugin') -const path = require("path") +const path = require('path') const PROD = (process.env.NODE_ENV === 'production') module.exports = { mode: 'production', entry: './src/formula_evaluator.js', output: { - path: path.join(__dirname,'./dist/browser'), - filename: PROD ? 'math-expression-evaluator.min.js' : 'math-expression-evaluator.js' + path: path.join(__dirname, './dist/browser'), + filename: PROD ? 'math-expression-evaluator.min.js' : 'math-expression-evaluator.js', + library: { + name: 'Mexp', + type: 'umd' + } }, optimization: { minimize: PROD,