aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers/utils.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-08-21 14:31:57 +0200
committerChocobozzz <me@florianbigard.com>2019-08-21 15:23:04 +0200
commitb5fecbf44192144d1ca27c23a0b53922de288c10 (patch)
tree03e4f1048273e6de60b8eb642fb52b2a4c68e60c /server/helpers/utils.ts
parentf92e7f76d43cbad173be87f47105b9a02032318a (diff)
downloadPeerTube-b5fecbf44192144d1ca27c23a0b53922de288c10.tar.gz
PeerTube-b5fecbf44192144d1ca27c23a0b53922de288c10.tar.zst
PeerTube-b5fecbf44192144d1ca27c23a0b53922de288c10.zip
Type toActivityPubObject functions
Diffstat (limited to 'server/helpers/utils.ts')
-rw-r--r--server/helpers/utils.ts5
1 files changed, 4 insertions, 1 deletions
diff --git a/server/helpers/utils.ts b/server/helpers/utils.ts
index 1464b1477..ba07eaaf3 100644
--- a/server/helpers/utils.ts
+++ b/server/helpers/utils.ts
@@ -19,7 +19,10 @@ async function generateRandomString (size: number) {
19 return raw.toString('hex') 19 return raw.toString('hex')
20} 20}
21 21
22interface FormattableToJSON<U, V> { toFormattedJSON (args?: U): V } 22interface FormattableToJSON<U, V> {
23 toFormattedJSON (args?: U): V
24}
25
23function getFormattedObjects<U, V, T extends FormattableToJSON<U, V>> (objects: T[], objectsTotal: number, formattedArg?: U) { 26function getFormattedObjects<U, V, T extends FormattableToJSON<U, V>> (objects: T[], objectsTotal: number, formattedArg?: U) {
24 const formattedObjects = objects.map(o => o.toFormattedJSON(formattedArg)) 27 const formattedObjects = objects.map(o => o.toFormattedJSON(formattedArg))
25 28