aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/utils.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-05-12 14:09:04 +0200
committerChocobozzz <me@florianbigard.com>2021-05-12 14:12:14 +0200
commit16c016e8b1d5ca46343d3363f9a49e24c5d7c944 (patch)
tree157dfa22ac95bd76a411aaf78e4df17152530e1c /server/models/utils.ts
parent9a320a06b663a2e02c3156a07135f75f9e987b11 (diff)
downloadPeerTube-16c016e8b1d5ca46343d3363f9a49e24c5d7c944.tar.gz
PeerTube-16c016e8b1d5ca46343d3363f9a49e24c5d7c944.tar.zst
PeerTube-16c016e8b1d5ca46343d3363f9a49e24c5d7c944.zip
Stricter models typing
Diffstat (limited to 'server/models/utils.ts')
-rw-r--r--server/models/utils.ts7
1 files changed, 3 insertions, 4 deletions
diff --git a/server/models/utils.ts b/server/models/utils.ts
index ec51c66bf..e27625bc8 100644
--- a/server/models/utils.ts
+++ b/server/models/utils.ts
@@ -1,5 +1,4 @@
1import { literal, Op, OrderItem } from 'sequelize' 1import { literal, Op, OrderItem, Sequelize } from 'sequelize'
2import { Model, Sequelize } from 'sequelize-typescript'
3import { Col } from 'sequelize/types/lib/utils' 2import { Col } from 'sequelize/types/lib/utils'
4import validator from 'validator' 3import validator from 'validator'
5 4
@@ -195,11 +194,11 @@ function parseAggregateResult (result: any) {
195 return total 194 return total
196} 195}
197 196
198const createSafeIn = (model: typeof Model, stringArr: (string | number)[]) => { 197function createSafeIn (sequelize: Sequelize, stringArr: (string | number)[]) {
199 return stringArr.map(t => { 198 return stringArr.map(t => {
200 return t === null 199 return t === null
201 ? null 200 ? null
202 : model.sequelize.escape('' + t) 201 : sequelize.escape('' + t)
203 }).join(', ') 202 }).join(', ')
204} 203}
205 204