fix setting parsed regex as filter logging props
This commit is contained in:
parent
e0cb7242d6
commit
ea6fccb54e
|
@ -81,18 +81,18 @@ const stringMatches = (s: string, filter: CodeFilter) =>
|
||||||
export const filters = {
|
export const filters = {
|
||||||
byProps: (...props: PropsFilter): FilterFn => {
|
byProps: (...props: PropsFilter): FilterFn => {
|
||||||
const filter: FilterFn = props.length === 1
|
const filter: FilterFn = props.length === 1
|
||||||
? m => m?.[props[0]] !== void 0
|
? m => m?.[props[0]] !== undefined
|
||||||
: m => props.every(p => m?.[p] !== void 0);
|
: m => props.every(p => m?.[p] !== undefined);
|
||||||
|
|
||||||
filter.$$vencordProps = ["byProps", ...props];
|
filter.$$vencordProps = ["byProps", ...props];
|
||||||
return filter;
|
return filter;
|
||||||
},
|
},
|
||||||
|
|
||||||
byCode: (...code: CodeFilter): FilterFn => {
|
byCode: (...code: CodeFilter): FilterFn => {
|
||||||
code = code.map(canonicalizeMatch);
|
const parsedCode = code.map(canonicalizeMatch);
|
||||||
const filter: FilterFn = m => {
|
const filter: FilterFn = m => {
|
||||||
if (typeof m !== "function") return false;
|
if (typeof m !== "function") return false;
|
||||||
return stringMatches(String(m), code);
|
return stringMatches(String(m), parsedCode);
|
||||||
};
|
};
|
||||||
|
|
||||||
filter.$$vencordProps = ["byCode", ...code];
|
filter.$$vencordProps = ["byCode", ...code];
|
||||||
|
|
Loading…
Reference in a new issue