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

String with only numbers is erroneously parsed as integer #8

Open
eslachance opened this issue Jan 8, 2022 · 1 comment
Open

String with only numbers is erroneously parsed as integer #8

eslachance opened this issue Jan 8, 2022 · 1 comment

Comments

@eslachance
Copy link

Hello Ryan!

I'm making a web component that displays information about a Discord ID, meaning someone could use <discord-user user-id="210246661446959104" /> and it would display its username and more information. Unfortunately, due to this line ( https://github.com/ryansolid/component-register/blob/master/src/utils.ts#L118 ) the Discord ID gets converted to a number which breaks it because that converts it to 210246661446959100.
image

In my humble opinion, automatic parsing should not be done on incoming argument values, as is made evident here.

@jurijzahn8019
Copy link
Contributor

Hi, i think you can disable it by setting parse to false in register call

register("foo-bar", { myProp: { value: 222, parse: 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

No branches or pull requests

2 participants