fig-tree-evaluator 2.1.5 → 2.1.6

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 (2) hide show
  1. package/build/helpers.js +2 -1
  2. package/package.json +1 -1
package/build/helpers.js CHANGED
@@ -100,7 +100,8 @@ exports.errorMessage = errorMessage;
100
100
  const extractNumber = (input) => {
101
101
  if (typeof input !== 'string')
102
102
  return Number.isNaN(Number(input)) ? input : Number(input);
103
- const numberMatch = input.match(/(-?(\d+\.\d+))|(-?((?<!\.)\.\d+))|(-?\d+)/gm);
103
+ const pattern = new RegExp(/-?\d*\.?\d+/gm);
104
+ const numberMatch = input.match(pattern);
104
105
  if (!numberMatch)
105
106
  return 0;
106
107
  return Number(numberMatch[0]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fig-tree-evaluator",
3
- "version": "2.1.5",
3
+ "version": "2.1.6",
4
4
  "description": "Module to evaluate JSON-structured expression trees",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",