From 39dab495e3942b6e50bdd7270a83f63126631a0b Mon Sep 17 00:00:00 2001 From: Keylan Jensen Date: Wed, 10 Apr 2024 10:53:48 -0600 Subject: [PATCH] Remove functions that are no longer used, standardizeURL() and checkFileSize() --- pods.ts | 40 ---------------------------------------- 1 file changed, 40 deletions(-) diff --git a/pods.ts b/pods.ts index 08617be..46e50dc 100644 --- a/pods.ts +++ b/pods.ts @@ -43,29 +43,7 @@ let accessToken : string | undefined; let accessTokenReceiveTime : number | undefined; let accessTokenValidDuration : number | undefined; -/** - * Standardizes URLs by checking for slashes at the start and end of URLs, - * adding slashes to the end if not present and removing slashes at the start if present. - * @param inputURL The URL to standardize. - * @returns a standardized URL. - */ -function standardizeURL(inputURL : string | undefined) : string | undefined { - if (typeof inputURL === "undefined") { - return inputURL; - } - inputURL = inputURL; - let outputURL : string = inputURL; - - if (inputURL.startsWith("/") || inputURL.startsWith("\\")) { - //Slices off the first letter of the string - outputURL = outputURL.slice(1); - }; - if (!(inputURL.endsWith("/") || inputURL.endsWith("\\"))) { - outputURL = outputURL + "/"; - } - return outputURL; -}; const getStorage = krl.Function([], async function() : Promise { return this.rsCtx.getEnt(STORAGE_ENT_NAME); }); @@ -180,24 +158,6 @@ async function createFileObject(data : Blob, destinationURL : string, functionNa return file; } -//Used to check the size of a file without loading it into memory. -/*async function getFileSize(url: string): Promise { - try { - if (url.startsWith('http://') || url.startsWith('https://')) { - const response = await axios.head(url); - const contentLength = response.headers['content-length']; - - return contentLength ? parseInt(contentLength, 10) : -1; - } else { - const stats = fs.statSync(url); - return stats.size; - } - } catch (error) { - console.error('An error occurred:', error); - return -1; - } -}*/ - const authenticate = krl.Action([], async function authenticate() { // A key pair is needed for encryption. // This function from `solid-client-authn` generates such a pair for you.