bb3f7327cdf7bb2372e240940b3cabd0930fedb4
Ensure the pagination function correctly handles out-of-bounds indices when slicing items. Update the slice logic to prevent slice bounds errors and add a test case for better coverage of edge cases.
Description