diff --git a/src/clj_jtwig/standard_functions.clj b/src/clj_jtwig/standard_functions.clj index 1e1a70e..d012c67 100644 --- a/src/clj_jtwig/standard_functions.clj +++ b/src/clj_jtwig/standard_functions.clj @@ -50,14 +50,14 @@ {:fn (fn [coll value] (cond (instance? java.util.List coll) (.indexOf coll value) - (string? coll) (.indexOf coll value) + (string? coll) (.indexOf coll (if (char? value) (int value) value)) :else (throw (new Exception (str "'index_if' passed invalid collection type: " (type coll))))))} "last_index_of" {:fn (fn [coll value] (cond (instance? java.util.List coll) (.lastIndexOf coll value) - (string? coll) (.lastIndexOf coll value) + (string? coll) (.lastIndexOf coll (if (char? value) (int value) value)) :else (throw (new Exception (str "'last_index_if' passed invalid collection type: " (type coll))))))} "max"