lodestar
lodestar copied to clipboard
Remove usage of Number constructor
The Number constructor is very unsafe because:
- It takes
anyas parameter. If we change from passing a string to Number to some object Typescript will compile and we'll getNaN.
If you do a text search of the Number constructor there are many occurrences:
- If Number arg is already an argument, remove
- If Number arg is a string, use
parseInt() - If Number arg is a bigint, use a custom util that types like
bigintToNumber(bn: bigint): number
If the input of any of those functions is un-trusted data, verify the return is not NaN
Hello @dapplion and @philknows can I work on this issue?
Assigned to you @IjayAbby
Hi, has this been solved ? i'll love to work on it