Skip to content

Commit

Permalink
fix: zod :))
Browse files Browse the repository at this point in the history
  • Loading branch information
xhyrom committed May 12, 2022
1 parent 5fa13de commit c408845
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/lib/structures/Command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ export class Command {
public dmPermission?: boolean;
public arguments?: Array<Argument>;
public inhibitors: CommandInhibitors;
public options: CommandOptions;
public options: Partial<CommandOptions>;
public guildId?: string;
private static defaults?: Partial<CommandOptions>;
public cooldown?: string;
Expand Down
2 changes: 1 addition & 1 deletion src/lib/structures/Component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export class Component {
public client: GClient;
public name: string;
public type: Array<ComponentType | keyof typeof ComponentType>;
public options: ComponentOptions;
public options: Partial<ComponentOptions>;
public inhibitors: ComponentInhibitors = [];
public guildId?: string;
private static defaults: Partial<ComponentOptions>;
Expand Down
2 changes: 2 additions & 0 deletions src/lib/structures/Listener.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const validationSchema = z
run: z.function(),
})
.passthrough();

export class Listener<
WS extends boolean = boolean,
Event extends WS extends true
Expand Down Expand Up @@ -57,6 +58,7 @@ export class Listener<
this.ws = options.ws as WS;
this.fileName = options.fileName;
this.run = options.run;
// @ts-expect-error Zod :))
this.options = options;

Listeners.register(this);
Expand Down
5 changes: 3 additions & 2 deletions src/lib/structures/Plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import { Plugins } from '../managers/PluginManager';
import { Logger } from '../util/logger/Logger';

export interface PluginOptions {
name: string;
run: (client: GClient) => any;
name: string;
run: (client: GClient) => any;
}

const validationSchema = z
Expand All @@ -26,6 +26,7 @@ export class Plugin {
.then(options => {
this.name = options.name;
this.run = options.run;
// @ts-expect-error Zod :))
this.options = options;

Plugins.register(this);
Expand Down

0 comments on commit c408845

Please sign in to comment.