aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/utils.ts
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-05-22 20:58:25 +0200
committerChocobozzz <florian.bigard@gmail.com>2017-05-25 17:32:16 +0200
commite02643f32e4c97ca307f8fc5b69be79c40d70a3b (patch)
treeb7f6269913cd5a0e4f26a9461a043deb0c168be0 /server/models/utils.ts
parent65fcc3119c334b75dd13bcfdebf186afdc580a8f (diff)
downloadPeerTube-e02643f32e4c97ca307f8fc5b69be79c40d70a3b.tar.gz
PeerTube-e02643f32e4c97ca307f8fc5b69be79c40d70a3b.tar.zst
PeerTube-e02643f32e4c97ca307f8fc5b69be79c40d70a3b.zip
Type models
Diffstat (limited to 'server/models/utils.ts')
-rw-r--r--server/models/utils.ts6
1 files changed, 6 insertions, 0 deletions
diff --git a/server/models/utils.ts b/server/models/utils.ts
index 601811913..fd84a9239 100644
--- a/server/models/utils.ts
+++ b/server/models/utils.ts
@@ -14,8 +14,14 @@ function getSort (value) {
14 return [ field, direction ] 14 return [ field, direction ]
15} 15}
16 16
17function addMethodsToModel (model: any, classMethods: Function[], instanceMethods: Function[] = []) {
18 classMethods.forEach(m => model[m.name] = m)
19 instanceMethods.forEach(m => model.prototype[m.name] = m)
20}
21
17// --------------------------------------------------------------------------- 22// ---------------------------------------------------------------------------
18 23
19export { 24export {
25 addMethodsToModel,
20 getSort 26 getSort
21} 27}