@dra2020/district-analytics 5.6.1 → 5.6.2

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.
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2019 Alec Ramsay
3
+ Copyright (c) 2020 Alec Ramsay
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/dist/cli.js CHANGED
@@ -89912,7 +89912,7 @@ function scoreCompetitiveness(rawMarginal, rawOverall) {
89912
89912
  const mcW = C.marginalCompetitivenessWeight();
89913
89913
  const ocW = C.overallCompetitivenessWeight();
89914
89914
  // Then combine the results
89915
- const score = Math.round(((mcW * mcS) + (ocW * ocS)) / (mcW + ocW));
89915
+ const score = ((mcW + ocW) > 0) ? Math.round(((mcW * mcS) + (ocW * ocS)) / (mcW + ocW)) : 0;
89916
89916
  return score;
89917
89917
  }
89918
89918
  exports.scoreCompetitiveness = scoreCompetitiveness;