mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-12 23:40:45 -07:00
Add reverse filter
This commit is contained in:
@@ -90,6 +90,12 @@ module Liquid
|
||||
end
|
||||
end
|
||||
|
||||
# Reverse the elements of an array
|
||||
def reverse(input)
|
||||
ary = [input].flatten
|
||||
ary.reverse
|
||||
end
|
||||
|
||||
# map/collect on a given property
|
||||
def map(input, property)
|
||||
ary = [input].flatten
|
||||
|
||||
Reference in New Issue
Block a user