1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-04 02:09:37 +02:00

WIP plugins: add ability to register plugins

This commit is contained in:
Chocobozzz 2019-07-05 13:54:32 +02:00 committed by Chocobozzz
parent 297067399d
commit 345da516fa
23 changed files with 553 additions and 3 deletions

View file

@ -1,10 +1,18 @@
import 'multer'
import * as validator from 'validator'
import { sep } from 'path'
function exists (value: any) {
return value !== undefined && value !== null
}
function isSafePath (p: string) {
return exists(p) &&
(p + '').split(sep).every(part => {
return [ '', '.', '..' ].includes(part) === false
})
}
function isArray (value: any) {
return Array.isArray(value)
}
@ -97,6 +105,7 @@ export {
isNotEmptyIntArray,
isArray,
isIdValid,
isSafePath,
isUUIDValid,
isIdOrUUIDValid,
isDateValid,