packages/vsc_quill_delta_to_html/src/helpers/array
library
Functions
-
flatten<T>(Iterable list)
→ List<T>
-
-
groupConsecutiveElementsWhile<T>(List<T> arr, bool predicate(T currElm, T prevElm))
→ List
-
Returns a new array by putting consecutive elements satisfying predicate into a new
array and returning others as they are.
Ex:
1, "ha", 3, "ha", "ha"
=> [1, "ha", 3, "ha", "ha"
]
where predicate: (v, vprev) => typeof v === typeof vPrev
-
intersperse<T>(List<T> arr, T item)
→ List<T>
-
(arr:
1, 3, 4
, item: 0) yields: 1, 0, 3, 0, 4
-
preferSecond<T>(List<T> arr)
→ T?
-
-
sliceFromReverseWhile<T>(List<T> arr, int startIndex, bool predicate(T currElm))
→ ArraySlice<T>
-
Returns consecutive list of elements satisfying the predicate starting from startIndex
and traversing the array in reverse order.