math-exercises 2.2.94 → 2.2.95

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.
Files changed (171) hide show
  1. package/lib/exercises/math/calcul/fractions/fractionSquare.d.ts.map +1 -1
  2. package/lib/exercises/math/calcul/fractions/fractionSquare.js +2 -1
  3. package/lib/exercises/math/calcul/fractions/fractionsSum.d.ts.map +1 -1
  4. package/lib/exercises/math/calcul/fractions/fractionsSum.js +2 -1
  5. package/lib/exercises/math/calcul/fractions/fractionsSumsMultiplesDenominators.d.ts.map +1 -1
  6. package/lib/exercises/math/calcul/fractions/fractionsSumsMultiplesDenominators.js +2 -1
  7. package/lib/exercises/math/calcul/fractions/fractionsSumsPrimeDenominators.d.ts.map +1 -1
  8. package/lib/exercises/math/calcul/fractions/fractionsSumsPrimeDenominators.js +2 -1
  9. package/lib/exercises/math/calcul/fractions/fractionsSumsSameDenominators.d.ts.map +1 -1
  10. package/lib/exercises/math/calcul/fractions/fractionsSumsSameDenominators.js +2 -1
  11. package/lib/exercises/math/calcul/proportionality/findCoeffInProportionalTableNonIntegers.d.ts.map +1 -1
  12. package/lib/exercises/math/calcul/proportionality/findCoeffInProportionalTableNonIntegers.js +2 -1
  13. package/lib/exercises/math/calculLitteral/distributivity/doubleDistributivityWithCoeff.d.ts.map +1 -1
  14. package/lib/exercises/math/calculLitteral/distributivity/doubleDistributivityWithCoeff.js +0 -4
  15. package/lib/exercises/math/calculLitteral/distributivity/identitiesWithNonIntegers.d.ts.map +1 -1
  16. package/lib/exercises/math/calculLitteral/distributivity/identitiesWithNonIntegers.js +2 -1
  17. package/lib/exercises/math/calculLitteral/equation/equationSimpleSquare.d.ts.map +1 -1
  18. package/lib/exercises/math/calculLitteral/equation/equationSimpleSquare.js +2 -1
  19. package/lib/exercises/math/calculLitteral/factorisation/factoByX.d.ts.map +1 -1
  20. package/lib/exercises/math/calculLitteral/factorisation/factoByX.js +2 -1
  21. package/lib/exercises/math/calculLitteral/factorisation/factoIdRmq1.d.ts.map +1 -1
  22. package/lib/exercises/math/calculLitteral/factorisation/factoIdRmq1.js +2 -1
  23. package/lib/exercises/math/calculLitteral/factorisation/factoIdRmq2.d.ts.map +1 -1
  24. package/lib/exercises/math/calculLitteral/factorisation/factoIdRmq2.js +2 -1
  25. package/lib/exercises/math/calculLitteral/factorisation/factoIdRmq3.d.ts.map +1 -1
  26. package/lib/exercises/math/calculLitteral/factorisation/factoIdRmq3.js +2 -1
  27. package/lib/exercises/math/calculLitteral/factorisation/factoType1Exercise.d.ts.map +1 -1
  28. package/lib/exercises/math/calculLitteral/factorisation/factoType1Exercise.js +2 -1
  29. package/lib/exercises/math/calculLitteral/inequations/firstDegreeInequationsType0.d.ts.map +1 -1
  30. package/lib/exercises/math/calculLitteral/inequations/firstDegreeInequationsType0.js +2 -1
  31. package/lib/exercises/math/calculLitteral/inequations/firstDegreeInequationsType1.d.ts.map +1 -1
  32. package/lib/exercises/math/calculLitteral/inequations/firstDegreeInequationsType1.js +2 -1
  33. package/lib/exercises/math/calculLitteral/inequations/firstDegreeInequationsType2.d.ts.map +1 -1
  34. package/lib/exercises/math/calculLitteral/inequations/firstDegreeInequationsType2.js +2 -1
  35. package/lib/exercises/math/calculLitteral/inequations/firstDegreeInequationsType3.d.ts.map +1 -1
  36. package/lib/exercises/math/calculLitteral/inequations/firstDegreeInequationsType3.js +2 -1
  37. package/lib/exercises/math/calculLitteral/inequations/squareFunctionInequation.d.ts.map +1 -1
  38. package/lib/exercises/math/calculLitteral/inequations/squareFunctionInequation.js +2 -1
  39. package/lib/exercises/math/derivation/derivative/convexityQuadrinomials.d.ts.map +1 -1
  40. package/lib/exercises/math/derivation/derivative/convexityQuadrinomials.js +2 -1
  41. package/lib/exercises/math/derivation/derivative/expDerivativeFour.d.ts.map +1 -1
  42. package/lib/exercises/math/derivation/derivative/expDerivativeFour.js +2 -1
  43. package/lib/exercises/math/derivation/derivative/expDerivativeThree.d.ts.map +1 -1
  44. package/lib/exercises/math/derivation/derivative/expDerivativeThree.js +2 -1
  45. package/lib/exercises/math/derivation/derivative/lnDerivativeThree.d.ts.map +1 -1
  46. package/lib/exercises/math/derivation/derivative/lnDerivativeThree.js +2 -1
  47. package/lib/exercises/math/derivation/derivative/quotientDerivative.d.ts.map +1 -1
  48. package/lib/exercises/math/derivation/derivative/quotientDerivative.js +2 -1
  49. package/lib/exercises/math/derivation/derivative/rootFunctionDerivative.d.ts.map +1 -1
  50. package/lib/exercises/math/derivation/derivative/rootFunctionDerivative.js +2 -1
  51. package/lib/exercises/math/derivation/derivative/sqrtCompositionDerivation.d.ts.map +1 -1
  52. package/lib/exercises/math/derivation/derivative/sqrtCompositionDerivation.js +2 -1
  53. package/lib/exercises/math/derivation/derivative/thirdDegreeDerivative.d.ts.map +1 -1
  54. package/lib/exercises/math/derivation/derivative/thirdDegreeDerivative.js +2 -1
  55. package/lib/exercises/math/derivation/derivative/thirdDegreeFunctionVariation.d.ts.map +1 -1
  56. package/lib/exercises/math/derivation/derivative/thirdDegreeFunctionVariation.js +2 -1
  57. package/lib/exercises/math/functions/absolute/absolueValueAffineEquation.d.ts.map +1 -1
  58. package/lib/exercises/math/functions/absolute/absolueValueAffineEquation.js +2 -1
  59. package/lib/exercises/math/functions/absolute/absolueValueInequationsSup.d.ts.map +1 -1
  60. package/lib/exercises/math/functions/absolute/absolueValueInequationsSup.js +2 -1
  61. package/lib/exercises/math/functions/absolute/absoluteValueInequations.d.ts.map +1 -1
  62. package/lib/exercises/math/functions/absolute/absoluteValueInequations.js +2 -1
  63. package/lib/exercises/math/functions/affines/affineExpressionFromTwoImages.d.ts.map +1 -1
  64. package/lib/exercises/math/functions/affines/affineExpressionFromTwoImages.js +2 -1
  65. package/lib/exercises/math/functions/affines/affineExpressionReading.d.ts.map +1 -1
  66. package/lib/exercises/math/functions/affines/affineExpressionReading.js +2 -1
  67. package/lib/exercises/math/functions/affines/signFunction.d.ts.map +1 -1
  68. package/lib/exercises/math/functions/affines/signFunction.js +2 -1
  69. package/lib/exercises/math/functions/basics/graphicEquation.d.ts.map +1 -1
  70. package/lib/exercises/math/functions/basics/graphicEquation.js +2 -1
  71. package/lib/exercises/math/functions/basics/graphicInequation.d.ts.map +1 -1
  72. package/lib/exercises/math/functions/basics/graphicInequation.js +2 -1
  73. package/lib/exercises/math/functions/basics/graphicInequationAffine.d.ts.map +1 -1
  74. package/lib/exercises/math/functions/basics/graphicInequationAffine.js +2 -1
  75. package/lib/exercises/math/functions/basics/imageFunction.d.ts.map +1 -1
  76. package/lib/exercises/math/functions/basics/imageFunction.js +2 -1
  77. package/lib/exercises/math/functions/basics/twoFunctionsInequation.d.ts.map +1 -1
  78. package/lib/exercises/math/functions/basics/twoFunctionsInequation.js +2 -1
  79. package/lib/exercises/math/functions/exponential/expEquation.d.ts.map +1 -1
  80. package/lib/exercises/math/functions/exponential/expEquation.js +2 -1
  81. package/lib/exercises/math/functions/logarithm/logPowerEquation.d.ts.map +1 -1
  82. package/lib/exercises/math/functions/logarithm/logPowerEquation.js +2 -1
  83. package/lib/exercises/math/functions/sign/affineProductSign.d.ts.map +1 -1
  84. package/lib/exercises/math/functions/sign/affineProductSign.js +2 -1
  85. package/lib/exercises/math/functions/square/squareImageInterval.d.ts.map +1 -1
  86. package/lib/exercises/math/functions/square/squareImageInterval.js +2 -1
  87. package/lib/exercises/math/functions/trinoms/coefficientsIdentification.d.ts.map +1 -1
  88. package/lib/exercises/math/functions/trinoms/coefficientsIdentification.js +2 -1
  89. package/lib/exercises/math/functions/trinoms/secondDegreeInequation.d.ts.map +1 -1
  90. package/lib/exercises/math/functions/trinoms/secondDegreeInequation.js +2 -1
  91. package/lib/exercises/math/functions/trinoms/trinomSignFromRoots.d.ts.map +1 -1
  92. package/lib/exercises/math/functions/trinoms/trinomSignFromRoots.js +2 -1
  93. package/lib/exercises/math/geometry/cartesian/readAbscissOnLine.d.ts.map +1 -1
  94. package/lib/exercises/math/geometry/cartesian/readAbscissOnLine.js +2 -1
  95. package/lib/exercises/math/geometry/cartesian/readAbscissOnSemiLine.d.ts.map +1 -1
  96. package/lib/exercises/math/geometry/cartesian/readAbscissOnSemiLine.js +2 -1
  97. package/lib/exercises/math/geometry/convexity/convexityQuadrinomialsGeo.d.ts.map +1 -1
  98. package/lib/exercises/math/geometry/convexity/convexityQuadrinomialsGeo.js +2 -1
  99. package/lib/exercises/math/geometry/parametric/extractPointFromParametricLine.d.ts.map +1 -1
  100. package/lib/exercises/math/geometry/parametric/extractPointFromParametricLine.js +2 -1
  101. package/lib/exercises/math/geometry/parametric/extractVectorFromParametricLine.d.ts.map +1 -1
  102. package/lib/exercises/math/geometry/parametric/extractVectorFromParametricLine.js +2 -1
  103. package/lib/exercises/math/matrices/matrixInversibilityDomain.d.ts.map +1 -1
  104. package/lib/exercises/math/matrices/matrixInversibilityDomain.js +2 -1
  105. package/lib/exercises/math/percent/index.d.ts +1 -0
  106. package/lib/exercises/math/percent/index.d.ts.map +1 -1
  107. package/lib/exercises/math/percent/index.js +1 -1
  108. package/lib/exercises/math/percent/percentWritings.d.ts.map +1 -1
  109. package/lib/exercises/math/percent/percentWritings.js +10 -1
  110. package/lib/exercises/math/powers/powersMixOperations.d.ts.map +1 -1
  111. package/lib/exercises/math/powers/powersMixOperations.js +2 -1
  112. package/lib/exercises/math/probaStat/probabilityTree.d.ts.map +1 -1
  113. package/lib/exercises/math/probaStat/probabilityTree.js +2 -1
  114. package/lib/exercises/math/sampling/confidenceInterval.d.ts.map +1 -1
  115. package/lib/exercises/math/sampling/confidenceInterval.js +2 -1
  116. package/lib/exercises/math/sampling/fluctuationInterval.d.ts.map +1 -1
  117. package/lib/exercises/math/sampling/fluctuationInterval.js +2 -1
  118. package/lib/exercises/math/sequences/geometric/geometricExplicitFormulaUsage.d.ts.map +1 -1
  119. package/lib/exercises/math/sequences/geometric/geometricExplicitFormulaUsage.js +2 -1
  120. package/lib/exercises/math/sets/intervals/inequalityToInterval.d.ts.map +1 -1
  121. package/lib/exercises/math/sets/intervals/inequalityToInterval.js +2 -1
  122. package/lib/exercises/math/sets/intervals/intervalsIntersection.d.ts.map +1 -1
  123. package/lib/exercises/math/sets/intervals/intervalsIntersection.js +2 -1
  124. package/lib/exercises/math/sets/intervals/intervalsUnion.d.ts.map +1 -1
  125. package/lib/exercises/math/sets/intervals/intervalsUnion.js +2 -1
  126. package/lib/exercises/math/trigonometry/degreeToRadians.d.ts.map +1 -1
  127. package/lib/exercises/math/trigonometry/degreeToRadians.js +2 -1
  128. package/lib/exercises/math/trigonometry/mainAngleMeasure.d.ts.map +1 -1
  129. package/lib/exercises/math/trigonometry/mainAngleMeasure.js +2 -1
  130. package/lib/exercises/vea/equationVEA.d.ts.map +1 -1
  131. package/lib/exercises/vea/equationVEA.js +2 -1
  132. package/lib/exercises/vea/rationalVEA.d.ts.map +1 -1
  133. package/lib/exercises/vea/rationalVEA.js +2 -1
  134. package/lib/exercises/vea/sqrtVEA.d.ts.map +1 -1
  135. package/lib/exercises/vea/sqrtVEA.js +2 -1
  136. package/lib/index.d.ts +3 -0
  137. package/lib/index.d.ts.map +1 -1
  138. package/lib/tree/nodes/operators/addNode.d.ts.map +1 -1
  139. package/lib/tree/nodes/operators/addNode.js +1 -1
  140. package/lib/tree/nodes/operators/fractionNode.d.ts.map +1 -1
  141. package/lib/tree/nodes/operators/fractionNode.js +1 -1
  142. package/lib/tree/nodes/operators/multiplyNode.d.ts.map +1 -1
  143. package/lib/tree/nodes/operators/multiplyNode.js +1 -1
  144. package/lib/tree/parsers/affineParser.d.ts.map +1 -1
  145. package/lib/tree/parsers/affineParser.js +2 -1
  146. package/lib/tree/parsers/discreteSetParser.d.ts.map +1 -1
  147. package/lib/tree/parsers/discreteSetParser.js +2 -1
  148. package/lib/tree/parsers/equationSolutionParser.d.ts.map +1 -1
  149. package/lib/tree/parsers/equationSolutionParser.js +2 -1
  150. package/lib/tree/parsers/inequationParser.d.ts.map +1 -1
  151. package/lib/tree/parsers/inequationParser.js +2 -1
  152. package/lib/tree/parsers/intervalParser.d.ts.map +1 -1
  153. package/lib/tree/parsers/intervalParser.js +3 -2
  154. package/lib/tree/parsers/latexParser.js +3 -3
  155. package/lib/tree/parsers/monomParser.d.ts.map +1 -1
  156. package/lib/tree/parsers/monomParser.js +2 -1
  157. package/lib/tree/parsers/polynomialParser.d.ts.map +1 -1
  158. package/lib/tree/parsers/polynomialParser.js +2 -1
  159. package/lib/tree/parsers/powerParser.d.ts.map +1 -1
  160. package/lib/tree/parsers/powerParser.js +2 -1
  161. package/lib/tree/parsers/sqrtParser.d.ts.map +1 -1
  162. package/lib/tree/parsers/sqrtParser.js +2 -1
  163. package/lib/tree/parsers/trinomParser.d.ts.map +1 -1
  164. package/lib/tree/parsers/trinomParser.js +2 -1
  165. package/lib/tree/parsers/unionIntervalParser.d.ts.map +1 -1
  166. package/lib/tree/parsers/unionIntervalParser.js +2 -1
  167. package/lib/utils/alea/random.js +1 -1
  168. package/lib/utils/errors/handleVEAError.d.ts +2 -0
  169. package/lib/utils/errors/handleVEAError.d.ts.map +1 -0
  170. package/lib/utils/errors/handleVEAError.js +9 -0
  171. package/package.json +1 -1
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.equationSolutionParser = void 0;
4
+ const handleVEAError_1 = require("../../utils/errors/handleVEAError");
4
5
  const algebraicNode_1 = require("../nodes/algebraicNode");
