Skip to content

Commit fca98e9

Browse files
committed
fix: Fix plugin autosetup
1 parent 0f1d0de commit fca98e9

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/types/Plugin.ts

-1
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,4 @@ export type Plugin = (...args: unknown[]) => {
99
name: string;
1010
settings?: Settings;
1111
styles?: Styles;
12-
themes?: Theme | Array<Theme>;
1312
}

src/utils/configParser.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,9 @@ export const parseConfig = async (botId: string, providedSettings: Settings | un
8080
export const getCombinedConfig = (preferredConfig: Settings | Styles, baseConfig: Settings |
8181
Styles): Settings | Styles => {
8282

83-
const stack: Array<{ source: object, target: object }> = [{ source: preferredConfig, target: baseConfig }];
83+
const stack: Array<{ source: { [key: string]: any }, target: { [key: string]: any } }> = [
84+
{ source: preferredConfig, target: baseConfig }
85+
];
8486

8587
while (stack.length) {
8688
const poppedItem = stack.pop();
@@ -98,6 +100,9 @@ export const getCombinedConfig = (preferredConfig: Settings | Styles, baseConfig
98100
source[keyAsObjectType] !== null &&
99101
!Array.isArray(source[keyAsObjectType])
100102
) {
103+
if (typeof target[keyAsObjectType] !== "object" || target[keyAsObjectType] === null) {
104+
target[keyAsObjectType] = {};
105+
}
101106
stack.push({ source: source[keyAsObjectType], target: target[keyAsObjectType] });
102107
} else {
103108
try {

0 commit comments

Comments
 (0)