Skip to content

Commit bab2b5e

Browse files
cs-christopher-carseyspringcomp
authored andcommitted
Implemented lower() and upper() functions
For use in functional expressions: [?lower(foo) == 'bar']
1 parent a411b9d commit bab2b5e

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

jmespath/functions.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,14 @@ def _subtype_check(self, current, allowed_subtypes, types, function_name):
177177
@signature({'types': ['number']})
178178
def _func_abs(self, arg):
179179
return abs(arg)
180+
181+
@signature({'types': ['string']})
182+
def _func_lower(self, arg):
183+
return arg.lower()
184+
185+
@signature({'types': ['string']})
186+
def _func_upper(self, arg):
187+
return arg.upper()
180188

181189
@signature({'types': ['array-number']})
182190
def _func_avg(self, arg):

0 commit comments

Comments
 (0)