chore: format Polar client fix

This commit is contained in:
Marc-André Bombeck committed 2026-07-20 14:43:54 +02:00
1 parent 00a8c81c8d
commit ad5806c53a
2 files changed
+4 -7

No files matched your search

+3 -3
View File
@@ -460,9 +460,9 @@ describe("mapSpo2", () => {
expect(mapped[0]?.externalId).toBe("spo2:1781059600:device-1");
});
it("rejects out-of-range readings", () => {
expect(mapSpo2({ test_time: 1_781_059_600, blood_oxygen_percent: 0 })).toEqual(
[],
);
expect(
mapSpo2({ test_time: 1_781_059_600, blood_oxygen_percent: 0 }),
).toEqual([]);
expect(
mapSpo2({ test_time: 1_781_059_600, blood_oxygen_percent: 120 }),
).toEqual([]);
+1 -4
View File
@@ -268,10 +268,7 @@ async function fetchCollection<T>(
// 204 No Content — a window with no records. Polar returns an empty body.
if (res.status === 204) return [];
const json = (await res.json().catch(() => null)) as
| CollectionResult<T>
| Record<string, T[]>
| T[]
| null;
CollectionResult<T> | Record<string, T[]> | T[] | null;
if (!json) return [];
if (Array.isArray(json)) return json;
if (!recordsKey) return [];