@iblai/iblai-js 2.35.1 → 2.36.1

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.
@@ -150901,14 +150901,16 @@ const normalizeContentId = (id) => {
150901
150901
  return id;
150902
150902
  }
150903
150903
  };
150904
- const fractionToPct = (fraction) => Math.round((fraction !== null && fraction !== void 0 ? fraction : 0) * 100);
150904
+ // Strips binary floating-point noise (e.g. 0.07 * 100 = 7.000000000000001) without rounding the value.
150905
+ const stripFloatNoise = (value) => Number.parseFloat(value.toPrecision(12));
150906
+ const fractionToPct = (fraction) => stripFloatNoise((fraction !== null && fraction !== void 0 ? fraction : 0) * 100);
150905
150907
  const getPassingPct = (gradeRange) => {
150906
150908
  if (!gradeRange)
150907
150909
  return 0;
150908
150910
  if (typeof gradeRange.Pass === 'number')
150909
- return Math.round(gradeRange.Pass * 100);
150911
+ return fractionToPct(gradeRange.Pass);
150910
150912
  const cutoffs = Object.values(gradeRange).filter((value) => typeof value === 'number' && value > 0);
150911
- return cutoffs.length ? Math.round(Math.min(...cutoffs) * 100) : 0;
150913
+ return cutoffs.length ? fractionToPct(Math.min(...cutoffs)) : 0;
150912
150914
  };
150913
150915
  const buildGradeSummary = (edx) => {
150914
150916
  var _a, _b, _c, _d, _e, _f;
@@ -150941,9 +150943,9 @@ const buildGradeSummary = (edx) => {
150941
150943
  }
150942
150944
  return {
150943
150945
  type: policy.type,
150944
- weightPct: Math.round(policy.weight * 100),
150945
- gradePct: Math.round(gradeFraction * 100),
150946
- weightedGradePct: Math.round(gradeFraction * policy.weight * 100),
150946
+ weightPct: fractionToPct(policy.weight),
150947
+ gradePct: fractionToPct(gradeFraction),
150948
+ weightedGradePct: fractionToPct(gradeFraction * policy.weight),
150947
150949
  footnote,
150948
150950
  };
150949
150951
  });
@@ -183588,14 +183588,16 @@ const normalizeContentId = (id) => {
183588
183588
  return id;
183589
183589
  }
183590
183590
  };
183591
- const fractionToPct = (fraction) => Math.round((fraction !== null && fraction !== void 0 ? fraction : 0) * 100);
183591
+ // Strips binary floating-point noise (e.g. 0.07 * 100 = 7.000000000000001) without rounding the value.
183592
+ const stripFloatNoise = (value) => Number.parseFloat(value.toPrecision(12));
183593
+ const fractionToPct = (fraction) => stripFloatNoise((fraction !== null && fraction !== void 0 ? fraction : 0) * 100);
183592
183594
  const getPassingPct = (gradeRange) => {
183593
183595
  if (!gradeRange)
183594
183596
  return 0;
183595
183597
  if (typeof gradeRange.Pass === 'number')
183596
- return Math.round(gradeRange.Pass * 100);
183598
+ return fractionToPct(gradeRange.Pass);
183597
183599
  const cutoffs = Object.values(gradeRange).filter((value) => typeof value === 'number' && value > 0);
183598
- return cutoffs.length ? Math.round(Math.min(...cutoffs) * 100) : 0;
183600
+ return cutoffs.length ? fractionToPct(Math.min(...cutoffs)) : 0;
183599
183601
  };
183600
183602
  const buildGradeSummary = (edx) => {
183601
183603
  var _a, _b, _c, _d, _e, _f;
@@ -183628,9 +183630,9 @@ const buildGradeSummary = (edx) => {
183628
183630
  }
183629
183631
  return {
183630
183632
  type: policy.type,
183631
- weightPct: Math.round(policy.weight * 100),
183632
- gradePct: Math.round(gradeFraction * 100),
183633
- weightedGradePct: Math.round(gradeFraction * policy.weight * 100),
183633
+ weightPct: fractionToPct(policy.weight),
183634
+ gradePct: fractionToPct(gradeFraction),
183635
+ weightedGradePct: fractionToPct(gradeFraction * policy.weight),
183634
183636
  footnote,
183635
183637
  };
183636
183638
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iblai/iblai-js",
3
- "version": "2.35.1",
3
+ "version": "2.36.1",
4
4
  "description": "Unified JavaScript SDK for IBL.ai — re-exports data-layer, web-containers, and web-utils under a single package",
5
5
  "type": "module",
6
6
  "engines": {
@@ -78,8 +78,8 @@
78
78
  "winston": "3.19.0",
79
79
  "@iblai/data-layer": "1.30.0",
80
80
  "@iblai/mcp": "1.29.0",
81
- "@iblai/web-containers": "1.40.0",
82
- "@iblai/web-utils": "2.7.1"
81
+ "@iblai/web-containers": "1.41.0",
82
+ "@iblai/web-utils": "2.8.0"
83
83
  },
84
84
  "peerDependencies": {
85
85
  "@iblai/iblai-api": "4.166.0-ai",