From 002a1cfc16eaed3261500d6f67a3351395552919 Mon Sep 17 00:00:00 2001 From: Nuckyz <61953774+Nuckyz@users.noreply.github.com> Date: Wed, 12 Jun 2024 17:45:54 -0300 Subject: [PATCH] grrr --- src/utils/lazyReact.tsx | 4 ++-- src/webpack/webpack.tsx | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/utils/lazyReact.tsx b/src/utils/lazyReact.tsx index 20988e1ec..ff90179b6 100644 --- a/src/utils/lazyReact.tsx +++ b/src/utils/lazyReact.tsx @@ -6,7 +6,7 @@ import { makeLazy } from "./lazy"; -export type LazyComponentType = React.ComponentType & Record; +export type LazyComponentType = React.ComponentType & Record; export const SYM_LAZY_COMPONENT_INNER = Symbol.for("vencord.lazyComponent.inner"); @@ -17,7 +17,7 @@ export const SYM_LAZY_COMPONENT_INNER = Symbol.for("vencord.lazyComponent.inner" * @param attempts How many times to try to get the component before giving up * @returns Result of factory function */ -export function LazyComponent(factory: () => LazyComponentType, attempts = 5) { +export function LazyComponent(factory: () => LazyComponentType, attempts = 5) { const get = makeLazy(factory, attempts, { isIndirect: true }); let InnerComponent = null as LazyComponentType | null; diff --git a/src/webpack/webpack.tsx b/src/webpack/webpack.tsx index d38b71336..fe47dd551 100644 --- a/src/webpack/webpack.tsx +++ b/src/webpack/webpack.tsx @@ -196,7 +196,7 @@ export function find(filter: FilterFn, callback: (mod: any) => an * @param parse A function that takes the found component as its first argument and returns a component. Useful if you want to wrap the found component in something. Defaults to the original component * @returns The component if found, or a noop component */ -export function findComponent(filter: FilterFn, parse: (component: any) => LazyComponentType = m => m, { isIndirect = false }: { isIndirect?: boolean; } = {}) { +export function findComponent(filter: FilterFn, parse: (component: any) => LazyComponentType = m => m, { isIndirect = false }: { isIndirect?: boolean; } = {}) { if (typeof filter !== "function") throw new Error("Invalid filter. Expected a function got " + typeof filter); if (typeof parse !== "function") @@ -241,7 +241,7 @@ export function findComponent(filter: FilterFn, parse: (c * @param parse A function that takes the found component as its first argument and returns a component. Useful if you want to wrap the found component in something. Defaults to the original component * @returns The component if found, or a noop component */ -export function findExportedComponent(...props: string[] | [...string[], (component: any) => LazyComponentType]) { +export function findExportedComponent(...props: string[] | [...string[], (component: any) => LazyComponentType]) { const parse = (typeof props.at(-1) === "function" ? props.pop() : m => m) as (component: any) => LazyComponentType; const newProps = props as string[]; @@ -286,7 +286,7 @@ export function findExportedComponent(...props: string[] * @param parse A function that takes the found component as its first argument and returns a component. Useful if you want to wrap the found component in something. Defaults to the original component * @returns The component if found, or a noop component */ -export function findComponentByCode(...code: string[] | [...string[], (component: any) => LazyComponentType]) { +export function findComponentByCode(...code: string[] | [...string[], (component: any) => LazyComponentType]) { const parse = (typeof code.at(-1) === "function" ? code.pop() : m => m) as (component: any) => LazyComponentType; const newCode = code as string[]; @@ -516,7 +516,7 @@ export function webpackDependantLazy(factory: () => T, attempts?: * @param attempts How many times to try to get the component before giving up * @returns Result of factory function */ -export function webpackDependantLazyComponent(factory: () => any, attempts?: number) { +export function webpackDependantLazyComponent(factory: () => any, attempts?: number) { if (IS_REPORTER) webpackSearchHistory.push(["webpackDependantLazyComponent", [factory]]); return LazyComponent(factory, attempts);