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

$eval returns empty object if the context value is an empty array #463

Closed
goulderb opened this issue Jul 22, 2020 · 2 comments · Fixed by #482
Closed

$eval returns empty object if the context value is an empty array #463

goulderb opened this issue Jul 22, 2020 · 2 comments · Fixed by #482
Labels

Comments

@goulderb
Copy link

goulderb commented Jul 22, 2020

When $eval is provided an empty array, it always returns empty object.

Example:

$eval("{ 'test': 1 }", [])

Output:

{}

Expected Output:

{
  "test": 1
}
@andrew-coleman
Copy link
Member

Looks like a bug, I think

@goulderb
Copy link
Author

@andrew-coleman Do you happen to have any areas of the code that you would start looking at to dig into this issue? It's impacting me as I've got quite a few JSONata expressions that use $eval to do some meta-programming style functionality.

I'd be open to contributing a bug fix for this, but I am not really sure where to start.

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