Skip to content

Commit

Permalink
fix: Fix plugin autosetup
Browse files Browse the repository at this point in the history
  • Loading branch information
tjtanjin committed Oct 31, 2024
1 parent 0f1d0de commit fca98e9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 0 additions & 1 deletion src/types/Plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,4 @@ export type Plugin = (...args: unknown[]) => {
name: string;
settings?: Settings;
styles?: Styles;
themes?: Theme | Array<Theme>;
}
7 changes: 6 additions & 1 deletion src/utils/configParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,9 @@ export const parseConfig = async (botId: string, providedSettings: Settings | un
export const getCombinedConfig = (preferredConfig: Settings | Styles, baseConfig: Settings |
Styles): Settings | Styles => {

const stack: Array<{ source: object, target: object }> = [{ source: preferredConfig, target: baseConfig }];
const stack: Array<{ source: { [key: string]: any }, target: { [key: string]: any } }> = [
{ source: preferredConfig, target: baseConfig }
];

while (stack.length) {
const poppedItem = stack.pop();
Expand All @@ -98,6 +100,9 @@ export const getCombinedConfig = (preferredConfig: Settings | Styles, baseConfig
source[keyAsObjectType] !== null &&
!Array.isArray(source[keyAsObjectType])
) {
if (typeof target[keyAsObjectType] !== "object" || target[keyAsObjectType] === null) {
target[keyAsObjectType] = {};
}
stack.push({ source: source[keyAsObjectType], target: target[keyAsObjectType] });
} else {
try {
Expand Down

0 comments on commit fca98e9

Please sign in to comment.