simc / dartx

Superpowers for Dart. Collection of useful static extension methods.
https://pub.dev/packages/dartx
Apache License 2.0
1.08k stars 88 forks source link

Make sure takeFirst and takeLast doesn't crash when n > length #156

Closed passsy closed 2 years ago

passsy commented 2 years ago

This matches the behaviour of Kotlins takeFirst/takeLast

the sublist version caused RangeErrors

codecov[bot] commented 2 years ago

Codecov Report

Merging #156 (4320730) into master (b781ef5) will not change coverage. The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master     #156   +/-   ##
=======================================
  Coverage   97.80%   97.80%           
=======================================
  Files          13       13           
  Lines         775      775           
=======================================
  Hits          758      758           
  Misses         17       17           
Impacted Files Coverage Δ
lib/src/iterable.dart 99.57% <100.00%> (ø)

:mega: Codecov can now indicate which changes are the most critical in Pull Requests. Learn more