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:
parent
297067399d
commit
345da516fa
23 changed files with 553 additions and 3 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue