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
Issue with "encodeURIComponent": Incorrect parametr's type #10093
Comments
I agree with you that the information about the paramter's type is actually incomplete. When checked encodeURIComponent with other datatypes i.e number, Boolean, null as parameters.
Every Ref - https://developer.mozilla.org/ru/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent |
I would like to work on this issue. |
MDN URL:
https://developer.mozilla.org/ru/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent
I think the information about parametr's type is not correct.
The realization of this function (encodeURIComponent) you can find in
https://chromium.googlesource.com/v8/v8/+/3.30.3/src/uri.js?autodive=0%2F
on line 355-374.
As you can see on line 351 there is the cast function ToString
So, you can call this function not only with string arguments. You can call this function with boolean and number too.
TypeSctipt's signature of this method proves it too:
function encodeURIComponent(uriComponent: string | number | boolean): string
The text was updated successfully, but these errors were encountered: