liquid icon indicating copy to clipboard operation
liquid copied to clipboard

Support big integers in truncatewords and slice filters

Open dylanahsmith opened this issue 3 years ago • 0 comments

In a low-level implementation of liquid, I would like to treat conversion of filter arguments to slice, truncate and truncatewords with a saturating conversion to an i32 or u32. Having these work consistently also allows this conversion logic to be shared across these filters.

From a high-level perspective, the user would prefer if these were handled without an error for use cases like truncations and slicing. A saturating conversion seems like it would give the expected behaviour, considering that the arrays and strings themselves shouldn't be this large.

As such, I'm changing the reference implementation to adopt this behaviour.

dylanahsmith avatar Sep 09 '22 15:09 dylanahsmith