@algoux/standard-ranklist-utils 0.2.4 → 0.2.5

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/dist/index.cjs CHANGED
@@ -575,7 +575,7 @@ function genSeriesCalcFns(series, rows, ranks, officialRanks) {
575
575
  if (options.ratio) {
576
576
  const { value, rounding = "ceil", denominator = "all" } = options.ratio;
577
577
  const officialRows = filteredRows;
578
- let total = denominator === "submitted" ? officialRows.filter((row) => !row.statuses.every((s) => s.result === null)).length : officialRows.length;
578
+ let total = denominator === "submitted" ? officialRows.filter((row) => !row.statuses.every((s) => s.result === null)).length : denominator === "scored" ? officialRows.filter((row) => row.score.value > 0).length : officialRows.length;
579
579
  const accValues = [];
580
580
  for (let i = 0; i < value.length; i++) {
581
581
  if (i === 0) {
package/dist/index.mjs CHANGED
@@ -573,7 +573,7 @@ function genSeriesCalcFns(series, rows, ranks, officialRanks) {
573
573
  if (options.ratio) {
574
574
  const { value, rounding = "ceil", denominator = "all" } = options.ratio;
575
575
  const officialRows = filteredRows;
576
- let total = denominator === "submitted" ? officialRows.filter((row) => !row.statuses.every((s) => s.result === null)).length : officialRows.length;
576
+ let total = denominator === "submitted" ? officialRows.filter((row) => !row.statuses.every((s) => s.result === null)).length : denominator === "scored" ? officialRows.filter((row) => row.score.value > 0).length : officialRows.length;
577
577
  const accValues = [];
578
578
  for (let i = 0; i < value.length; i++) {
579
579
  if (i === 0) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@algoux/standard-ranklist-utils",
3
- "version": "0.2.4",
3
+ "version": "0.2.5",
4
4
  "author": "bLue",
5
5
  "keywords": [
6
6
  "standard ranklist",
@@ -25,7 +25,8 @@
25
25
  ],
26
26
  "scripts": {
27
27
  "dev": "tsx src/index.ts",
28
- "build": "pkgroll"
28
+ "build": "pkgroll",
29
+ "prepublishOnly": "npm run build"
29
30
  },
30
31
  "dependencies": {
31
32
  "@types/semver": "^7.5.0",
@@ -35,7 +36,7 @@
35
36
  "textcolor": "^1.0.2"
36
37
  },
37
38
  "devDependencies": {
38
- "@algoux/standard-ranklist": "^0.3.7",
39
+ "@algoux/standard-ranklist": "^0.3.8",
39
40
  "@types/node": "^16.18.38",
40
41
  "@typescript-eslint/eslint-plugin": "^5.61.0",
41
42
  "@typescript-eslint/parser": "^5.61.0",