Open OnlyWick opened 1 week ago
There are other typeof instances across the codebase, why not do this in all of them?
There are other typeof instances across the codebase, why not do this in all of them?
Yep, 'typeof xxx === 'function''
can be replaced with the isFunction
function. typeof xxx === 'undefined'
can also be encapsulated into an API.
This seems similar to #8505, which wasn't merged due to https://github.com/vuejs/core/pull/8505#issuecomment-2139233216.
This seems similar to #8505, which wasn't merged due to #8505 (comment).
I indeed didn't expect there to be a similar PR. Strangely, in the compiler, methods like isString
and isSymbol
have already been used. I believe all these should be replaced with encapsulated APIs to ensure consistency in code style.
This can reduce tens of bytes.