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

expliciting type checks and predicates (server only)

This commit is contained in:
Rigel Kent 2018-07-25 22:01:25 +02:00
parent 5f7021c33d
commit c1e791bad0
No known key found for this signature in database
GPG key ID: EA12971B0E438F36
34 changed files with 127 additions and 84 deletions

View file

@ -42,7 +42,7 @@ function root () {
const paths = [ __dirname, '..', '..' ]
// We are under /dist directory
if (process.mainModule.filename.endsWith('.ts') === false) {
if (process.mainModule && process.mainModule.filename.endsWith('.ts') === false) {
paths.push('..')
}
@ -143,6 +143,7 @@ const renamePromise = promisify2WithVoid<string, string>(rename)
const writeFilePromise = promisify2WithVoid<string, any>(writeFile)
const readdirPromise = promisify1<string, string[]>(readdir)
const mkdirpPromise = promisify1<string, string>(mkdirp)
// we cannot modify the Promise types, so we should make the promisify instance check mkdirp
const pseudoRandomBytesPromise = promisify1<number, Buffer>(pseudoRandomBytes)
const createPrivateKey = promisify1<number, { key: string }>(pem.createPrivateKey)
const getPublicKey = promisify1<string, { publicKey: string }>(pem.getPublicKey)