Uh oh!
There was an error while loading. Please reload this page.
feat(core): Return array or string from getTraceMetaTags() - #13293
Conversation
| scope, | ||
| client, | ||
| asArray, | ||
| }: { span?: Span; scope?: Scope; client?: Client; asArray?: boolean } = {}): string | string[] { |
There was a problem hiding this comment.
if we move forward with this, we can adjust the types so that TS knows that if asArray is true, it returns an array and otherwise a string
There was a problem hiding this comment.
The type checking should already check this as I created two function overloads above. But I am open for another approach (in the case this gets merged) :D
There was a problem hiding this comment.
sorry, I missed this. This is what I had in mind :)
s1gr1d
commented
Aug 12, 2024
I'll close this for now as this is a legit reason not to return an array:
|
Changing the function signature for the convenience of returning a string or an array of strings.