You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Per #25, implement the Sprig functions for Bartholomew. Rather than file an issue for each function, I figured I'd break these down into small batches. (Note: I am not entirely sure all of the functions can be done with the same syntax. I am no pro in writing the Handlebars functions.)
list A B C returns a list of [A, B, C]
first LIST returns the first item in a list
rest LIST returns all but the first in a list
last LIST returns the last item in a list
initial LIST returns all but the last in a list
append ITEM LIST appends an item to end of a list (not sure if this one makes sense to add)
prepend ITEM LIST appends an item to start of a list (not sure if this one makes sense to add)
concat LIST LIST concatenate two lists into one list
reverse LIST reverse the order if items in a list
uniq LIST remove duplicates form a list. uniq [1, 1, 1, 2, 2] produces [1, 2]
without ITEM LIST removes ITEM from the list
has ITEM LIST returns boolean true of the item is in the list
compact LIST removes empty items from a list (I think rhai has a definition of empty that we could use here)
slice START END LIST extract START-END from a list and return it
chunk SIZE LIST chunk a given list into a list of lists, each no larger than SIZE
The text was updated successfully, but these errors were encountered:
Per #25, implement the Sprig functions for Bartholomew. Rather than file an issue for each function, I figured I'd break these down into small batches. (Note: I am not entirely sure all of the functions can be done with the same syntax. I am no pro in writing the Handlebars functions.)
list A B C
returns a list of[A, B, C]
first LIST
returns the first item in a listrest LIST
returns all but the first in a listlast LIST
returns the last item in a listinitial LIST
returns all but the last in a listappend ITEM LIST
appends an item to end of a list (not sure if this one makes sense to add)prepend ITEM LIST
appends an item to start of a list (not sure if this one makes sense to add)concat LIST LIST
concatenate two lists into one listreverse LIST
reverse the order if items in a listuniq LIST
remove duplicates form a list.uniq [1, 1, 1, 2, 2]
produces[1, 2]
without ITEM LIST
removes ITEM from the listhas ITEM LIST
returns boolean true of the item is in the listcompact LIST
removes empty items from a list (I think rhai has a definition of empty that we could use here)slice START END LIST
extract START-END from a list and return itchunk SIZE LIST
chunk a given list into a list of lists, each no larger than SIZEThe text was updated successfully, but these errors were encountered: