-
Notifications
You must be signed in to change notification settings - Fork 510
Open
Description
Description
Currently, the doubles property in AnalyticsEngineDataPoint is strictly typed as number[]. This is inconsistent with the indexes and blobs fields, which both allow null values to represent missing data in specific positions.
Since Workers Analytics Engine supports sparse arrays, the current type definition forces a friction point for TypeScript users.
Impact
TypeScript users wishing to record sparse double fields are currently prohibited from passing arrays containing null (e.g., [0, null, 1]). To work around this, users are forced to use type casting:
// Current workaround required:
doubles: [10, null, 20] as unknown as number[]Proposed Change
Update the doubles property to allow null values within the array to align with the underlying capabilities and other property definitions.
export interface AnalyticsEngineDataPoint {
indexes?: ((ArrayBuffer | string) | null)[];
- doubles?: number[];
+ doubles?: (number | null)[];
blobs?: ((ArrayBuffer | string) | null)[];
}Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
In Progress