chore: remove isString, isNumber
don't need dummy functions, native ts type narrowing works great
The latest updates on your projects. Learn more about Vercel for Git ↗︎
| Name | Status | Preview | Comments | Updated (UTC) |
|---|---|---|---|---|
| satori-playground | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | May 30, 2023 10:04pm |
Are these changes really necessary? 🤔️ I still think that isNumber(xxx) is more concise and straightforward compared to typeof xxx === 'number'.
What’s the benefit isNumber and isString against typeof?
Downsides:
- Sometimes these functions are used in code bases but in most cases not
- Unneeded function call
What’s the benefit
isNumberandisStringagainsttypeof?
Concise and straightforward.
2. Unneeded function call
It looks more concise, so I don't think this is unnecessary. Apart from your subjective view of it being unnecessary, are there any risks? 🤔️
They don’t look concise, they look like Monkey business code
They are just aliases for typeof
They don’t look concise, they look like Monkey business code
I beg to differ, but don’t mean to knock your coding tastes. It seems pointless to continue the discussion. You do you, as long as you’re content.
I think different people have different code tastes, i am saying here not for isNumber or typeof:
- bench
i run the bench in my machine, and it looks like there is little performance enhancement, or even worse?
-
isNumberis more straightforward - someone like me like reading commit to dig into this repo, non-sense commit just make commits' history noisy.
- no offense, but we should prompt more necessary change.
conclusion:
i think we should not make some pure code taste change, and should think is this pr really make this code better? and prove it. If just code taste change, maybe the code will change endlessly.😂
P.S: I perfer isNumber :see_no_evil: