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

how to get vorpal argument as an array #330

Open
zelaxo opened this issue Nov 14, 2018 · 2 comments
Open

how to get vorpal argument as an array #330

zelaxo opened this issue Nov 14, 2018 · 2 comments

Comments

@zelaxo
Copy link

zelaxo commented Nov 14, 2018

Vorpal arguments are returned as a string. How to get them as it is, ie. get an object array as an object array.

Please refer here for a broader explanation : https://stackoverflow.com/q/53297013/8619824

@b4dnewz
Copy link

b4dnewz commented Dec 9, 2018

@zaygozi it should be command <arg...> according to the documentation, are called variadic arguments

@zelaxo
Copy link
Author

zelaxo commented Dec 14, 2018

@b4dnewz But variadic arguments return an array of strings. So if the input is {name:'anon',time:9}, this is returned as a type string & not an object. The only way I found to resolve this was to pass the input as a json object {"name":"arjun","time":9} & then use JSON.parse to retrieve the object from the string.

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