5
6
  const equalNode_1 = require("../nodes/equations/equalNode");
6
7
  const variableNode_1 = require("../nodes/variables/variableNode");
@@ -34,7 +35,7 @@ const equationSolutionParser = (str, variable = "x") => {
34
35
  }
35
36
  }
36
37
  catch (err) {
37
- return false;
38
+ return (0, handleVEAError_1.handleVEAError)(err);
38
39
  }
39
40
  };
40
41
  exports.equationSolutionParser = equationSolutionParser;
@@ -1 +1 @@
1
- {"version":3,"file":"inequationParser.d.ts","sourceRoot":"","sources":["../../../src/tree/parsers/inequationParser.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AAGrE,KAAK,IAAI,GAAG;IACV,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,eAAO,MAAM,gBAAgB,QAAS,MAAM,SAAS,IAAI,2BAyBxD,CAAC"}
1
+ {"version":3,"file":"inequationParser.d.ts","sourceRoot":"","sources":["../../../src/tree/parsers/inequationParser.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AAGrE,KAAK,IAAI,GAAG;IACV,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,eAAO,MAAM,gBAAgB,QAAS,MAAM,SAAS,IAAI,2BAyBxD,CAAC"}
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.inequationParser = void 0;
4
+ const handleVEAError_1 = require("../../utils/errors/handleVEAError");
4
5
  const inequationNode_1 = require("../nodes/inequations/inequationNode");
5
6
  const latexParser_1 = require("./latexParser");
6
7
  const inequationParser = (ans, opts) => {
@@ -24,7 +25,7 @@ const inequationParser = (ans, opts) => {
24
25
  return new inequationNode_1.InequationNode([...children], ineqType[0]);
25
26
  }
26
27
  catch (err) {
27
- return false;
28
+ return (0, handleVEAError_1.handleVEAError)(err);
28
29
  }
29
30
  };
30
31
  exports.inequationParser = inequationParser;
@@ -1 +1 @@
1
- {"version":3,"file":"intervalParser.d.ts","sourceRoot":"","sources":["../../../src/tree/parsers/intervalParser.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAG1D,KAAK,IAAI,GAAG;IACV,4BAA4B,CAAC,EAAE,OAAO,CAAC;IACvC,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,CAAC;AACF,eAAO,MAAM,cAAc,QAAS,MAAM,SAAS,IAAI,yBA8CtD,CAAC"}
1
+ {"version":3,"file":"intervalParser.d.ts","sourceRoot":"","sources":["../../../src/tree/parsers/intervalParser.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAG1D,KAAK,IAAI,GAAG;IACV,4BAA4B,CAAC,EAAE,OAAO,CAAC;IACvC,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,CAAC;AACF,eAAO,MAAM,cAAc,QAAS,MAAM,SAAS,IAAI,yBA8CtD,CAAC"}
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.intervalParser = void 0;
4
+ const handleVEAError_1 = require("../../utils/errors/handleVEAError");
4
5
  const closure_1 = require("../nodes/sets/closure");
5
6
  const intervalNode_1 = require("../nodes/sets/intervalNode");
6
7
  const latexParser_1 = require("./latexParser");
@@ -37,8 +38,8 @@ const intervalParser = (ans, opts) => {
37
38
  return false;
38
39
  return new intervalNode_1.IntervalNode(aParsed, bParsed, closure_1.Closure.fromBrackets(leftBracket, rightBracket));
39
40
  }
40
- catch (e) {
41
- return false;
41
+ catch (err) {
42
+ return (0, handleVEAError_1.handleVEAError)(err);
42
43
  }
43
44
  };
44
45
  exports.intervalParser = intervalParser;
@@ -45,7 +45,7 @@ const isDyck = (tokens) => {
45
45
  while (brackets.length) {
46
46
  counter++;
47
47
  if (counter > 1000)
48
- throw Error("Too many iterations");
48
+ throw Error("should-throw Too many iterations");
49
49
  const rightIndex = brackets.findIndex((el) => el == ")");
50
50
  if (rightIndex === -1 || rightIndex === 0)
51
51
  return false;
@@ -214,14 +214,14 @@ const buildTree = (tokens) => {
214
214
  while (true) {
215
215
  counter++;
216
216
  if (counter > 1000)
217
- throw Error("Too many iterations");
217
+ throw Error("should-throw Too many iterations");
218
218
  if (maxDepth === 0) {
219
219
  const tree = buildTreeForSameDepthTokens(depthedTokens.map((el) => el.token));
220
220
  return tree;
221
221
  }
222
222
  for (let i = 0; i < depthedTokens.length; i++) {
223
223
  if (i > 1000)
224
- throw Error("Too many iterations");
224
+ throw Error("should-throw Too many iterations");
225
225
  const token = depthedTokens[i];
226
226
  //? on commence par les tokens de depth max
227
227
  if (token.depth < maxDepth)
@@ -1 +1 @@
1
- {"version":3,"file":"monomParser.d.ts","sourceRoot":"","sources":["../../../src/tree/parsers/monomParser.ts"],"names":[],"mappings":"AAGA,KAAK,IAAI,GAAG;IACV,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AACF,eAAO,MAAM,WAAW,QACjB,MAAM,uCACyB,IAAI,2DAiBzC,CAAC"}
1
+ {"version":3,"file":"monomParser.d.ts","sourceRoot":"","sources":["../../../src/tree/parsers/monomParser.ts"],"names":[],"mappings":"AAIA,KAAK,IAAI,GAAG;IACV,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AACF,eAAO,MAAM,WAAW,QACjB,MAAM,uCACyB,IAAI,2DAiBzC,CAAC"}
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.monomParser = void 0;
4
+ const handleVEAError_1 = require("../../utils/errors/handleVEAError");
4
5
  const monomNode_1 = require("../nodes/polynomials/monomNode");
5
6
  const latexParser_1 = require("./latexParser");
6
7
  const monomParser = (str, { variable, maxDegree, minDegree } = {
@@ -18,7 +19,7 @@ const monomParser = (str, { variable, maxDegree, minDegree } = {
18
19
  // } else return false;
19
20
  }
20
21
  catch (err) {
21
- return false;
22
+ return (0, handleVEAError_1.handleVEAError)(err);
22
23
  }
23
24
  };
24
25
  exports.monomParser = monomParser;
@@ -1 +1 @@
1
- {"version":3,"file":"polynomialParser.d.ts","sourceRoot":"","sources":["../../../src/tree/parsers/polynomialParser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAWvD,eAAO,MAAM,gBAAgB,QAAS,MAAM,8OAmC3C,CAAC"}
1
+ {"version":3,"file":"polynomialParser.d.ts","sourceRoot":"","sources":["../../../src/tree/parsers/polynomialParser.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAWvD,eAAO,MAAM,gBAAgB,QAAS,MAAM,8OAmC3C,CAAC"}
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.polynomialParser = void 0;
4
+ const handleVEAError_1 = require("../../utils/errors/handleVEAError");
4
5
  const oppositeNode_1 = require("../nodes/functions/oppositeNode");
5
6
  const addNode_1 = require("../nodes/operators/addNode");
6
7
  const substractNode_1 = require("../nodes/operators/substractNode");
@@ -45,7 +46,7 @@ const polynomialParser = (ans) => {
45
46
  return false;
46
47
  }
47
48
  catch (err) {
48
- return false;
49
+ return (0, handleVEAError_1.handleVEAError)(err);
49
50
  }
50
51
  };
51
52
  exports.polynomialParser = polynomialParser;
@@ -1 +1 @@
1
- {"version":3,"file":"powerParser.d.ts","sourceRoot":"","sources":["../../../src/tree/parsers/powerParser.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,WAAW,QAAS,MAAM,uKAgBtC,CAAC"}
1
+ {"version":3,"file":"powerParser.d.ts","sourceRoot":"","sources":["../../../src/tree/parsers/powerParser.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,WAAW,QAAS,MAAM,uKAgBtC,CAAC"}
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.powerParser = void 0;
4
+ const handleVEAError_1 = require("../../utils/errors/handleVEAError");
4
5
  const sqrtNode_1 = require("../nodes/functions/sqrtNode");
5
6
  const numberNode_1 = require("../nodes/numbers/numberNode");
6
7
  const fractionNode_1 = require("../nodes/operators/fractionNode");
@@ -21,7 +22,7 @@ const powerParser = (ans) => {
21
22
  return false;
22
23
  }
23
24
  catch (err) {
24
- return false;
25
+ return (0, handleVEAError_1.handleVEAError)(err);
25
26
  }
26
27
  };
27
28
  exports.powerParser = powerParser;
@@ -1 +1 @@
1
- {"version":3,"file":"sqrtParser.d.ts","sourceRoot":"","sources":["../../../src/tree/parsers/sqrtParser.ts"],"names":[],"mappings":"AAeA;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,QAAS,MAAM,uUAuCrC,CAAC"}
1
+ {"version":3,"file":"sqrtParser.d.ts","sourceRoot":"","sources":["../../../src/tree/parsers/sqrtParser.ts"],"names":[],"mappings":"AAgBA;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,QAAS,MAAM,uUAuCrC,CAAC"}
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.sqrtParser = void 0;
4
+ const handleVEAError_1 = require("../../utils/errors/handleVEAError");
4
5
  const oppositeNode_1 = require("../nodes/functions/oppositeNode");
5
6
  const sqrtNode_1 = require("../nodes/functions/sqrtNode");
6
7
  const numberNode_1 = require("../nodes/numbers/numberNode");
@@ -46,7 +47,7 @@ const sqrtParser = (ans) => {
46
47
  return false;
47
48
  }
48
49
  catch (err) {
49
- return false;
50
+ return (0, handleVEAError_1.handleVEAError)(err);
50
51
  }
51
52
  };
52
53
  exports.sqrtParser = sqrtParser;
@@ -1 +1 @@
1
- {"version":3,"file":"trinomParser.d.ts","sourceRoot":"","sources":["../../../src/tree/parsers/trinomParser.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,YAAY,QAAS,MAAM,aAAY,MAAM,uEAgCzD,CAAC"}
1
+ {"version":3,"file":"trinomParser.d.ts","sourceRoot":"","sources":["../../../src/tree/parsers/trinomParser.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,YAAY,QAAS,MAAM,aAAY,MAAM,uEAgCzD,CAAC"}
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.trinomParser = void 0;
4
+ const handleVEAError_1 = require("../../utils/errors/handleVEAError");
4
5
  const addNode_1 = require("../nodes/operators/addNode");
5
6
  const substractNode_1 = require("../nodes/operators/substractNode");
6
7
  const monomNode_1 = require("../nodes/polynomials/monomNode");
@@ -37,7 +38,7 @@ const trinomParser = (ans, variable = "x") => {
37
38
  // return false;
38
39
  }
39
40
  catch (err) {
40
- return false;
41
+ return (0, handleVEAError_1.handleVEAError)(err);
41
42
  }
42
43
  };
43
44
  exports.trinomParser = trinomParser;
@@ -1 +1 @@
1
- {"version":3,"file":"unionIntervalParser.d.ts","sourceRoot":"","sources":["../../../src/tree/parsers/unionIntervalParser.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAIpE,KAAK,IAAI,GAAG;IACV,4BAA4B,CAAC,EAAE,OAAO,CAAC;IACvC,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,CAAC;AACF,eAAO,MAAM,mBAAmB,QAAS,MAAM,SAAS,IAAI,6CAmB3D,CAAC"}
1
+ {"version":3,"file":"unionIntervalParser.d.ts","sourceRoot":"","sources":["../../../src/tree/parsers/unionIntervalParser.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAIpE,KAAK,IAAI,GAAG;IACV,4BAA4B,CAAC,EAAE,OAAO,CAAC;IACvC,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,CAAC;AACF,eAAO,MAAM,mBAAmB,QAAS,MAAM,SAAS,IAAI,6CAmB3D,CAAC"}
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.unionIntervalParser = void 0;
4
+ const handleVEAError_1 = require("../../utils/errors/handleVEAError");
4
5
  const unionIntervalNode_1 = require("../nodes/sets/unionIntervalNode");
5
6
  const intervalParser_1 = require("./intervalParser");
6
7
  const unionIntervalParser = (ans, opts) => {
@@ -22,7 +23,7 @@ const unionIntervalParser = (ans, opts) => {
22
23
  }));
23
24
  }
24
25
  catch (err) {
25
- return false;
26
+ return (0, handleVEAError_1.handleVEAError)(err);
26
27
  }
27
28
  };
28
29
  exports.unionIntervalParser = unionIntervalParser;
@@ -14,7 +14,7 @@ function randomMany(array, count, excludes) {
14
14
  let i = 0;
15
15
  while (res.length < count) {
16
16
  if (i > 10000)
17
- throw new Error("randomMany malformed");
17
+ throw new Error("should-throw randomMany malformed");
18
18
  i++;
19
19
  res.push(random(array, [...res, ...(excludes ?? [])]));
20
20
  }
@@ -0,0 +1,2 @@
1
+ export declare const handleVEAError: (err: any) => false;
2
+ //# sourceMappingURL=handleVEAError.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"handleVEAError.d.ts","sourceRoot":"","sources":["../../../src/utils/errors/handleVEAError.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc,QAAS,GAAG,KAAG,KAGzC,CAAC"}
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.handleVEAError = void 0;
4
+ const handleVEAError = (err) => {
5
+ if (err.message.includes("should-throw"))
6
+ throw err;
7
+ return false;
8
+ };
9
+ exports.handleVEAError = handleVEAError;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "math-exercises",
3
- "version": "2.2.94",
3
+ "version": "2.2.95",
4
4
  "description": "Math exercises generator for middle school and high school",
5
5
  "main": "lib/index.js",
6
6
  "files": [