[CDX-281] Mark itemName as optional in trackSearchResultClick#444
[CDX-281] Mark itemName as optional in trackSearchResultClick#444
Conversation
There was a problem hiding this comment.
Copilot wasn't able to review any files in this pull request.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Code Review
This PR marks itemName as optional in trackSearchResultClick — both in the JSDoc and the TypeScript declaration — aligning the type signature with the actual runtime behavior (the implementation already handles missing itemName gracefully). The change is minimal and correct.
Inline comments: 2 discussions added
Overall Assessment:
| term: string, | ||
| parameters: { | ||
| itemName: string; | ||
| itemName?: string; |
There was a problem hiding this comment.
Suggestion: itemIsConvertible is typed as string (itemIsConvertible?: string) but the runtime implementation at src/modules/tracker.js:981 checks typeof itemIsConvertible === 'boolean'. This is a pre-existing inconsistency, but since the type signature is being touched right next to it this would be a good opportunity to fix it to boolean so that consumers receive correct compile-time guidance. This is low-risk since making it stricter is a narrowing, not a widening, of the public type.
No description provided.