-
Notifications
You must be signed in to change notification settings - Fork 198
refactor: improve logFn
types
#372
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
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #372 +/- ##
===========================================
- Coverage 61.08% 29.30% -31.78%
===========================================
Files 13 43 +30
Lines 1380 1723 +343
Branches 58 87 +29
===========================================
- Hits 843 505 -338
- Misses 537 1192 +655
- Partials 0 26 +26 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Thanks for PR but it seems type only getting stricter we need to fix runtime support somehow to not wrongly detect |
Do you mean a stricter isLogObj function check, requiring Lines 16 to 33 in 5ac9ed7
|
Yes exactly! (types couldbe lean as is IMO. feel free to make another PR for runtime fix) |
#379 makes the runtime check more strict. Personally, I prefer stricter types that align with runtime behavior. This can improve DX 😃 (I've also simplified the |
resolves #351
Since
logObj.date
must be of typeDate
, we should enforce stricter parameter types to prevent runtime errors.In addition to
formatDate
requiring theDate
type, we also use theDate
internally:consola/src/consola.ts
Lines 418 to 422 in 5ac9ed7