stream-js icon indicating copy to clipboard operation
stream-js copied to clipboard

Activity.object is typed as `string | unknown`

Open amakhrov opened this issue 3 years ago • 1 comments

It happens in a few places, e.g. https://github.com/GetStream/stream-js/blob/main/src/feed.ts#L103

Note that string | unknown evaluates to just unknown - which likely defeats the purpose of the type annotation. Looks like in the .NET client it's typed strictly as string.

Suggestion: Update type from object: string | unknown to just object: string. Or maybe, if it is not guaranteed to always be present, to object?: string

amakhrov avatar Jul 28 '22 22:07 amakhrov

yeah, ive just found this issue also, why hasnt this been fixed since 2022? it basically makes the types for enriched activities unusable

ammanvedi avatar Feb 29 '24 12:02 ammanvedi