-
Notifications
You must be signed in to change notification settings - Fork 239
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] ITelemetryItem
uses intersection type instead of union type for tags
property
#2258
Comments
Actually, we have 2 @siyuniu-ms can you have a look and see the impact of removing the Array definition, I suspect that we might need to "grow" some While I initially thought that this would be a good candidate for 3.1.0, I'm not so sure now. @devm33 Which version of TypeScript is throwing this error? |
Also, because of backward compatibility support, this might be problematic -- so as suggested it might just be easier to change the definition to a union type as suggested (rather than removing the |
@MSNev I'm running |
Yeah, it looks like someone in the past tried to convert this to an object (and when we construct the outbound serialized form this is what we do), and while this definition "works" (from a previous version and raw JS perspective), it's problematic -- especially if the latest versions of TS are now enforcing this more. |
The
ITelemetryItem
interface uses an intersection type (&
) betweenTags
andTags[]
instead of a union type (|
). There's a note on the line thatTags[]
will be deprecated:https://github.com/microsoft/ApplicationInsights-JS/blame/f9d5ec1e2045f6206c8d7dc9b0cb3e6509f45473/shared/AppInsightsCore/src/JavaScriptSDK.Interfaces/ITelemetryItem.ts#L37
However using an intersection type forces passing an array in order to satisfy the constraints of
Tags & Tags[]
:The text was updated successfully, but these errors were encountered: