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

Error: Invalid left-hand side in assignment, if JSON key has special chars (hyphen, underscore etc..) #192

Closed
ChethanEJ7 opened this issue Aug 20, 2022 · 3 comments · Fixed by #198
Labels

Comments

@ChethanEJ7
Copy link

I appreciate the editable feature for the JSON values, it works like a charm. But I see there is some assignment operator missing issues.

Description:
In the JSON, if the key is a string without any special characters, the JSON value is modified and works as expected.
But if the JSON key is **-** example **install-mode**, the editable option fails with the following error:
Uncaught SyntaxError: Invalid left-hand side in assignment
at new Function ()
at S (vue-json-pretty.js?0c42:1:1)

Expected:
The editable option is successful when the JSON key has some special characters such as hyphen (-), underscore (_) etc..

Actual:
The editable option doesn't work if the key has a hyphen/underscore.

@leezng
Copy link
Owner

leezng commented Aug 22, 2022

@ChethanEJ7
Thanks for your feedback, it may be a bug.

@leezng leezng added the bug label Aug 22, 2022
@ChethanEJ7
Copy link
Author

Yes, seems like a bug. Now editable works fine, when key is Alphanumeric only without any spl chars.

It would help me for my application, if the bug can be fixed asap😉

@ChethanEJ7
Copy link
Author

Thanks.! Seems to work as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants