mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-03 17:59:37 +02:00
Update dependencies
This commit is contained in:
parent
9d94e5d7b9
commit
bdd428a6d9
33 changed files with 347 additions and 343 deletions
|
@ -28,7 +28,7 @@ function isActorPublicKeyValid (publicKey: string) {
|
|||
return exists(publicKey) &&
|
||||
typeof publicKey === 'string' &&
|
||||
publicKey.startsWith('-----BEGIN PUBLIC KEY-----') &&
|
||||
publicKey.indexOf('-----END PUBLIC KEY-----') !== -1 &&
|
||||
publicKey.includes('-----END PUBLIC KEY-----') &&
|
||||
validator.isLength(publicKey, CONSTRAINTS_FIELDS.ACTORS.PUBLIC_KEY)
|
||||
}
|
||||
|
||||
|
@ -43,7 +43,7 @@ function isActorPrivateKeyValid (privateKey: string) {
|
|||
typeof privateKey === 'string' &&
|
||||
privateKey.startsWith('-----BEGIN RSA PRIVATE KEY-----') &&
|
||||
// Sometimes there is a \n at the end, so just assert the string contains the end mark
|
||||
privateKey.indexOf('-----END RSA PRIVATE KEY-----') !== -1 &&
|
||||
privateKey.includes('-----END RSA PRIVATE KEY-----') &&
|
||||
validator.isLength(privateKey, CONSTRAINTS_FIELDS.ACTORS.PRIVATE_KEY)
|
||||
}
|
||||
|
||||
|
|
|
@ -84,19 +84,19 @@ function sanitizeAndCheckVideoTorrentObject (video: any) {
|
|||
function isRemoteVideoUrlValid (url: any) {
|
||||
return url.type === 'Link' &&
|
||||
(
|
||||
ACTIVITY_PUB.URL_MIME_TYPES.VIDEO.indexOf(url.mediaType) !== -1 &&
|
||||
ACTIVITY_PUB.URL_MIME_TYPES.VIDEO.includes(url.mediaType) &&
|
||||
isActivityPubUrlValid(url.href) &&
|
||||
validator.isInt(url.height + '', { min: 0 }) &&
|
||||
validator.isInt(url.size + '', { min: 0 }) &&
|
||||
(!url.fps || validator.isInt(url.fps + '', { min: -1 }))
|
||||
) ||
|
||||
(
|
||||
ACTIVITY_PUB.URL_MIME_TYPES.TORRENT.indexOf(url.mediaType) !== -1 &&
|
||||
ACTIVITY_PUB.URL_MIME_TYPES.TORRENT.includes(url.mediaType) &&
|
||||
isActivityPubUrlValid(url.href) &&
|
||||
validator.isInt(url.height + '', { min: 0 })
|
||||
) ||
|
||||
(
|
||||
ACTIVITY_PUB.URL_MIME_TYPES.MAGNET.indexOf(url.mediaType) !== -1 &&
|
||||
ACTIVITY_PUB.URL_MIME_TYPES.MAGNET.includes(url.mediaType) &&
|
||||
validator.isLength(url.href, { min: 5 }) &&
|
||||
validator.isInt(url.height + '', { min: 0 })
|
||||
) ||
|
||||
|
|
|
@ -13,7 +13,7 @@ function isValidRSSFeed (value: string) {
|
|||
'atom1'
|
||||
]
|
||||
|
||||
return feedExtensions.indexOf(value) !== -1
|
||||
return feedExtensions.includes(value)
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
|
|
@ -4,7 +4,7 @@ import { LogLevel } from '../../../shared/models/server/log-level.type'
|
|||
const logLevels: LogLevel[] = [ 'debug', 'info', 'warn', 'error' ]
|
||||
|
||||
function isValidLogLevel (value: any) {
|
||||
return exists(value) && logLevels.indexOf(value) !== -1
|
||||
return exists(value) && logLevels.includes(value)
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
|
|
@ -46,7 +46,7 @@ function isUserEmailVerifiedValid (value: any) {
|
|||
|
||||
const nsfwPolicies = values(NSFW_POLICY_TYPES)
|
||||
function isUserNSFWPolicyValid (value: any) {
|
||||
return exists(value) && nsfwPolicies.indexOf(value) !== -1
|
||||
return exists(value) && nsfwPolicies.includes(value)
|
||||
}
|
||||
|
||||
function isUserWebTorrentEnabledValid (value: any) {
|
||||
|
|
|
@ -73,7 +73,7 @@ function isVideoViewsValid (value: string) {
|
|||
}
|
||||
|
||||
function isVideoRatingTypeValid (value: string) {
|
||||
return value === 'none' || values(VIDEO_RATE_TYPES).indexOf(value as VideoRateType) !== -1
|
||||
return value === 'none' || values(VIDEO_RATE_TYPES).includes(value as VideoRateType)
|
||||
}
|
||||
|
||||
function isVideoFileExtnameValid (value: string) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue