Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: use encapsulated api #11220

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

OnlyWick
Copy link
Contributor

No description provided.

@OnlyWick
Copy link
Contributor Author

This can reduce tens of bytes.

@ferferga
Copy link
Contributor

There are other typeof instances across the codebase, why not do this in all of them?

@OnlyWick
Copy link
Contributor Author

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.

@skirtles-code
Copy link
Contributor

This seems similar to #8505, which wasn't merged due to #8505 (comment).

@OnlyWick
Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants