import {Filter, IFilter} from "@tsed/common";

/**
 * @private
 * @filter
 */
@Filter()
export class MultipartFileFilter implements IFilter {
  transform(expression: string, request: any, response: any) {
    return request["files"][0];
  }
}

import {Filter, IFilter} from "@tsed/common";

/**
 * @private
 * @filter
 */
@Filter()
export class MultipartFileFilter implements IFilter {
  transform(expression: string, request: any, response: any) {
    return request["files"] && request["files"][0];
  }
}

Fix request.files issue when file isn't required
fix(multipartfile): Fix request.files issue when file isn't required

Closes: #462
