2018-08-14 06:13:32 -05: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 11:43:22 -05:00
|
|
|
export default function(id: string, totalItems: any, orderedItems: any, partOf: string, prev?: string, next?: string) {
|
2018-08-14 06:13:32 -05:00
|
|
|
const page = {
|
|
|
|
id,
|
|
|
|
partOf,
|
|
|
|
type: 'OrderedCollectionPage',
|
|
|
|
totalItems,
|
|
|
|
orderedItems
|
|
|
|
} as any;
|
|
|
|
|
|
|
|
if (prev) page.prev = prev;
|
|
|
|
if (next) page.next = next;
|
|
|
|
|
|
|
|
return page;
|
|
|
|
}
|