mirror of
https://iceshrimp.dev/crimekillz/trashposs
synced 2024-11-24 17:59:05 +01:00
93ba6b9e2b
* Talk read * fix * 複数のRead ActivityはCollectionとして送るように * あ
22 lines
565 B
TypeScript
22 lines
565 B
TypeScript
/**
|
|
* Render OrderedCollection
|
|
* @param id URL of self
|
|
* @param totalItems Total number of items
|
|
* @param first URL of first page (optional)
|
|
* @param last URL of last page (optional)
|
|
* @param orderedItems attached objects (optional)
|
|
*/
|
|
export default function(id: string | null, totalItems: any, first?: string, last?: string, orderedItems?: object) {
|
|
const page: any = {
|
|
id,
|
|
type: 'OrderedCollection',
|
|
totalItems,
|
|
};
|
|
|
|
if (first) page.first = first;
|
|
if (last) page.last = last;
|
|
if (orderedItems) page.orderedItems = orderedItems;
|
|
|
|
return page;
|
|
}
|