mobiletto 1.1.19 → 1.1.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +14 -0
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -578,11 +578,25 @@ async function mobiletto (driverPath, key, secret, opts, encryption = null) {
578
578
  const subdirListing = await client.list(subdir)
579
579
  if (subdirListing && subdirListing.length > 0) {
580
580
  const subdirEntries = await _loadMeta(subdir, subdirListing)
581
+ if (visitor) {
582
+ for (const obj of subdirEntries) {
583
+ await visitor(obj)
584
+ }
585
+ }
581
586
  entries.push(...subdirEntries)
582
587
  const moreDirs = subdirEntries.filter(obj => obj.type === M_DIR)
583
588
  dirs.unshift(...moreDirs)
584
589
  }
585
590
  }
591
+ if (cache) {
592
+ cache.set(cacheKey, entries).then(
593
+ () => { logger.debug(`enc_list: cached ${p} r=${recursive}`) },
594
+ (err) => { logger.error(`enc_list(${p}) error: ${err}`) }
595
+ )
596
+ }
597
+ if (!entries || entries.length === 0) {
598
+ return []
599
+ }
586
600
  }
587
601
  }
588
602
  if (entries.length === 0 && p.includes('/')) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mobiletto",
3
- "version": "1.1.19",
3
+ "version": "1.1.20",
4
4
  "description": "A storage layer that presents a uniform interface to Amazon S3, Backblaze B2, and local storage",
5
5
  "main": "index.js",
6
6
  "keywords": [