storage: rework listDir api to be a generator (like) function

This commit is contained in:
Girish Ramakrishnan
2025-02-12 18:46:54 +01:00
parent da0dcf65b3
commit 9888aa8c08
9 changed files with 143 additions and 180 deletions
+3 -4
View File
@@ -61,14 +61,13 @@ async function download(apiConfig, backupFilePath) {
throw new BoxError(BoxError.NOT_IMPLEMENTED, 'Cannot download from noop backend');
}
function listDir(apiConfig, dir, batchSize, iteratorCallback, callback) {
async function listDir(apiConfig, dir, batchSize, marker) {
assert.strictEqual(typeof apiConfig, 'object');
assert.strictEqual(typeof dir, 'string');
assert.strictEqual(typeof batchSize, 'number');
assert.strictEqual(typeof iteratorCallback, 'function');
assert.strictEqual(typeof callback, 'function');
assert(typeof marker !== 'undefined');
callback();
return { entries: [], marker: null };
}
async function copy(apiConfig, oldFilePath, newFilePath, progressCallback) {