Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions src/main/java/com/dashjoin/jsonata/Jsonata.java
Original file line number Diff line number Diff line change
Expand Up @@ -723,9 +723,6 @@ Object evaluateWildcard(Symbol expr, Object input) {
if((value instanceof List)) {
value = flatten(value, null);
results = (List)Functions.append(results, value);
} else if (value instanceof Map) {
// Call recursively do decompose the map
results.addAll((List)evaluateWildcard(expr, value));
} else {
results.add(value);
}
Expand Down
6 changes: 1 addition & 5 deletions src/main/java/com/dashjoin/jsonata/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,7 @@ public static List<Object> createSequence(Object el) {
JList<Object> sequence = new JList<>();
sequence.sequence = true;
if (el!=NONE) {
if (el instanceof List && ((List)el).size()==1)
sequence.add(((List)el).get(0));
else
// This case does NOT exist in Javascript! Why?
sequence.add(el);
sequence.add(el);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!

}
return sequence;
}
Expand Down
2 changes: 0 additions & 2 deletions src/test/java/com/dashjoin/jsonata/ArrayTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,12 @@ public void testSortNull() {
Assertions.assertEquals(Arrays.asList(Map.of("x", 2), Map.of("x", 1)), expr.evaluate(null));
}

@Disabled
@Test
public void testWildcard() {
Jsonata expr = jsonata("*");
Assertions.assertEquals(Map.of("x", 1), expr.evaluate(List.of(Map.of("x", 1))));
}

@Disabled
@Test
public void testWildcardFilter() {
Object value1 = Map.of("value", Map.of("Name", "Cell1", "Product", "Product1"));
Expand Down