| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
In js array may be object with key as index some another fix: - remove generic in string method. replace with toString - applyInner check not null before use in matcher - check ? when arg type is operator by toString.equals (? is char in value) - 2 test for each partial expression
| lhs = new HashMap(); | ||
| for (int i = 0; i < tempLhs.size(); i++) { | ||
| ((HashMap) lhs).put(i, tempLhs.get(i)); | ||
| } |
There was a problem hiding this comment.
maybe better:
var lhsNewMap = new HashMap();
var lhsOldList = (List)lhs;
for (int i = 0; i < lhsOldList.size(); i++) {
lhsNewMap.put(i, tempLhs.get(i));
}
lhs = lhsNewMap;
Sorry, something went wrong.
There was a problem hiding this comment.
Thanks + good catch!
We're reviewing this behavior of $each with list as input -
we want to clarify this with the original Jsonata maintainers, might be as well be a glitch in the original impl
Sorry, something went wrong.
|
find some another bug caused by this fix. @uw4 @aeberhart any updates about for this bug? memory pill for me: json: {
"buildings": {
"home": {
"address": "home address",
"period": "11 month on 12",
"presentation": {
"first": {
"widget": {
"data": "home widget"
}
}
}
},
"work": {
"address": "work address",
"presentation": {
"first": {
"widget": {
"data": "work widget"
}
}
}
},
"vacancy": {
"address": "vacancy address",
"period": "1 month on 12",
"presentation": {
"first": {
"widget": {
"data": "vacancy widget"
}
}
}
},
"old": {
"address": "old address",
"period": "2 month on 12",
"presentation": {
"first": {
"widget": {
"data": "old widget"
}
}
}
},
"operation": {
"address": "operation address",
"period": "3 month on 12",
"presentation": {
"first": {
"widget": {
"data": "operation widget"
}
}
}
}
}
}
and expression $sift($.buildings, function($v, $k) { $k ~> /o/ and $v.presentation.*.widget})
~> $each(?, function($v, $key) {{ $key: $sift($v.presentation, function($v, $k){ $v.widget }) }})
~> $map(?, function($v){($v.*)})
not fork after this fix and not coverage by tests |
Sorry, something went wrong.
|
I've fix the example-bug above. It's not the best solution, but I haven't come up with anything else yet. I've also added a test from my post with verification. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
In js array may be object with key as index
some another fix: