thekevinscott / UpscalerJS

Bad function overloading JS-0388
Anti-pattern
Minor
6 months agoa year old
This overload and the one on line 151 can be combined into one signature with an optional parameter
142    ): Promise<Tensor3D>;
143    public async execute(
144      image: Input,
145      options: Omit<UpscaleArgs, 'output' | 'progress' | 'progressOutput'> & { output?: BASE64; progress?: MultiArgStringProgress; progressOutput?: unknown },146    ): Promise<string>;
147    public async execute(
148      image: Input,
This overload and the one on line 137 can be combined into one signature taking Omit<UpscaleArgs, 'output' | 'progress' | 'progressOutput'> & { output?: BASE64; progress?: MultiArgTensorProgress; progressOutput: TENSOR } | Omit<UpscaleArgs, 'output' | 'progress' | 'progressOutput'> & { output?: BASE64; progress?: MultiArgStringProgress; progressOutput?: unknown }
142    ): Promise<Tensor3D>;
143    public async execute(
144      image: Input,
145      options: Omit<UpscaleArgs, 'output' | 'progress' | 'progressOutput'> & { output?: BASE64; progress?: MultiArgStringProgress; progressOutput?: unknown },146    ): Promise<string>;
147    public async execute(
148      image: Input,
This overload and the one on line 133 can be combined into one signature taking Omit<UpscaleArgs, 'output' | 'progress' | 'progressOutput'> & { output: TENSOR; progress?: MultiArgStringProgress; progressOutput: BASE64 } | Omit<UpscaleArgs, 'output' | 'progress' | 'progressOutput'> & { output: TENSOR; progress?: MultiArgTensorProgress; progressOutput?: unknown }
138    ): Promise<string>;
139    public async execute(
140      image: Input,
141      options: Omit<UpscaleArgs, 'output' | 'progress' | 'progressOutput'> & { output: TENSOR; progress?: MultiArgTensorProgress; progressOutput?: unknown },142    ): Promise<Tensor3D>;
143    public async execute(
144      image: Input,
This overload and the one on line 151 can be combined into one signature with an optional parameter
134    ): Promise<Tensor3D>;
135    public async execute(
136      image: Input,
137      options: Omit<UpscaleArgs, 'output' | 'progress' | 'progressOutput'> & { output?: BASE64; progress?: MultiArgTensorProgress; progressOutput: TENSOR },138    ): Promise<string>;
139    public async execute(
140      image: Input,