nosdav / pastebin

NosDAV pastebin
https://nosdav.github.io/pastebin/
MIT License
8 stars 1 forks source link

Refactor Utility Functions into a Separate utils.js File #12

Closed melvincarvalho closed 1 year ago

melvincarvalho commented 1 year ago

Move the utility functions getPath, getMimeType, isAbsoluteUrl, getQueryStringValue, and generateAuthorizationHeader into a separate utils.js file.

Example code snippet from utils.js:

export function getPath(serverUrl, userPublicKey, filename, mode) {
  ...
}

export function getMimeType(filename) {
  ...
}

... More functions ...

Update the main application file to import the functions and remove their local definitions. This will help to keep the main application file clean and focused on its core functionality.