fix(metadata): support TS prefix operators in typeParser#883
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
PR SummaryLow Risk Overview Tests cover linked Reviewed by Cursor Bugbot for commit b56667c. Bugbot is set up for automated code reviews on this repo. Configure here. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #883 +/- ##
==========================================
+ Coverage 85.00% 85.02% +0.02%
==========================================
Files 179 179
Lines 16453 16479 +26
Branches 1491 1497 +6
==========================================
+ Hits 13986 14012 +26
Misses 2457 2457
Partials 10 10 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Description
Currently, the
typeParserinsrc/generators/metadata/utils/typeParser.mjsfails to resolve types that have prefix operators such astypeof,keyof,readonly, andunique.Because the parser treats the prefix and the target type as a single continuous string (e.g.,
"typeof Compiler"), it fails to find a match in thetype-map, resulting in dead links and plain text rendering in the documentation.This PR introduces a check for these common prefix operators before falling back to array or generic processing. It strips the prefix, formats it as plain text, and recursively passes the remaining target type to
resolveOrso it can be correctly matched and linked.Validation
Tested it on
webpack-doc-kit:Before:

After:

Related Issues
No related issues.
Check List
node --run testand all tests passed.node --run format&node --run lint.