aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers/utils.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/helpers/utils.ts')
-rw-r--r--server/helpers/utils.ts8
1 files changed, 6 insertions, 2 deletions
diff --git a/server/helpers/utils.ts b/server/helpers/utils.ts
index 07c1b3f51..5b8d21f70 100644
--- a/server/helpers/utils.ts
+++ b/server/helpers/utils.ts
@@ -22,8 +22,12 @@ function createEmptyCallback () {
22 } 22 }
23} 23}
24 24
25function getFormatedObjects (objects: any[], objectsTotal: number) { 25interface FormatableToJSON {
26 const formatedObjects = [] 26 toFormatedJSON()
27}
28
29function getFormatedObjects<U, T extends FormatableToJSON> (objects: T[], objectsTotal: number) {
30 const formatedObjects: U[] = []
27 31
28 objects.forEach(function (object) { 32 objects.forEach(function (object) {
29 formatedObjects.push(object.toFormatedJSON()) 33 formatedObjects.push(object.toFormatedJSON())