storage: rework listDir api to be a generator (like) function
This commit is contained in:
@@ -82,14 +82,14 @@ async function copy(apiConfig, oldFilePath, newFilePath, progressCallback) {
|
||||
throw new BoxError(BoxError.NOT_IMPLEMENTED, 'copy is not implemented');
|
||||
}
|
||||
|
||||
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(new BoxError(BoxError.NOT_IMPLEMENTED, 'listDir is not implemented'));
|
||||
// Result: array of { fullPath, size }
|
||||
throw new BoxError(BoxError.NOT_IMPLEMENTED, 'listDir is not implemented');
|
||||
}
|
||||
|
||||
async function remove(apiConfig, filename) {
|
||||
|
||||
Reference in New Issue
Block a user