takeRightWhile (Functional Programming) es-toolkit
Creates a function that takes trailing values while a predicate passes. Use it with pipe.
Info
Prefer the original es-toolkit takeRightWhile in ordinary code. Use this fp variant when composing transformations with pipe.
Usage
takeRightWhile walks the piped array from the end and keeps values while predicate returns true. It stops at the first value that does not pass.
Parameters
predicate(item: T) => booleanrequired
The function that decides whether a trailing value should be kept.
Returns
A function that maps a readonly T[] to the trailing values that pass.
Source: es-toolkit
Re-exported verbatim from es-toolkit. Implementation, edge cases, and performance behavior are owned upstream. This page mirrors the documentation at the pinned version; the linked source is authoritative.