Repository: jsonata-js/jsonata (js)

Issue:
Boolean artifacts varables in simple array transform in version 1.7.0 and 1.8.4
In version 1.7.0 and 1.8.4:

JSON - [1, 2, 3]
Query - *
Result - [ 1, 2, 3, true, true ]

In version 1.6.5 result correct

Pull request:
unwrap outer array when evaluating wildcard
resolved #495 

Signed-off-by: andrew-coleman <andrew_coleman@uk.ibm.com>

Patch:
diff --git a/src/jsonata.js b/src/jsonata.js
index 1a0488a..8ec12b1 100644
--- a/src/jsonata.js
+++ b/src/jsonata.js
@@ -597,6 +597,9 @@ var jsonata = (function() {
      */
     function evaluateWildcard(expr, input) {
         var results = createSequence();
+        if (Array.isArray(input) && input.outerWrapper && input.length > 0) {
+            input = input[0];
+        }
         if (input !== null && typeof input === 'object') {
             Object.keys(input).forEach(function (key) {
                 var value = input[key];


Test patch:
diff --git a/test/test-suite/groups/wildcards/case009.json b/test/test-suite/groups/wildcards/case009.json
new file mode 100644
index 0000000..00fd1e4
--- /dev/null
+++ b/test/test-suite/groups/wildcards/case009.json
@@ -0,0 +1,6 @@
+{
+    "expr": "*",
+    "data": [1,2,3],
+    "bindings": {},
+    "result": [1,2,3]
+}