From 8420ab628bac36db0f39c529ca356ea43b64a911 Mon Sep 17 00:00:00 2001 From: seebees Date: Mon, 21 Nov 2022 08:52:42 -0800 Subject: [PATCH] update file name --- www/src/App.js | 2 +- www/src/result.js | 2 +- www/src/stats_class.js | 46 ------------------------------------------ 3 files changed, 2 insertions(+), 48 deletions(-) delete mode 100644 www/src/stats_class.js diff --git a/www/src/App.js b/www/src/App.js index 76e15e67..65186a7a 100644 --- a/www/src/App.js +++ b/www/src/App.js @@ -10,7 +10,7 @@ import { Link } from "./link"; import { List } from "./list"; import specifications from "./result"; import { AllSpecificationsRequirements } from "./result"; -import { Stats as StatsClass } from "./stats_class"; +import { Stats as StatsClass } from "./stats"; import clsx from "clsx"; const drawerWidth = 400; diff --git a/www/src/result.js b/www/src/result.js index e87d9076..a614d053 100644 --- a/www/src/result.js +++ b/www/src/result.js @@ -1,5 +1,5 @@ -import { Stats } from "./stats_class"; +import { Stats } from "./stats"; const input = process.env.NODE_ENV === "production" diff --git a/www/src/stats_class.js b/www/src/stats_class.js deleted file mode 100644 index 594380d1..00000000 --- a/www/src/stats_class.js +++ /dev/null @@ -1,46 +0,0 @@ - -export class Stats { - constructor() { - this.total = 0; - this.complete = 0; - this.incomplete = 0; - this.citations = 0; - this.implications = 0; - this.tests = 0; - this.exceptions = 0; - this.todos = 0; - } - - onRequirement(requirement) { - this.total += 1; - - if (requirement.incomplete) this.incomplete += 1; - else if (requirement.isOk) this.complete += 1; - - if (requirement.citation) this.citations += 1; - if (requirement.implication) this.implications += 1; - if (requirement.test) this.tests += 1; - if (requirement.exception) this.exceptions += 1; - if (requirement.todo) this.todos += 1; - } - - onStat(stat) { - this.total += stat.total; - this.complete += stat.complete; - this.incomplete += stat.incomplete; - this.citations += stat.citations; - this.implications += stat.implications; - this.tests += stat.tests; - this.exceptions += stat.exceptions; - this.todos += stat.todos; - } - - percent(field) { - const percent = this.total ? this[field] / this.total : 0; - return Number(percent).toLocaleString(undefined, { - style: "percent", - minimumFractionDigits: 0, - maximumFractionDigits: 2, - }); - } -} \ No newline at end of file