fix: attach fn, arrayFn, extend to defu function to match its type#174
fix: attach fn, arrayFn, extend to defu function to match its type#174Mohammad-Faiz-Cloud-Engineer wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe PR updates the main ChangesDefu Instance Export Enrichment
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
DefuInstance interface declares these properties but defu = createDefu() just returns a bare function, the as DefuInstance cast was lying to TypeScript. Anyone calling defu.fn(), defu.arrayFn(), or defu.extend() would get a runtime crash despite passing typecheck.
Reordered defuFn/defuArrayFn before defu so they can be referenced, then used Object.assign to attach them to the function object. CJS bridge (lib/defu.cjs) auto-picks these up via module.exports = defu.
Summary by CodeRabbit