bruce-models 1.1.1 → 1.1.3

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.
@@ -1697,8 +1697,8 @@
1697
1697
  return [];
1698
1698
  }
1699
1699
  if (path.startsWith("${") && path.endsWith("}")) {
1700
- path.replace("${", "");
1701
- path.replace("}", "");
1700
+ path = path.replace("${", "");
1701
+ path = path.replace("}", "");
1702
1702
  return exports.PathUtils.ParseLegacy(path);
1703
1703
  }
1704
1704
  return exports.PathUtils.Parse(path);
@@ -1822,31 +1822,40 @@
1822
1822
  Calculator.GetColor = GetColor;
1823
1823
  function GetMappingValue(value, entity) {
1824
1824
  const attrPath = parseLegacyPath(value.field);
1825
- const eValue = +exports.Entity.GetValue(entity, attrPath);
1825
+ const eValue = exports.Entity.GetValue(entity, attrPath);
1826
+ const isValueNum = !isNaN(+eValue);
1826
1827
  for (let i = 0; i < value.values.length; i++) {
1827
1828
  const option = value.values[i];
1828
1829
  const mapValue = option.fieldValue;
1829
- if (+mapValue == eValue) {
1830
- return option.appliedValue;
1831
- }
1832
- const mapSplit = mapValue.split("-");
1833
- if (mapSplit.length == 2) {
1834
- const min = mapSplit[0];
1835
- const max = mapSplit[1];
1836
- if (min != "") {
1837
- if (eValue < +min) {
1838
- continue;
1839
- }
1830
+ const isMapValueNum = !isNaN(+mapValue);
1831
+ if (isValueNum && isMapValueNum) {
1832
+ if (+mapValue == +eValue) {
1833
+ return option.appliedValue;
1840
1834
  }
1841
- if (max != "") {
1842
- if (eValue > +max) {
1835
+ const mapSplit = mapValue.split("-");
1836
+ if (mapSplit.length == 2) {
1837
+ const min = mapSplit[0];
1838
+ const max = mapSplit[1];
1839
+ if (min != "") {
1840
+ if (+eValue < +min) {
1841
+ continue;
1842
+ }
1843
+ }
1844
+ if (max != "") {
1845
+ if (+eValue > +max) {
1846
+ continue;
1847
+ }
1848
+ }
1849
+ if (min == "" && max == "") {
1843
1850
  continue;
1844
1851
  }
1852
+ return option.appliedValue;
1845
1853
  }
1846
- if (min == "" && max == "") {
1847
- continue;
1854
+ }
1855
+ else {
1856
+ if (mapValue == eValue) {
1857
+ return option.appliedValue;
1848
1858
  }
1849
- return option.appliedValue;
1850
1859
  }
1851
1860
  }
1852
1861
  return null;