mobiletto 1.0.15 → 1.0.16

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 +12 -0
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -67,6 +67,18 @@ const UTILITY_FUNCTIONS = {
67
67
  }
68
68
  return await client.driver_list(path, recursive, visitor)
69
69
  },
70
+ safeList: (client) => async (path, opts) => {
71
+ const recursive = opts && opts.recursive ? opts.recursive : false
72
+ const visitor = opts && opts.visitor ? opts.visitor : null
73
+ try {
74
+ return await client.driver_list(path, recursive, visitor)
75
+ } catch (e) {
76
+ if (e instanceof MobilettoNotFoundError) {
77
+ return []
78
+ }
79
+ throw e
80
+ }
81
+ },
70
82
  remove: (client) => async (path, opts) => {
71
83
  const recursive = opts && opts.recursive ? opts.recursive : false
72
84
  const quiet = opts && opts.quiet ? opts.quiet : false
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mobiletto",
3
- "version": "1.0.15",
3
+ "version": "1.0.16",
4
4
  "description": "A storage abstraction layer",
5
5
  "main": "index.js",
6
6
  "author": "Jonathan Cobb",