Connectors
Dexcom, Libre, and Nightscout normalization.
normalizeDexcomEntries
Import: @glucoseiq/core/connectors
normalizeDexcomEntries(entries: DexcomShareEntry[]): NormalizedCGMReading[]Converts an array of Dexcom Share entries into NormalizedCGMReadings.
Returns: Array of normalized readings, sorted chronologically
| Parameter | Description |
|---|---|
entries | Raw Dexcom Share entries from any Dexcom client library |
normalizeDexcomEntry
Import: @glucoseiq/core/connectors
normalizeDexcomEntry(entry: DexcomShareEntry): NormalizedCGMReadingConverts a single Dexcom Share entry into a NormalizedCGMReading.
Returns: A normalized reading usable by APIs that accept GlucoseReading, subject to each API's contract
Throws: If the date string cannot be parsed
Throws: If the glucose value is not usable
| Parameter | Description |
|---|---|
entry | Raw Dexcom Share entry |
normalizeDexcomTrend
Import: @glucoseiq/core/connectors
normalizeDexcomTrend(trend: undefined | null | DexcomTrendString | string & {}): CGMTrendMaps a Dexcom Share trend string to the shared CGMTrend values.
normalizeLibreEntries
Import: @glucoseiq/core/connectors
normalizeLibreEntries(entries: LibreLinkUpEntry[]): NormalizedCGMReading[]Converts an array of Libre LinkUp entries into NormalizedCGMReadings.
Returns: Array of normalized readings, sorted chronologically
| Parameter | Description |
|---|---|
entries | Raw Libre LinkUp entries from any Libre client library |
normalizeLibreEntry
Import: @glucoseiq/core/connectors
normalizeLibreEntry(entry: LibreLinkUpEntry): NormalizedCGMReadingConverts a single Libre LinkUp entry into a NormalizedCGMReading.
Returns: A normalized reading usable by APIs that accept GlucoseReading, subject to each API's contract
Throws: If the timestamp cannot be parsed
Throws: If the unit or glucose value is not usable
| Parameter | Description |
|---|---|
entry | Raw Libre LinkUp entry |
normalizeLibreTrend
Import: @glucoseiq/core/connectors
normalizeLibreTrend(trend: undefined | null | number): CGMTrendMaps a Libre LinkUp numeric trend value to the shared CGMTrend values.
Accepts the raw API value (which may be null/undefined or out of range) and returns 'unknown' for any invalid or unmapped values.
normalizeNightscoutDirection
Import: @glucoseiq/core/connectors
normalizeNightscoutDirection(direction: undefined | NightscoutDirection): CGMTrendMaps a Nightscout direction string to the shared CGMTrend values.
normalizeNightscoutEntries
Import: @glucoseiq/core/connectors
normalizeNightscoutEntries(entries: NightscoutEntry[]): NormalizedCGMReading[]Converts an array of Nightscout SGV entries into NormalizedCGMReadings.
Returns: Array of normalized readings, sorted chronologically
| Parameter | Description |
|---|---|
entries | Raw Nightscout entries from the /api/v1/entries endpoint |
normalizeNightscoutEntry
Import: @glucoseiq/core/connectors
normalizeNightscoutEntry(entry: NightscoutEntry): NormalizedCGMReadingConverts a single Nightscout SGV entry into a NormalizedCGMReading.
Returns: A normalized reading usable by APIs that accept GlucoseReading, subject to each API's contract
Throws: If neither vendor timestamp can be normalized
Throws: If the glucose value is not usable
| Parameter | Description |
|---|---|
entry | Raw Nightscout SGV entry |
parseDexcomDate
Import: @glucoseiq/core/connectors
parseDexcomDate(raw: string): stringParses a Dexcom date string into an ISO 8601 string.
Dexcom Share returns dates in the format "Date(epochMs)" or
"/Date(epochMs)/". This helper handles both, plus plain ISO strings.
Throws: If the date string cannot be parsed
safeNormalizeDexcomEntries
Import: @glucoseiq/core/connectors
safeNormalizeDexcomEntries(entries: DexcomShareEntry[]): SafeNormalizeResultSafe (partial-success) variant of normalizeDexcomEntries.
safeNormalizeLibreEntries
Import: @glucoseiq/core/connectors
safeNormalizeLibreEntries(entries: LibreLinkUpEntry[]): SafeNormalizeResultSafe (partial-success) variant of normalizeLibreEntries.
safeNormalizeNightscoutEntries
Import: @glucoseiq/core/connectors
safeNormalizeNightscoutEntries(entries: NightscoutEntry[]): SafeNormalizeResultSafe (partial-success) variant of normalizeNightscoutEntries.