mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-09 13:01:00 +00:00
chore: format Polar client fix
This commit is contained in:
1 parent
00a8c81c8d
commit
ad5806c53a
2 files changed
+4
-7
No files matched your search
@@ -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([]);
|
||||
|
||||
@@ -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 [];
|
||||
|
||||
Reference in new issue
Block a user