mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-04 10:19:35 +02:00
Stricter models typing
This commit is contained in:
parent
9a320a06b6
commit
16c016e8b1
54 changed files with 148 additions and 95 deletions
|
@ -1,5 +1,4 @@
|
|||
import { literal, Op, OrderItem } from 'sequelize'
|
||||
import { Model, Sequelize } from 'sequelize-typescript'
|
||||
import { literal, Op, OrderItem, Sequelize } from 'sequelize'
|
||||
import { Col } from 'sequelize/types/lib/utils'
|
||||
import validator from 'validator'
|
||||
|
||||
|
@ -195,11 +194,11 @@ function parseAggregateResult (result: any) {
|
|||
return total
|
||||
}
|
||||
|
||||
const createSafeIn = (model: typeof Model, stringArr: (string | number)[]) => {
|
||||
function createSafeIn (sequelize: Sequelize, stringArr: (string | number)[]) {
|
||||
return stringArr.map(t => {
|
||||
return t === null
|
||||
? null
|
||||
: model.sequelize.escape('' + t)
|
||||
: sequelize.escape('' + t)
|
||||
}).join(', ')
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue