mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-18 16:12:11 +00:00
style: apply prettier across the tree
One-shot prettier pass so the new format:check gate starts from a clean baseline. Formatting only — no behaviour change. Generator-owned and vendored artifacts stay untouched via .prettierignore.
This commit is contained in:
1 parent
b3fea2ef59
commit
1f4ba5939d
1000 files changed
+12130
-8385
No files matched your search
@@ -6,10 +6,7 @@
|
||||
* derived from a value).
|
||||
*/
|
||||
import { describe, expect, it } from "vitest";
|
||||
import {
|
||||
resolveGlucoseTarget,
|
||||
DIABETIC_GOAL_BANDS,
|
||||
} from "../glucose-targets";
|
||||
import { resolveGlucoseTarget, DIABETIC_GOAL_BANDS } from "../glucose-targets";
|
||||
import type { UserProfileForRange } from "@/lib/analytics/effective-range";
|
||||
|
||||
const profile: UserProfileForRange = {
|
||||
@@ -84,7 +81,12 @@ describe("resolveGlucoseTarget", () => {
|
||||
});
|
||||
|
||||
it("resolves the diabetic goal band identically for every context", () => {
|
||||
for (const ctx of ["FASTING", "POSTPRANDIAL", "RANDOM", "BEDTIME"] as const) {
|
||||
for (const ctx of [
|
||||
"FASTING",
|
||||
"POSTPRANDIAL",
|
||||
"RANDOM",
|
||||
"BEDTIME",
|
||||
] as const) {
|
||||
const r = resolveGlucoseTarget({
|
||||
context: ctx,
|
||||
hasDiabetes: true,
|
||||
|
||||
@@ -12,13 +12,14 @@ describe("getTargetSourceLink", () => {
|
||||
it("maps weight + BMI to the WHO obesity fact-sheet", () => {
|
||||
const url =
|
||||
"https://www.who.int/news-room/fact-sheets/detail/obesity-and-overweight";
|
||||
expect(getTargetSourceLink({ type: "WEIGHT", source: "WHO BMI" })).toBe(url);
|
||||
expect(getTargetSourceLink({ type: "WEIGHT", source: "WHO BMI" })).toBe(
|
||||
url,
|
||||
);
|
||||
expect(getTargetSourceLink({ type: "BMI", source: "WHO BMI" })).toBe(url);
|
||||
});
|
||||
|
||||
it("maps blood pressure (and the in-target derivative) to the ESH paper", () => {
|
||||
const url =
|
||||
"https://academic.oup.com/eurheartj/article/39/33/3021/5079119";
|
||||
const url = "https://academic.oup.com/eurheartj/article/39/33/3021/5079119";
|
||||
expect(
|
||||
getTargetSourceLink({ type: "BLOOD_PRESSURE", source: "ESH 2023" }),
|
||||
).toBe(url);
|
||||
|
||||
@@ -55,7 +55,6 @@ import {
|
||||
readMoodDayRollups,
|
||||
} from "@/lib/rollups/mood-rollups";
|
||||
|
||||
|
||||
import type { User } from "@/generated/prisma/client";
|
||||
|
||||
function getAge(dateOfBirth: Date): number {
|
||||
@@ -1476,10 +1475,7 @@ export async function buildTargetsResponse(user: AuthedUser) {
|
||||
if (range && effRange) {
|
||||
if (latest >= range.min && latest <= range.max) {
|
||||
classification = { category: "Optimal", color: "#50fa7b" };
|
||||
} else if (
|
||||
latest >= effRange.orangeMin &&
|
||||
latest <= effRange.orangeMax
|
||||
) {
|
||||
} else if (latest >= effRange.orangeMin && latest <= effRange.orangeMax) {
|
||||
classification = { category: "Elevated", color: "#f1fa8c" };
|
||||
} else {
|
||||
classification = { category: "High", color: "#ff5555" };
|
||||
|
||||
@@ -9,7 +9,9 @@ export interface TargetSourceLinkInput {
|
||||
source: string;
|
||||
}
|
||||
|
||||
export function getTargetSourceLink(target: TargetSourceLinkInput): string | null {
|
||||
export function getTargetSourceLink(
|
||||
target: TargetSourceLinkInput,
|
||||
): string | null {
|
||||
if (target.type === "WEIGHT" || target.type === "BMI") {
|
||||
return "https://www.who.int/news-room/fact-sheets/detail/obesity-and-overweight";
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user