@progress/kendo-angular-upload
Version:
Kendo UI Angular Upload Component
36 lines (35 loc) • 975 B
JavaScript
/**-----------------------------------------------------------------------------------------
* Copyright © 2025 Progress Software Corporation. All rights reserved.
* Licensed under commercial license. See LICENSE.md in the project root for more information
*-------------------------------------------------------------------------------------------*/
/**
* @hidden
*/
export class ChunkMap {
_files;
constructor() {
this._files = {};
}
add(uid, totalChunks) {
const initialChunkInfo = {
index: 0,
position: 0,
retries: 0,
totalChunks: totalChunks
};
this._files[uid] = initialChunkInfo;
return initialChunkInfo;
}
remove(uid) {
if (this.has(uid)) {
this._files[uid] = null;
delete this._files[uid];
}
}
has(uid) {
return uid in this._files;
}
get(uid) {
return this._files[uid];
}
}