Socket
Book a DemoInstallSign in
Socket

@fw-components/formula-editor

Package Overview
Dependencies
Maintainers
2
Versions
73
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fw-components/formula-editor - npm Package Compare versions

Comparing version

to
2.2.1-formula-error-typo-fixes.0

12

dist/formula-editor/src/utils/parser.js

@@ -93,7 +93,7 @@ import Big from "big.js";

if (!(isNumber || isOperator || isBracket || isSpace)) {
parseOutput.errorString = `${this.variableType} : '${token}' does not exist`;
parseOutput.errorString = `${this.variableType} : '${token}' doesn't exist`;
expectation = Expectation.UNDEFINED;
}
else if (this.allowedOperators.has(previousToken) && isOperator) {
parseOutput.errorString = `Please use ${this.variableType}${this.allowedNumbers ? " or numbers" : ""} after '${previousToken}'. Pls do not use consecutive two mathametical operators (+ - * / ^)`;
parseOutput.errorString = `Please don't use mathematical operators (+ - * / ^) consecutively`;
expectation = Expectation.UNDEFINED;

@@ -111,3 +111,3 @@ }

&& !((unaryOperators.includes(token)) && (!parsedString.trim() || previousToken === "(" || this.allowedOperators.has(previousToken)))) {
parseOutput.errorString = `Please use ${this.variableType}${this.allowedNumbers ? " or numbers" : ""} after '${previousToken}'.`;
parseOutput.errorString = `Please use ${this.variableType} ${this.variableType && this.allowedNumbers ? " or " : ''} ${this.allowedNumbers ? "numbers" : ""} after '${previousToken}'.`;
expectation = Expectation.UNDEFINED;

@@ -119,3 +119,3 @@ }

else if (expectation === Expectation.OPERATOR && !isOperator && !isSpace && token != ")") {
parseOutput.errorString = `Please use mathametical operators (${Array.from(this.allowedOperators).join(" ")}) after '${previousToken}'.`;
parseOutput.errorString = `Please use mathematical operators (${Array.from(this.allowedOperators).join(" ")}) after '${previousToken}'.`;
expectation = Expectation.UNDEFINED;

@@ -134,3 +134,3 @@ }

else if (previousToken === "(" && token === ")") {
parseOutput.errorString = `Pls do not use empty brackets ().`;
parseOutput.errorString = `Please don't use empty brackets ().`;
expectation = Expectation.UNDEFINED;

@@ -168,3 +168,3 @@ }

if (this.allowedOperators.has(previousToken)) {
parseOutput.errorString = `Pls do not use mathametical operators (${Array.from(this.allowedOperators).join(",")}) at the end.`;
parseOutput.errorString = `Please don't use mathematical operators (${Array.from(this.allowedOperators).join(",")}) at the end.`;
}

@@ -171,0 +171,0 @@ if (!parentheses.isEmpty()) {

{
"name": "@fw-components/formula-editor",
"version": "2.2.0",
"version": "2.2.1-formula-error-typo-fixes.0",
"description": "A WYSIWYG type formula editor",

@@ -22,3 +22,3 @@ "main": "dist/formula-editor/src/formula-editor.js",

"dependencies": {
"@fw-components/styles": "^2.2.0",
"@fw-components/styles": "^2.2.1-formula-error-typo-fixes.0",
"big.js": "^6.2.1",

@@ -35,3 +35,3 @@ "lit": "^2.1.2",

},
"gitHead": "f1e2a5267f2f756720e7d1e97e7d7bf091e4a797"
"gitHead": "e675f08b79f66e17555b4bd1b44e857cb4a40de4"
}