posthog-js-lite
posthog-js-lite copied to clipboard
Incorrect types on `personProperties` for `getAllFlags`
Bug description
personProperties
is typed as Record<string, string>
whereas it should be Record<string, string | number>
How to reproduce
Try to call getAllFlags
with a numerical personProperty
and you will get a type error
Related sub-libraries
- [ ] All of them
- [ ] posthog-web
- [x] posthog-node
- [ ] posthog-react-native
Additional context
posthog-node
version 3.6.3
The JS SDK is defined as:
export type Property = any
export type Properties = Record<string, Property>
@neilkakkar should it be similar to the JS SDK or was it intended to be <string, string>
?
oh I seem to have overlooked this. We can & should accept numbers too indeed 👍
oh I seem to have overlooked this. We can & should accept numbers too indeed 👍
@neilkakkar would you like/do you have time to take a stab at it before we release the next major? not sure if this is a breaking change, since Record<string, Property>
will still be compatible with <string, string>
.
sigh want to but don't seem like I have the time with all the incident fixes :/
Yeah wouldn't be breaking, will relax types in all functions