From 24198e976f41bcc41b90c640f2c51931fc22b0a4 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 30 Dec 2020 11:26:24 +0100 Subject: Styling --- server/tools/peertube-auth.ts | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/server/tools/peertube-auth.ts b/server/tools/peertube-auth.ts index 7673b92cd..6a0b89fe2 100644 --- a/server/tools/peertube-auth.ts +++ b/server/tools/peertube-auth.ts @@ -46,6 +46,15 @@ function isURLaPeerTubeInstance (url: string) { return url.startsWith('http://') || url.startsWith('https://') } +function stripExtraneousFromPeerTubeUrl (url: string) { + // Get everything before the 3rd /. + const urlLength = url.includes('/', 8) + ? url.indexOf('/', 8) + : url.length + + return url.substr(0, urlLength) +} + program .name('auth') .usage('[command] [options]') @@ -80,12 +89,6 @@ program } } }, async (_, result) => { - const stripExtraneousFromPeerTubeUrl = function (url: string) { - // Get everything before the 3rd /. - const urlLength: number = url.includes('/', 8) ? url.indexOf('/', 8) : url.length - - return url.substr(0, urlLength) - } // Check credentials try { -- cgit v1.2.3