Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
shatfield4 committed Sep 9, 2024
1 parent b53fa7c commit 6ca6a5b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion server/utils/agents/imported.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ class ImportedPlugin {

parseCallOptions() {
const callOpts = {};
if (!this.config.setup_args || typeof this.config.setup_args !== 'object') {
if (!this.config.setup_args || typeof this.config.setup_args !== "object") {
return callOpts;
}
for (const [param, definition] of Object.entries(this.config.setup_args)) {
Expand Down
10 changes: 5 additions & 5 deletions server/utils/http/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ async function userFromSession(request, response = null) {
function decodeJWT(jwtToken) {
try {
return JWT.verify(jwtToken, process.env.JWT_SECRET);
} catch { }
} catch {}
return { p: null, id: null, username: null };
}

Expand All @@ -68,18 +68,18 @@ function safeJsonParse(jsonString, fallback = null) {

try {
return JSON.parse(jsonString);
} catch { }
} catch {}

if (jsonString?.startsWith("[") || jsonString?.startsWith("{")) {
try {
const repairedJson = jsonrepair(jsonString);
return JSON.parse(repairedJson);
} catch { }
} catch {}
}

try {
return extract(jsonString)[0];
} catch { }
} catch {}

return fallback;
}
Expand All @@ -89,7 +89,7 @@ function isValidUrl(urlString = "") {
const url = new URL(urlString);
if (!["http:", "https:"].includes(url.protocol)) return false;
return true;
} catch (e) { }
} catch (e) {}
return false;
}

Expand Down

0 comments on commit 6ca6a5b

Please sign in to comment.