Repository: jsonata-js/jsonata (js)

Issue:
Object transform operator allows arrays in its update expression
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](https://github.com/jsonata-js/jsonata/blob/master/src/jsonata.js#L2557) in the code but it doesn't catch this case because JavaScript objects and arrays both have type "object".

Pull request description:
check for object should not include arrays
The 'update' part of the transform syntax should only allow JSON objects to be specified.  However, arrays were being accepted because a JS array is an object.  An extra check was added.

resolves #245 

Patch:
diff --git a/src/jsonata.js b/src/jsonata.js
index e4ec528..6eaffb5 100644
--- a/src/jsonata.js
+++ b/src/jsonata.js
@@ -2599,7 +2599,7 @@ var jsonata = (function() {
                     // update must be an object
                     var updateType = typeof update;
                     if(updateType !== 'undefined') {
-                        if(updateType !== 'object' || update === null) {
+                        if(updateType !== 'object' || update === null || Array.isArray(update)) {
                             // throw type error
                             throw {
                                 code: "T2011",


Test patch:
diff --git a/test/test-suite/groups/transforms/case012.json b/test/test-suite/groups/transforms/case012.json
new file mode 100644
index 0000000..7ca5e5c
--- /dev/null
+++ b/test/test-suite/groups/transforms/case012.json
@@ -0,0 +1,6 @@
+{
+    "expr": "{} ~> |$|['one', 'two', 'three']|",
+    "dataset": "dataset5",
+    "bindings": {},
+    "code": "T2011"
+}