mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-04 02:09:37 +02:00
Type toActivityPubObject functions
This commit is contained in:
parent
f92e7f76d4
commit
b5fecbf441
24 changed files with 109 additions and 53 deletions
|
@ -19,7 +19,10 @@ async function generateRandomString (size: number) {
|
|||
return raw.toString('hex')
|
||||
}
|
||||
|
||||
interface FormattableToJSON<U, V> { toFormattedJSON (args?: U): V }
|
||||
interface FormattableToJSON<U, V> {
|
||||
toFormattedJSON (args?: U): V
|
||||
}
|
||||
|
||||
function getFormattedObjects<U, V, T extends FormattableToJSON<U, V>> (objects: T[], objectsTotal: number, formattedArg?: U) {
|
||||
const formattedObjects = objects.map(o => o.toFormattedJSON(formattedArg))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue