bruce-models 1.1.2 → 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.
@@ -1863,31 +1863,40 @@ var Calculator;
1863
1863
  Calculator.GetColor = GetColor;
1864
1864
  function GetMappingValue(value, entity) {
1865
1865
  const attrPath = parseLegacyPath(value.field);
1866
- const eValue = +Entity.GetValue(entity, attrPath);
1866
+ const eValue = Entity.GetValue(entity, attrPath);
1867
+ const isValueNum = !isNaN(+eValue);
1867
1868
  for (let i = 0; i < value.values.length; i++) {
1868
1869
  const option = value.values[i];
1869
1870
  const mapValue = option.fieldValue;
1870
- if (+mapValue == eValue) {
1871
- return option.appliedValue;
1872
- }
1873
- const mapSplit = mapValue.split("-");
1874
- if (mapSplit.length == 2) {
1875
- const min = mapSplit[0];
1876
- const max = mapSplit[1];
1877
- if (min != "") {
1878
- if (eValue < +min) {
1879
- continue;
1880
- }
1871
+ const isMapValueNum = !isNaN(+mapValue);
1872
+ if (isValueNum && isMapValueNum) {
1873
+ if (+mapValue == +eValue) {
1874
+ return option.appliedValue;
1881
1875
  }
1882
- if (max != "") {
1883
- if (eValue > +max) {
1876
+ const mapSplit = mapValue.split("-");
1877
+ if (mapSplit.length == 2) {
1878
+ const min = mapSplit[0];
1879
+ const max = mapSplit[1];
1880
+ if (min != "") {
1881
+ if (+eValue < +min) {
1882
+ continue;
1883
+ }
1884
+ }
1885
+ if (max != "") {
1886
+ if (+eValue > +max) {
1887
+ continue;
1888
+ }
1889
+ }
1890
+ if (min == "" && max == "") {
1884
1891
  continue;
1885
1892
  }
1893
+ return option.appliedValue;
1886
1894
  }
1887
- if (min == "" && max == "") {
1888
- continue;
1895
+ }
1896
+ else {
1897
+ if (mapValue == eValue) {
1898
+ return option.appliedValue;
1889
1899
  }
1890
- return option.appliedValue;
1891
1900
  }
1892
1901
  }
1893
1902
  return null;