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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

isInt function refactoring #1795

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

isInt function refactoring #1795

wants to merge 2 commits into from

Conversation

0o001
Copy link

@0o001 0o001 commented Aug 11, 2023

No description provided.

@NurimOnsemiro
Copy link

I wonder if "const x = parseFloat(value);" is also unnecessary.

@0o001
Copy link
Author

0o001 commented Aug 11, 2023

I wonder if "const x = parseFloat(value);" is also unnecessary.

I assume it's unnecessary for the following reasons:

1- Function title
... isInt(value: any): value is string ...

2- Number("1s") -> NaN
parseFloat("1s") -> 1.0

Number("1n") -> NaN
parseFloat("1n") -> 1.0

However, if this is an undesired situation, yes, this part can be changed; it would be more appropriate for authorized developers to answer.

expect(utils.isInt("1s")).to.eql(false);

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.

2 participants