ioredis
ioredis copied to clipboard
isInt function refactoring
I wonder if "const x = parseFloat(value);" is also unnecessary.
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.
https://github.com/redis/ioredis/blob/9c175502b53b400a31bd8bddc8e9a469856bc820/test/unit/utils.ts#L52