Skip to content

Commit

Permalink
fix map.filter_tag
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Aug 28, 2020
1 parent 290ce9b commit 2b4fa1c
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ public int compare(Map.Entry<StringHolder, ObjectTag> e1, Map.Entry<StringHolder
// @description
// returns a copy of the map with all its contents parsed through the given input tag and only including ones that returned 'true'.
// This requires a fully formed tag as input, making use of the 'filter_key' and 'filter_value' definition.
// For example: a map of 'a/1|b/2|c/3|d/4|e/5' .filter[<[filter_value].is[or_more].than[3]>] returns a list of 'c/3|d/4|e/5'.
// For example: a map of 'a/1|b/2|c/3|d/4|e/5' .filter_tag[<[filter_value].is[or_more].than[3]>] returns a list of 'c/3|d/4|e/5'.
// -->
registerTag("filter_tag", (attribute, object) -> {
if (!attribute.hasContext(1)) {
Expand All @@ -266,7 +266,7 @@ public int compare(Map.Entry<StringHolder, ObjectTag> e1, Map.Entry<StringHolder
provider.altDefs.put("filter_key", new ElementTag(entry.getKey().str));
provider.altDefs.put("filter_value", entry.getValue());
if (CoreUtilities.equalsIgnoreCase(attribute.parseDynamicContext(1, provider).toString(), "true")) {
newMap.map.put(entry.getKey(), attribute.parseDynamicContext(1, provider));
newMap.map.put(entry.getKey(), entry.getValue());
}
}
}
Expand Down

0 comments on commit 2b4fa1c

Please sign in to comment.