roboto-js 1.3.15 → 1.3.17
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.
- package/dist/cjs/rbt_api.cjs +13 -4
- package/dist/esm/rbt_api.js +5 -1
- package/package.json +1 -1
- package/src/rbt_api.js +4 -0
package/dist/cjs/rbt_api.cjs
CHANGED
|
@@ -53,6 +53,9 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
|
|
|
53
53
|
},
|
|
54
54
|
setItem: function setItem(key, value) {
|
|
55
55
|
return Promise.resolve(localStorage.setItem(key, value));
|
|
56
|
+
},
|
|
57
|
+
removeItem: function removeItem(key) {
|
|
58
|
+
return Promise.resolve(localStorage.removeItem(key));
|
|
56
59
|
}
|
|
57
60
|
};
|
|
58
61
|
}
|
|
@@ -494,17 +497,23 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
|
|
|
494
497
|
return this.load('<@filekit.file>', id);
|
|
495
498
|
case 3:
|
|
496
499
|
response = _context11.sent;
|
|
500
|
+
if (response) {
|
|
501
|
+
_context11.next = 6;
|
|
502
|
+
break;
|
|
503
|
+
}
|
|
504
|
+
return _context11.abrupt("return", null);
|
|
505
|
+
case 6:
|
|
497
506
|
record = response.toRecord();
|
|
498
507
|
return _context11.abrupt("return", new _rbt_file["default"](record, this.axios, this.localDb));
|
|
499
|
-
case
|
|
500
|
-
_context11.prev =
|
|
508
|
+
case 10:
|
|
509
|
+
_context11.prev = 10;
|
|
501
510
|
_context11.t0 = _context11["catch"](0);
|
|
502
511
|
return _context11.abrupt("return", this._handleError(_context11.t0));
|
|
503
|
-
case
|
|
512
|
+
case 13:
|
|
504
513
|
case "end":
|
|
505
514
|
return _context11.stop();
|
|
506
515
|
}
|
|
507
|
-
}, _callee11, this, [[0,
|
|
516
|
+
}, _callee11, this, [[0, 10]]);
|
|
508
517
|
}));
|
|
509
518
|
function loadFile(_x7) {
|
|
510
519
|
return _loadFile.apply(this, arguments);
|
package/dist/esm/rbt_api.js
CHANGED
|
@@ -27,7 +27,8 @@ export default class RbtApi {
|
|
|
27
27
|
// browser based local storage
|
|
28
28
|
this.localStorageAdaptor = {
|
|
29
29
|
getItem: key => Promise.resolve(localStorage.getItem(key)),
|
|
30
|
-
setItem: (key, value) => Promise.resolve(localStorage.setItem(key, value))
|
|
30
|
+
setItem: (key, value) => Promise.resolve(localStorage.setItem(key, value)),
|
|
31
|
+
removeItem: key => Promise.resolve(localStorage.removeItem(key))
|
|
31
32
|
};
|
|
32
33
|
}
|
|
33
34
|
this.localDb = null;
|
|
@@ -229,6 +230,9 @@ export default class RbtApi {
|
|
|
229
230
|
//return this.create('<@filekit.file>', dataHash);
|
|
230
231
|
try {
|
|
231
232
|
const response = await this.load('<@filekit.file>', id);
|
|
233
|
+
if (!response) {
|
|
234
|
+
return null;
|
|
235
|
+
}
|
|
232
236
|
const record = response.toRecord();
|
|
233
237
|
return new RbtFile(record, this.axios, this.localDb);
|
|
234
238
|
} catch (e) {
|
package/package.json
CHANGED
package/src/rbt_api.js
CHANGED
|
@@ -27,6 +27,7 @@ export default class RbtApi {
|
|
|
27
27
|
this.localStorageAdaptor = {
|
|
28
28
|
getItem: (key) => Promise.resolve(localStorage.getItem(key)),
|
|
29
29
|
setItem: (key, value) => Promise.resolve(localStorage.setItem(key, value)),
|
|
30
|
+
removeItem: (key) => Promise.resolve(localStorage.removeItem(key))
|
|
30
31
|
};
|
|
31
32
|
}
|
|
32
33
|
this.localDb = null;
|
|
@@ -283,6 +284,9 @@ export default class RbtApi {
|
|
|
283
284
|
//return this.create('<@filekit.file>', dataHash);
|
|
284
285
|
try {
|
|
285
286
|
const response = await this.load('<@filekit.file>', id);
|
|
287
|
+
if(!response){
|
|
288
|
+
return null;
|
|
289
|
+
}
|
|
286
290
|
const record = response.toRecord();
|
|
287
291
|
return new RbtFile(record, this.axios, this.localDb);
|
|
288
292
|
|