| 47 | } |
| 48 | |
| 49 | export function injectPagingInfo(query: Record<string, any>, params: Record<string, any>) { |
| 50 | if (query.limit !== undefined) |
| 51 | params.count = query.limit; |
| 52 | if (query.max_id !== undefined) |
| 53 | params.max_id = query.max_id; |
| 54 | if (query.since_id !== undefined) |
| 55 | params.since_id = query.since_id; |
| 56 | if (query.min_id !== undefined) |
| 57 | params.since_id = query.min_id; |
| 58 | } |
| 59 | |
| 60 | export function addPageLinksToResponse(url: URL, items: {id: string}[], response: express.Response) { |
| 61 | if (items.length === 0) |