@fw-components/formula-editor 2.0.7-formula-editor.42 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -291,6 +291,10 @@ export class Parser {
291
291
  calcStack.push(Big(number));
292
292
  }
293
293
  else {
294
+ if (calcStack.size() < 2) {
295
+ calculationResult.errorString = "Calculation error: Invalid formula";
296
+ return calculationResult;
297
+ }
294
298
  const operator = frontItem;
295
299
  const numB = calcStack.pop();
296
300
  const numA = calcStack.pop();
@@ -14,4 +14,7 @@ export class Stack {
14
14
  isEmpty() {
15
15
  return this._elements.length === 0;
16
16
  }
17
+ size() {
18
+ return this._elements.length;
19
+ }
17
20
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fw-components/formula-editor",
3
- "version": "2.0.7-formula-editor.42",
3
+ "version": "2.1.0",
4
4
  "description": "A WYSIWYG type formula editor",
5
5
  "main": "dist/formula-editor/src/formula-editor.js",
6
6
  "exports": {
@@ -19,7 +19,7 @@
19
19
  "prepublishOnly": "npm run build"
20
20
  },
21
21
  "dependencies": {
22
- "@fw-components/styles": "^2.0.7-formula-editor.0",
22
+ "@fw-components/styles": "^2.1.0",
23
23
  "big.js": "^6.2.1",
24
24
  "lit": "^2.1.2",
25
25
  "match-sorter": "^8.0.0",
@@ -31,5 +31,5 @@
31
31
  "@types/big.js": "^6.1.6",
32
32
  "es-dev-server": "^2.1.0"
33
33
  },
34
- "gitHead": "13003cbdce348fbc73c50bb9a650460f344b4b88"
34
+ "gitHead": "65018c2fe1211c69169036e115bf6b1f9a0469f9"
35
35
  }