fix: transform patches find to array

The latest dev build of Vencord expects it to be an array
This commit is contained in:
Nuckyz 2024-04-10 16:16:42 -03:00 committed by GitHub
parent 8c6941b8e9
commit cddb040adc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -17,6 +17,7 @@ export function addPatch<P extends PatchData>(p: P) {
const { patches, ...globals } = p;
for (const patch of patches as Patch[]) {
if (!Array.isArray(patch.find)) patch.find = [patch.find];
if (!Array.isArray(patch.replacement)) patch.replacement = [patch.replacement];
for (const r of patch.replacement) {
if (typeof r.replace === "string") r.replace = r.replace.replaceAll("$self", "VCDP");