Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
file.name
}`;
console.warn(msg);
throw msg;
}
const err = 'File not uploaded';
if (largeFile && !(await this._shouldUploadLarge(file))) {
throw 'Cancelled large file upload';
}
await this._uploadCheckDisposed();
await this.refresh();
await this._uploadCheckDisposed();
if (
find(this._items, i => i.name === file.name) &&
!(await shouldOverwrite(file.name))
) {
throw err;
}
await this._uploadCheckDisposed();
const chunkedUpload = supportsChunked && file.size > CHUNK_SIZE;
return await this._upload(file, chunkedUpload);
}
file.name
}`;
console.warn(msg);
throw msg;
}
const err = 'File not uploaded';
if (largeFile && !(await this._shouldUploadLarge(file))) {
throw 'Cancelled large file upload';
}
await this._uploadCheckDisposed();
await this.refresh();
await this._uploadCheckDisposed();
if (
find(this._items, i => i.name === file.name) &&
!(await shouldOverwrite(file.name))
) {
throw err;
}
await this._uploadCheckDisposed();
const chunkedUpload = supportsChunked && file.size > CHUNK_SIZE;
return await this._upload(file, chunkedUpload);
}
return this.refresh().then(() => {
if (this.isDisposed) {
return Promise.resolve(false);
}
let item = find(this._items, i => i.name === file.name);
if (item) {
return shouldOverwrite(file.name);
}
return Promise.resolve(true);
}).then(value => {
if (value) {
return this.refresh().then(() => {
if (this.isDisposed) {
return Promise.resolve(false);
}
let item = find(this._items, i => i.name === file.name);
if (item) {
return shouldOverwrite(file.name);
}
return Promise.resolve(true);
}).then(value => {
if (value) {