Skip to content

Object transform operator allows arrays in its update expression #245

@deepilla

Description

@deepilla

The object transform operator has the following syntax:

root ~> | location | update [, delete] |

where update is an object that gets merged into the root object. All of the examples I've seen use a JSON object for the update part. But it also seems to work with an array, e.g.

{} ~> |$|["one", "two", "three"]|

evaluates to:

{
  "0": "one",
  "1": "two",
  "2": "three"
}

Shouldn't this be an error? There is a type check in the code but it doesn't catch this case because JavaScript objects and arrays both have type "object".

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions