refactor: use optional chaining (#6757)

This commit is contained in:
Almeida
2021-10-04 23:04:53 +01:00
committed by GitHub
parent d873a19d34
commit a194d9c37f
5 changed files with 5 additions and 5 deletions

View File

@@ -48,7 +48,7 @@ class APIRequest {
if (this.options.headers) headers = Object.assign(headers, this.options.headers);
let body;
if (this.options.files && this.options.files.length) {
if (this.options.files?.length) {
body = new FormData();
for (const file of this.options.files) {
if (file?.file) body.append(file.key ?? file.name, file.file, file.name);