1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-05 10:49:28 +02:00

Move test functions outside extra-utils

This commit is contained in:
Chocobozzz 2021-12-17 11:58:15 +01:00
parent bf54587a3e
commit c55e3d7227
No known key found for this signature in database
GPG key ID: 583A612D890159BE
202 changed files with 798 additions and 895 deletions

View file

@ -1,34 +0,0 @@
import { basename, extname, isAbsolute, join, resolve } from 'path'
let rootPath: string
function root () {
if (rootPath) return rootPath
rootPath = __dirname
if (basename(rootPath) === 'core-utils') rootPath = resolve(rootPath, '..')
if (basename(rootPath) === 'shared') rootPath = resolve(rootPath, '..')
if (basename(rootPath) === 'server') rootPath = resolve(rootPath, '..')
if (basename(rootPath) === 'dist') rootPath = resolve(rootPath, '..')
return rootPath
}
function buildPath (path: string) {
if (isAbsolute(path)) return path
return join(root(), path)
}
function getLowercaseExtension (filename: string) {
const ext = extname(filename) || ''
return ext.toLowerCase()
}
export {
root,
buildPath,
getLowercaseExtension
}