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

map_to_object/1 produce valid javascript objects #362

Closed
vans163 opened this issue Aug 25, 2017 · 1 comment
Closed

map_to_object/1 produce valid javascript objects #362

vans163 opened this issue Aug 25, 2017 · 1 comment

Comments

@vans163
Copy link
Contributor

vans163 commented Aug 25, 2017

"An object property name can be any valid JavaScript string, or anything that can be converted to a string, including the empty string. However, any property name that is not a valid JavaScript identifier (for example, a property name that has a space or a hyphen, or that starts with a number) can only be accessed using the square bracket notation."

Currently if we do something like map_to_object(%{1=> :fail, :atom=> :fail}), we will produce an object like this, but in many cases we want a valid javascript object that will transform numbers and atoms to strings. Perhaps add a map_to_object/2 ?

@bryanjos
Copy link
Collaborator

bryanjos commented Sep 1, 2017

I think this is fixed with #377

@bryanjos bryanjos closed this as completed Sep 1, 2017
@bryanjos bryanjos added this to the 0.31.0 milestone Sep 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants