2018-08-14 13:13:32 +02:00
|
|
|
/**
|
|
|
|
* Render OrderedCollectionPage
|
|
|
|
* @param id URL of self
|
|
|
|
* @param totalItems Number of total items
|
|
|
|
* @param orderedItems Items
|
|
|
|
* @param partOf URL of base
|
|
|
|
* @param prev URL of prev page (optional)
|
|
|
|
* @param next URL of next page (optional)
|
|
|
|
*/
|
2019-04-12 18:43:22 +02:00
|
|
|
export default function(id: string, totalItems: any, orderedItems: any, partOf: string, prev?: string, next?: string) {
|
2018-08-14 13:13:32 +02:00
|
|
|
const page = {
|
|
|
|
id,
|
|
|
|
partOf,
|
|
|
|
type: 'OrderedCollectionPage',
|
|
|
|
totalItems,
|
|
|
|
orderedItems
|
|
|
|
} as any;
|
|
|
|
|
|
|
|
if (prev) page.prev = prev;
|
|
|
|
if (next) page.next = next;
|
|
|
|
|
|
|
|
return page;
|
|
|
|
}
|