Skip to content

Commit

Permalink
fix(types): optional parameters are marked as required
Browse files Browse the repository at this point in the history
XDCC constructor's parameter type wasn't matching the Bridge class
  • Loading branch information
JiPaix committed May 4, 2024
1 parent 89ea749 commit 5f7415a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/bridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Downloader, { ParamsDL } from './downloader';
import humanFileSize from './lib/progress/humanFileSize';

export default class Bridge extends Downloader {
constructor(params: ParamsDL) {
constructor(params: Partial<ParamsDL>) {
const testedParams = Bridge.checkParams(params);

super(testedParams);
Expand Down
2 changes: 1 addition & 1 deletion src/downloader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import * as ProgressBar from './lib/progress';
export type ParamsDL = ParamsCTCP & {
/**
* Array of ports for passive DCC
* @default 5001
* @default [5001]
* @remark Some xdcc bots use passive dcc, this require to have these ports opened on your computer/router/firewall
* @example
* ```js
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ export default class XDCC extends EventEmitter<GlobalMessageEvents> {

whowas: (target: string, cb: (event: Event) => any) => void;

constructor(params: Params) {
constructor(params: Partial<ParamsDL> & { host: string }) {
// eslint-disable-next-line constructor-super
super();
this.irc = new Bridge(params);
Expand Down

0 comments on commit 5f7415a

Please sign in to comment.