mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 08:49:13 +00:00
chore(build): enable CodeQL (#1026)
* Create codeql.yml * setup pnpm * sq.Eq{"ras.status": params.Filters.PushStatus} * enable extended and quality * fix: code scanning alert #58 #57 https://github.com/autobrr/autobrr/security/code-scanning/58 https://github.com/autobrr/autobrr/security/code-scanning/57 * fix: linting issues for code scanning 60, 59, 56 https://github.com/autobrr/autobrr/security/code-scanning/60 https://github.com/autobrr/autobrr/security/code-scanning/59 https://github.com/autobrr/autobrr/security/code-scanning/56 --------- Co-authored-by: Fabricio Silva <hi@fabricio.dev>
This commit is contained in:
parent
a78a5d1bf8
commit
98df0c9040
5 changed files with 107 additions and 9 deletions
|
@ -50,7 +50,7 @@ export async function HttpClient<T = unknown>(
|
|||
for (const [key, value] of Object.entries(config.queryString)) {
|
||||
const serializedKey = encodeRFC3986URIComponent(key);
|
||||
|
||||
if (typeof(value) === undefined) {
|
||||
if (typeof(value) === "undefined") {
|
||||
// Skip case when the value is undefined.
|
||||
// The solution in this case is to use the request body instead with JSON
|
||||
continue;
|
||||
|
@ -59,7 +59,7 @@ export async function HttpClient<T = unknown>(
|
|||
// e.g. ?a=1&a=2&a=3
|
||||
value.forEach((child) => {
|
||||
// Skip undefined member values
|
||||
const v = typeof(child) !== undefined ? String(child) : "";
|
||||
const v = typeof(child) !== "undefined" ? String(child) : "";
|
||||
if (v.length) {
|
||||
params.push(`${serializedKey}=${encodeRFC3986URIComponent(v)}`);
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@ export function useToggle(initialValue = false): [boolean, () => void] {
|
|||
return [value, toggle];
|
||||
}
|
||||
|
||||
const isBrowser = typeof window !== "undefined";
|
||||
const isBrowser = typeof(window) !== "undefined";
|
||||
|
||||
const getInitialState = (query: string, defaultState?: boolean) => {
|
||||
// Prevent a React hydration mismatch when a default value is provided by not defaulting to window.matchMedia(query).matches.
|
||||
|
|
|
@ -9,7 +9,7 @@ type ValueObject = Record<string, Primitive>;
|
|||
class ParserFilter {
|
||||
public values: ValueObject = {};
|
||||
public warnings: string[] = [];
|
||||
|
||||
|
||||
public name: string;
|
||||
|
||||
constructor(name: string) {
|
||||
|
@ -21,14 +21,14 @@ class ParserFilter {
|
|||
|
||||
public OnParseLine(key: string, value: string) {
|
||||
if (key in CONST.FILTER_SUBSTITUTION_MAP) {
|
||||
key = CONST.FILTER_SUBSTITUTION_MAP[key]
|
||||
key = CONST.FILTER_SUBSTITUTION_MAP[key];
|
||||
}
|
||||
|
||||
switch (key) {
|
||||
case "log_score":
|
||||
// In this case we need to set 2 properties in autobrr instead of only 1
|
||||
this.values["log"] = true;
|
||||
|
||||
|
||||
// log_score is an integer
|
||||
const delim = value.indexOf("-");
|
||||
if (delim !== -1) {
|
||||
|
@ -202,8 +202,9 @@ class ParserIrcChannel {
|
|||
}
|
||||
|
||||
// erm.. todo?
|
||||
const TRACKER = "tracker" as const;
|
||||
const OPTIONS = "options" as const;
|
||||
// const TRACKER = "tracker" as const;
|
||||
// const OPTIONS = "options" as const;
|
||||
|
||||
// *cough* later dude, trust me *cough*
|
||||
const FILTER = "filter" as const;
|
||||
const SERVER = "server" as const;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue