parse 4.0.1 → 4.1.0-alpha.1
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/parse.js +17994 -26193
- package/dist/parse.min.js +2 -2
- package/dist/parse.weapp.js +8738 -17728
- package/dist/parse.weapp.min.js +2 -2
- package/lib/browser/Analytics.js +2 -20
- package/lib/browser/AnonymousUtils.js +6 -35
- package/lib/browser/Cloud.js +12 -70
- package/lib/browser/CloudCode.js +0 -3
- package/lib/browser/CoreManager.js +46 -184
- package/lib/browser/CryptoController.js +2 -16
- package/lib/browser/EventEmitter.js +1 -1
- package/lib/browser/EventuallyQueue.js +277 -824
- package/lib/browser/FacebookUtils.js +6 -35
- package/lib/browser/IndexedDBStorageController.js +3 -14
- package/lib/browser/InstallationController.js +2 -13
- package/lib/browser/LiveQueryClient.js +87 -204
- package/lib/browser/LiveQuerySubscription.js +10 -39
- package/lib/browser/LocalDatastore.js +451 -1081
- package/lib/browser/LocalDatastoreController.js +145 -602
- package/lib/browser/LocalDatastoreController.react-native.js +137 -573
- package/lib/browser/LocalDatastoreUtils.js +2 -12
- package/lib/browser/ObjectStateMutations.js +18 -121
- package/lib/browser/OfflineQuery.js +42 -222
- package/lib/browser/Parse.js +12 -106
- package/lib/browser/ParseACL.js +33 -141
- package/lib/browser/ParseCLP.js +96 -314
- package/lib/browser/ParseConfig.js +18 -88
- package/lib/browser/ParseError.js +63 -90
- package/lib/browser/ParseFile.js +128 -685
- package/lib/browser/ParseGeoPoint.js +23 -82
- package/lib/browser/ParseHooks.js +1 -34
- package/lib/browser/ParseInstallation.js +4 -32
- package/lib/browser/ParseLiveQuery.js +96 -505
- package/lib/browser/ParseObject.js +628 -1840
- package/lib/browser/ParseOp.js +41 -287
- package/lib/browser/ParsePolygon.js +13 -63
- package/lib/browser/ParseQuery.js +404 -1505
- package/lib/browser/ParseRelation.js +12 -61
- package/lib/browser/ParseRole.js +13 -75
- package/lib/browser/ParseSchema.js +49 -201
- package/lib/browser/ParseSession.js +11 -69
- package/lib/browser/ParseUser.js +274 -1127
- package/lib/browser/Push.js +7 -43
- package/lib/browser/RESTController.js +18 -140
- package/lib/browser/SingleInstanceStateController.js +19 -137
- package/lib/browser/Socket.weapp.js +2 -12
- package/lib/browser/Storage.js +10 -73
- package/lib/browser/StorageController.browser.js +4 -17
- package/lib/browser/StorageController.default.js +4 -17
- package/lib/browser/StorageController.react-native.js +6 -33
- package/lib/browser/StorageController.weapp.js +5 -16
- package/lib/browser/TaskQueue.js +1 -22
- package/lib/browser/UniqueInstanceStateController.js +19 -142
- package/lib/browser/Xhr.weapp.js +0 -17
- package/lib/browser/arrayContainsObject.js +2 -16
- package/lib/browser/canBeSerialized.js +3 -33
- package/lib/browser/decode.js +3 -33
- package/lib/browser/encode.js +9 -70
- package/lib/browser/equals.js +2 -25
- package/lib/browser/escape.js +1 -8
- package/lib/browser/isRevocableSession.js +2 -11
- package/lib/browser/parseDate.js +2 -13
- package/lib/browser/promiseUtils.js +3 -21
- package/lib/browser/unique.js +3 -17
- package/lib/browser/unsavedChildren.js +6 -50
- package/lib/browser/uuid.js +3 -1
- package/lib/node/Analytics.js +1 -18
- package/lib/node/AnonymousUtils.js +5 -37
- package/lib/node/Cloud.js +10 -66
- package/lib/node/CloudCode.js +0 -3
- package/lib/node/CoreManager.js +47 -220
- package/lib/node/CryptoController.js +2 -16
- package/lib/node/EventEmitter.js +1 -1
- package/lib/node/EventuallyQueue.js +16 -123
- package/lib/node/FacebookUtils.js +5 -37
- package/lib/node/IndexedDBStorageController.js +3 -19
- package/lib/node/InstallationController.js +2 -15
- package/lib/node/LiveQueryClient.js +56 -136
- package/lib/node/LiveQuerySubscription.js +7 -16
- package/lib/node/LocalDatastore.js +19 -175
- package/lib/node/LocalDatastoreController.js +6 -38
- package/lib/node/LocalDatastoreController.react-native.js +6 -45
- package/lib/node/LocalDatastoreUtils.js +1 -6
- package/lib/node/ObjectStateMutations.js +13 -93
- package/lib/node/OfflineQuery.js +20 -152
- package/lib/node/Parse.js +11 -99
- package/lib/node/ParseACL.js +32 -150
- package/lib/node/ParseCLP.js +69 -262
- package/lib/node/ParseConfig.js +16 -84
- package/lib/node/ParseError.js +61 -65
- package/lib/node/ParseFile.js +49 -205
- package/lib/node/ParseGeoPoint.js +21 -82
- package/lib/node/ParseHooks.js +0 -35
- package/lib/node/ParseInstallation.js +1 -10
- package/lib/node/ParseLiveQuery.js +10 -36
- package/lib/node/ParseObject.js +193 -939
- package/lib/node/ParseOp.js +31 -255
- package/lib/node/ParsePolygon.js +12 -62
- package/lib/node/ParseQuery.js +170 -882
- package/lib/node/ParseRelation.js +11 -61
- package/lib/node/ParseRole.js +10 -57
- package/lib/node/ParseSchema.js +46 -222
- package/lib/node/ParseSession.js +8 -50
- package/lib/node/ParseUser.js +107 -576
- package/lib/node/Push.js +4 -37
- package/lib/node/RESTController.js +8 -110
- package/lib/node/SingleInstanceStateController.js +17 -130
- package/lib/node/Socket.weapp.js +2 -9
- package/lib/node/Storage.js +10 -83
- package/lib/node/StorageController.browser.js +4 -23
- package/lib/node/StorageController.default.js +5 -21
- package/lib/node/StorageController.react-native.js +6 -40
- package/lib/node/StorageController.weapp.js +6 -21
- package/lib/node/TaskQueue.js +1 -17
- package/lib/node/UniqueInstanceStateController.js +16 -133
- package/lib/node/Xhr.weapp.js +0 -15
- package/lib/node/arrayContainsObject.js +1 -12
- package/lib/node/canBeSerialized.js +2 -28
- package/lib/node/decode.js +1 -26
- package/lib/node/encode.js +3 -54
- package/lib/node/equals.js +0 -18
- package/lib/node/escape.js +1 -6
- package/lib/node/isRevocableSession.js +1 -5
- package/lib/node/parseDate.js +1 -7
- package/lib/node/promiseUtils.js +2 -14
- package/lib/node/unique.js +1 -11
- package/lib/node/unsavedChildren.js +2 -38
- package/lib/node/uuid.js +6 -1
- package/lib/react-native/Analytics.js +0 -9
- package/lib/react-native/AnonymousUtils.js +0 -10
- package/lib/react-native/Cloud.js +0 -26
- package/lib/react-native/CoreManager.js +1 -5
- package/lib/react-native/CryptoController.js +0 -2
- package/lib/react-native/EventEmitter.js +0 -2
- package/lib/react-native/EventuallyQueue.js +4 -52
- package/lib/react-native/FacebookUtils.js +0 -22
- package/lib/react-native/IndexedDBStorageController.js +0 -1
- package/lib/react-native/InstallationController.js +0 -6
- package/lib/react-native/LiveQueryClient.js +24 -101
- package/lib/react-native/LiveQuerySubscription.js +3 -27
- package/lib/react-native/LocalDatastore.js +6 -113
- package/lib/react-native/LocalDatastoreController.js +0 -21
- package/lib/react-native/LocalDatastoreController.react-native.js +4 -31
- package/lib/react-native/LocalDatastoreUtils.js +0 -1
- package/lib/react-native/ObjectStateMutations.js +0 -34
- package/lib/react-native/OfflineQuery.js +2 -137
- package/lib/react-native/Parse.js +0 -65
- package/lib/react-native/ParseACL.js +0 -44
- package/lib/react-native/ParseCLP.js +32 -96
- package/lib/react-native/ParseConfig.js +0 -42
- package/lib/react-native/ParseError.js +1 -21
- package/lib/react-native/ParseFile.js +3 -72
- package/lib/react-native/ParseGeoPoint.js +0 -17
- package/lib/react-native/ParseHooks.js +0 -30
- package/lib/react-native/ParseInstallation.js +1 -23
- package/lib/react-native/ParseLiveQuery.js +3 -25
- package/lib/react-native/ParseObject.js +4 -371
- package/lib/react-native/ParseOp.js +1 -138
- package/lib/react-native/ParsePolygon.js +0 -24
- package/lib/react-native/ParseQuery.js +6 -262
- package/lib/react-native/ParseRelation.js +0 -25
- package/lib/react-native/ParseRole.js +1 -36
- package/lib/react-native/ParseSchema.js +0 -51
- package/lib/react-native/ParseSession.js +1 -40
- package/lib/react-native/ParseUser.js +1 -224
- package/lib/react-native/Push.js +0 -16
- package/lib/react-native/RESTController.js +1 -70
- package/lib/react-native/SingleInstanceStateController.js +0 -44
- package/lib/react-native/Socket.weapp.js +2 -12
- package/lib/react-native/Storage.js +0 -24
- package/lib/react-native/StorageController.browser.js +0 -2
- package/lib/react-native/StorageController.default.js +0 -1
- package/lib/react-native/StorageController.react-native.js +0 -2
- package/lib/react-native/TaskQueue.js +0 -15
- package/lib/react-native/UniqueInstanceStateController.js +0 -47
- package/lib/react-native/Xhr.weapp.js +0 -16
- package/lib/react-native/arrayContainsObject.js +0 -5
- package/lib/react-native/canBeSerialized.js +0 -18
- package/lib/react-native/decode.js +0 -21
- package/lib/react-native/encode.js +0 -25
- package/lib/react-native/equals.js +0 -18
- package/lib/react-native/escape.js +0 -1
- package/lib/react-native/isRevocableSession.js +0 -1
- package/lib/react-native/parseDate.js +0 -3
- package/lib/react-native/promiseUtils.js +0 -13
- package/lib/react-native/unique.js +0 -4
- package/lib/react-native/unsavedChildren.js +0 -21
- package/lib/react-native/uuid.js +3 -1
- package/lib/weapp/Analytics.js +2 -20
- package/lib/weapp/AnonymousUtils.js +6 -35
- package/lib/weapp/Cloud.js +12 -70
- package/lib/weapp/CloudCode.js +0 -3
- package/lib/weapp/CoreManager.js +46 -184
- package/lib/weapp/CryptoController.js +2 -16
- package/lib/weapp/EventEmitter.js +1 -1
- package/lib/weapp/EventuallyQueue.js +277 -824
- package/lib/weapp/FacebookUtils.js +6 -35
- package/lib/weapp/IndexedDBStorageController.js +3 -14
- package/lib/weapp/InstallationController.js +2 -13
- package/lib/weapp/LiveQueryClient.js +87 -204
- package/lib/weapp/LiveQuerySubscription.js +10 -39
- package/lib/weapp/LocalDatastore.js +451 -1081
- package/lib/weapp/LocalDatastoreController.js +145 -602
- package/lib/weapp/LocalDatastoreController.react-native.js +137 -573
- package/lib/weapp/LocalDatastoreUtils.js +2 -12
- package/lib/weapp/ObjectStateMutations.js +18 -121
- package/lib/weapp/OfflineQuery.js +42 -222
- package/lib/weapp/Parse.js +12 -106
- package/lib/weapp/ParseACL.js +33 -141
- package/lib/weapp/ParseCLP.js +96 -314
- package/lib/weapp/ParseConfig.js +18 -88
- package/lib/weapp/ParseError.js +63 -90
- package/lib/weapp/ParseFile.js +129 -686
- package/lib/weapp/ParseGeoPoint.js +23 -82
- package/lib/weapp/ParseHooks.js +1 -34
- package/lib/weapp/ParseInstallation.js +4 -32
- package/lib/weapp/ParseLiveQuery.js +96 -505
- package/lib/weapp/ParseObject.js +628 -1840
- package/lib/weapp/ParseOp.js +41 -287
- package/lib/weapp/ParsePolygon.js +13 -63
- package/lib/weapp/ParseQuery.js +404 -1505
- package/lib/weapp/ParseRelation.js +12 -61
- package/lib/weapp/ParseRole.js +13 -75
- package/lib/weapp/ParseSchema.js +49 -201
- package/lib/weapp/ParseSession.js +11 -69
- package/lib/weapp/ParseUser.js +274 -1127
- package/lib/weapp/Push.js +7 -43
- package/lib/weapp/RESTController.js +18 -140
- package/lib/weapp/SingleInstanceStateController.js +19 -137
- package/lib/weapp/Socket.weapp.js +2 -12
- package/lib/weapp/Storage.js +10 -73
- package/lib/weapp/StorageController.browser.js +4 -17
- package/lib/weapp/StorageController.default.js +4 -17
- package/lib/weapp/StorageController.react-native.js +6 -33
- package/lib/weapp/StorageController.weapp.js +5 -16
- package/lib/weapp/TaskQueue.js +1 -22
- package/lib/weapp/UniqueInstanceStateController.js +19 -142
- package/lib/weapp/Xhr.weapp.js +0 -17
- package/lib/weapp/arrayContainsObject.js +2 -16
- package/lib/weapp/canBeSerialized.js +3 -33
- package/lib/weapp/decode.js +3 -33
- package/lib/weapp/encode.js +9 -70
- package/lib/weapp/equals.js +2 -25
- package/lib/weapp/escape.js +1 -8
- package/lib/weapp/isRevocableSession.js +2 -11
- package/lib/weapp/parseDate.js +2 -13
- package/lib/weapp/promiseUtils.js +3 -21
- package/lib/weapp/unique.js +3 -17
- package/lib/weapp/unsavedChildren.js +6 -50
- package/lib/weapp/uuid.js +1 -6
- package/package.json +45 -43
|
@@ -1,612 +1,176 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
var _reverseInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/reverse");
|
|
8
|
-
|
|
9
|
-
var _Promise = require("@babel/runtime-corejs3/core-js-stable/promise");
|
|
10
|
-
|
|
11
|
-
var _Object$setPrototypeOf = require("@babel/runtime-corejs3/core-js-stable/object/set-prototype-of");
|
|
12
|
-
|
|
13
|
-
var _typeof = require("@babel/runtime-corejs3/helpers/typeof");
|
|
14
|
-
|
|
15
|
-
var _forEachInstanceProperty2 = require("@babel/runtime-corejs3/core-js-stable/instance/for-each");
|
|
16
|
-
|
|
17
|
-
var _Object$getPrototypeOf = require("@babel/runtime-corejs3/core-js-stable/object/get-prototype-of");
|
|
18
|
-
|
|
19
|
-
var _Object$create = require("@babel/runtime-corejs3/core-js-stable/object/create");
|
|
20
|
-
|
|
21
|
-
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
|
|
22
|
-
|
|
23
|
-
var _Symbol = require("@babel/runtime-corejs3/core-js-stable/symbol");
|
|
24
|
-
|
|
4
|
+
var _stringify = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/json/stringify"));
|
|
5
|
+
var _forEach = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/for-each"));
|
|
25
6
|
var _map = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/map"));
|
|
26
|
-
|
|
7
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime-corejs3/regenerator"));
|
|
27
8
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/slicedToArray"));
|
|
28
|
-
|
|
29
|
-
var _forEach = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/for-each"));
|
|
30
|
-
|
|
31
|
-
var _stringify = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/json/stringify"));
|
|
32
|
-
|
|
33
9
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/asyncToGenerator"));
|
|
34
|
-
|
|
35
10
|
var _LocalDatastoreUtils = require("./LocalDatastoreUtils");
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
_regeneratorRuntime = function () {
|
|
42
|
-
return exports;
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
var exports = {},
|
|
46
|
-
Op = Object.prototype,
|
|
47
|
-
hasOwn = Op.hasOwnProperty,
|
|
48
|
-
$Symbol = "function" == typeof _Symbol ? _Symbol : {},
|
|
49
|
-
iteratorSymbol = $Symbol.iterator || "@@iterator",
|
|
50
|
-
asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
|
|
51
|
-
toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
|
|
52
|
-
|
|
53
|
-
function define(obj, key, value) {
|
|
54
|
-
return _Object$defineProperty(obj, key, {
|
|
55
|
-
value: value,
|
|
56
|
-
enumerable: !0,
|
|
57
|
-
configurable: !0,
|
|
58
|
-
writable: !0
|
|
59
|
-
}), obj[key];
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
try {
|
|
63
|
-
define({}, "");
|
|
64
|
-
} catch (err) {
|
|
65
|
-
define = function (obj, key, value) {
|
|
66
|
-
return obj[key] = value;
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
function wrap(innerFn, outerFn, self, tryLocsList) {
|
|
71
|
-
var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
|
|
72
|
-
generator = _Object$create(protoGenerator.prototype),
|
|
73
|
-
context = new Context(tryLocsList || []);
|
|
74
|
-
|
|
75
|
-
return generator._invoke = function (innerFn, self, context) {
|
|
76
|
-
var state = "suspendedStart";
|
|
77
|
-
return function (method, arg) {
|
|
78
|
-
if ("executing" === state) throw new Error("Generator is already running");
|
|
79
|
-
|
|
80
|
-
if ("completed" === state) {
|
|
81
|
-
if ("throw" === method) throw arg;
|
|
82
|
-
return doneResult();
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
for (context.method = method, context.arg = arg;;) {
|
|
86
|
-
var delegate = context.delegate;
|
|
87
|
-
|
|
88
|
-
if (delegate) {
|
|
89
|
-
var delegateResult = maybeInvokeDelegate(delegate, context);
|
|
90
|
-
|
|
91
|
-
if (delegateResult) {
|
|
92
|
-
if (delegateResult === ContinueSentinel) continue;
|
|
93
|
-
return delegateResult;
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
|
|
98
|
-
if ("suspendedStart" === state) throw state = "completed", context.arg;
|
|
99
|
-
context.dispatchException(context.arg);
|
|
100
|
-
} else "return" === context.method && context.abrupt("return", context.arg);
|
|
101
|
-
state = "executing";
|
|
102
|
-
var record = tryCatch(innerFn, self, context);
|
|
103
|
-
|
|
104
|
-
if ("normal" === record.type) {
|
|
105
|
-
if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
|
|
106
|
-
return {
|
|
107
|
-
value: record.arg,
|
|
108
|
-
done: context.done
|
|
109
|
-
};
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
"throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
|
|
113
|
-
}
|
|
114
|
-
};
|
|
115
|
-
}(innerFn, self, context), generator;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
function tryCatch(fn, obj, arg) {
|
|
119
|
-
try {
|
|
120
|
-
return {
|
|
121
|
-
type: "normal",
|
|
122
|
-
arg: fn.call(obj, arg)
|
|
123
|
-
};
|
|
124
|
-
} catch (err) {
|
|
125
|
-
return {
|
|
126
|
-
type: "throw",
|
|
127
|
-
arg: err
|
|
128
|
-
};
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
exports.wrap = wrap;
|
|
133
|
-
var ContinueSentinel = {};
|
|
134
|
-
|
|
135
|
-
function Generator() {}
|
|
136
|
-
|
|
137
|
-
function GeneratorFunction() {}
|
|
138
|
-
|
|
139
|
-
function GeneratorFunctionPrototype() {}
|
|
140
|
-
|
|
141
|
-
var IteratorPrototype = {};
|
|
142
|
-
define(IteratorPrototype, iteratorSymbol, function () {
|
|
143
|
-
return this;
|
|
144
|
-
});
|
|
145
|
-
var getProto = _Object$getPrototypeOf,
|
|
146
|
-
NativeIteratorPrototype = getProto && getProto(getProto(values([])));
|
|
147
|
-
NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
|
|
148
|
-
|
|
149
|
-
var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = _Object$create(IteratorPrototype);
|
|
150
|
-
|
|
151
|
-
function defineIteratorMethods(prototype) {
|
|
152
|
-
var _context6;
|
|
153
|
-
|
|
154
|
-
_forEachInstanceProperty2(_context6 = ["next", "throw", "return"]).call(_context6, function (method) {
|
|
155
|
-
define(prototype, method, function (arg) {
|
|
156
|
-
return this._invoke(method, arg);
|
|
157
|
-
});
|
|
158
|
-
});
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
function AsyncIterator(generator, PromiseImpl) {
|
|
162
|
-
function invoke(method, arg, resolve, reject) {
|
|
163
|
-
var record = tryCatch(generator[method], generator, arg);
|
|
164
|
-
|
|
165
|
-
if ("throw" !== record.type) {
|
|
166
|
-
var result = record.arg,
|
|
167
|
-
value = result.value;
|
|
168
|
-
return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
|
|
169
|
-
invoke("next", value, resolve, reject);
|
|
170
|
-
}, function (err) {
|
|
171
|
-
invoke("throw", err, resolve, reject);
|
|
172
|
-
}) : PromiseImpl.resolve(value).then(function (unwrapped) {
|
|
173
|
-
result.value = unwrapped, resolve(result);
|
|
174
|
-
}, function (error) {
|
|
175
|
-
return invoke("throw", error, resolve, reject);
|
|
176
|
-
});
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
reject(record.arg);
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
var previousPromise;
|
|
183
|
-
|
|
184
|
-
this._invoke = function (method, arg) {
|
|
185
|
-
function callInvokeWithMethodAndArg() {
|
|
186
|
-
return new PromiseImpl(function (resolve, reject) {
|
|
187
|
-
invoke(method, arg, resolve, reject);
|
|
188
|
-
});
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
|
|
192
|
-
};
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
function maybeInvokeDelegate(delegate, context) {
|
|
196
|
-
var method = delegate.iterator[context.method];
|
|
197
|
-
|
|
198
|
-
if (undefined === method) {
|
|
199
|
-
if (context.delegate = null, "throw" === context.method) {
|
|
200
|
-
if (delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel;
|
|
201
|
-
context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method");
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
return ContinueSentinel;
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
var record = tryCatch(method, delegate.iterator, context.arg);
|
|
208
|
-
if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
|
|
209
|
-
var info = record.arg;
|
|
210
|
-
return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel);
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
function pushTryEntry(locs) {
|
|
214
|
-
var entry = {
|
|
215
|
-
tryLoc: locs[0]
|
|
216
|
-
};
|
|
217
|
-
1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
function resetTryEntry(entry) {
|
|
221
|
-
var record = entry.completion || {};
|
|
222
|
-
record.type = "normal", delete record.arg, entry.completion = record;
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
function Context(tryLocsList) {
|
|
226
|
-
this.tryEntries = [{
|
|
227
|
-
tryLoc: "root"
|
|
228
|
-
}], _forEachInstanceProperty2(tryLocsList).call(tryLocsList, pushTryEntry, this), this.reset(!0);
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
function values(iterable) {
|
|
232
|
-
if (iterable) {
|
|
233
|
-
var iteratorMethod = iterable[iteratorSymbol];
|
|
234
|
-
if (iteratorMethod) return iteratorMethod.call(iterable);
|
|
235
|
-
if ("function" == typeof iterable.next) return iterable;
|
|
236
|
-
|
|
237
|
-
if (!isNaN(iterable.length)) {
|
|
238
|
-
var i = -1,
|
|
239
|
-
next = function next() {
|
|
240
|
-
for (; ++i < iterable.length;) {
|
|
241
|
-
if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
return next.value = undefined, next.done = !0, next;
|
|
245
|
-
};
|
|
246
|
-
|
|
247
|
-
return next.next = next;
|
|
248
|
-
}
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
return {
|
|
252
|
-
next: doneResult
|
|
253
|
-
};
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
function doneResult() {
|
|
257
|
-
return {
|
|
258
|
-
value: undefined,
|
|
259
|
-
done: !0
|
|
260
|
-
};
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
|
|
264
|
-
var ctor = "function" == typeof genFun && genFun.constructor;
|
|
265
|
-
return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
|
|
266
|
-
}, exports.mark = function (genFun) {
|
|
267
|
-
return _Object$setPrototypeOf ? _Object$setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = _Object$create(Gp), genFun;
|
|
268
|
-
}, exports.awrap = function (arg) {
|
|
269
|
-
return {
|
|
270
|
-
__await: arg
|
|
271
|
-
};
|
|
272
|
-
}, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
|
|
273
|
-
return this;
|
|
274
|
-
}), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
|
|
275
|
-
void 0 === PromiseImpl && (PromiseImpl = _Promise);
|
|
276
|
-
var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
|
|
277
|
-
return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
|
|
278
|
-
return result.done ? result.value : iter.next();
|
|
279
|
-
});
|
|
280
|
-
}, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
|
|
281
|
-
return this;
|
|
282
|
-
}), define(Gp, "toString", function () {
|
|
283
|
-
return "[object Generator]";
|
|
284
|
-
}), exports.keys = function (object) {
|
|
285
|
-
var keys = [];
|
|
286
|
-
|
|
287
|
-
for (var key in object) {
|
|
288
|
-
keys.push(key);
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
return _reverseInstanceProperty(keys).call(keys), function next() {
|
|
292
|
-
for (; keys.length;) {
|
|
293
|
-
var key = keys.pop();
|
|
294
|
-
if (key in object) return next.value = key, next.done = !1, next;
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
return next.done = !0, next;
|
|
298
|
-
};
|
|
299
|
-
}, exports.values = values, Context.prototype = {
|
|
300
|
-
constructor: Context,
|
|
301
|
-
reset: function (skipTempReset) {
|
|
302
|
-
var _context7;
|
|
303
|
-
|
|
304
|
-
if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, _forEachInstanceProperty2(_context7 = this.tryEntries).call(_context7, resetTryEntry), !skipTempReset) for (var name in this) {
|
|
305
|
-
"t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+_sliceInstanceProperty(name).call(name, 1)) && (this[name] = undefined);
|
|
306
|
-
}
|
|
307
|
-
},
|
|
308
|
-
stop: function () {
|
|
309
|
-
this.done = !0;
|
|
310
|
-
var rootRecord = this.tryEntries[0].completion;
|
|
311
|
-
if ("throw" === rootRecord.type) throw rootRecord.arg;
|
|
312
|
-
return this.rval;
|
|
313
|
-
},
|
|
314
|
-
dispatchException: function (exception) {
|
|
315
|
-
if (this.done) throw exception;
|
|
316
|
-
var context = this;
|
|
317
|
-
|
|
318
|
-
function handle(loc, caught) {
|
|
319
|
-
return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
323
|
-
var entry = this.tryEntries[i],
|
|
324
|
-
record = entry.completion;
|
|
325
|
-
if ("root" === entry.tryLoc) return handle("end");
|
|
326
|
-
|
|
327
|
-
if (entry.tryLoc <= this.prev) {
|
|
328
|
-
var hasCatch = hasOwn.call(entry, "catchLoc"),
|
|
329
|
-
hasFinally = hasOwn.call(entry, "finallyLoc");
|
|
330
|
-
|
|
331
|
-
if (hasCatch && hasFinally) {
|
|
332
|
-
if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
|
|
333
|
-
if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
|
|
334
|
-
} else if (hasCatch) {
|
|
335
|
-
if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
|
|
336
|
-
} else {
|
|
337
|
-
if (!hasFinally) throw new Error("try statement without catch or finally");
|
|
338
|
-
if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
|
|
339
|
-
}
|
|
340
|
-
}
|
|
341
|
-
}
|
|
342
|
-
},
|
|
343
|
-
abrupt: function (type, arg) {
|
|
344
|
-
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
345
|
-
var entry = this.tryEntries[i];
|
|
346
|
-
|
|
347
|
-
if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
|
|
348
|
-
var finallyEntry = entry;
|
|
349
|
-
break;
|
|
350
|
-
}
|
|
351
|
-
}
|
|
352
|
-
|
|
353
|
-
finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
|
|
354
|
-
var record = finallyEntry ? finallyEntry.completion : {};
|
|
355
|
-
return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
|
|
356
|
-
},
|
|
357
|
-
complete: function (record, afterLoc) {
|
|
358
|
-
if ("throw" === record.type) throw record.arg;
|
|
359
|
-
return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;
|
|
360
|
-
},
|
|
361
|
-
finish: function (finallyLoc) {
|
|
362
|
-
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
363
|
-
var entry = this.tryEntries[i];
|
|
364
|
-
if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
|
|
365
|
-
}
|
|
366
|
-
},
|
|
367
|
-
catch: function (tryLoc) {
|
|
368
|
-
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
369
|
-
var entry = this.tryEntries[i];
|
|
370
|
-
|
|
371
|
-
if (entry.tryLoc === tryLoc) {
|
|
372
|
-
var record = entry.completion;
|
|
373
|
-
|
|
374
|
-
if ("throw" === record.type) {
|
|
375
|
-
var thrown = record.arg;
|
|
376
|
-
resetTryEntry(entry);
|
|
377
|
-
}
|
|
378
|
-
|
|
379
|
-
return thrown;
|
|
380
|
-
}
|
|
381
|
-
}
|
|
382
|
-
|
|
383
|
-
throw new Error("illegal catch attempt");
|
|
384
|
-
},
|
|
385
|
-
delegateYield: function (iterable, resultName, nextLoc) {
|
|
386
|
-
return this.delegate = {
|
|
387
|
-
iterator: values(iterable),
|
|
388
|
-
resultName: resultName,
|
|
389
|
-
nextLoc: nextLoc
|
|
390
|
-
}, "next" === this.method && (this.arg = undefined), ContinueSentinel;
|
|
391
|
-
}
|
|
392
|
-
}, exports;
|
|
393
|
-
}
|
|
11
|
+
/**
|
|
12
|
+
* @flow
|
|
13
|
+
* @private
|
|
14
|
+
*/
|
|
394
15
|
|
|
395
16
|
var RNStorage = require('./StorageController.react-native');
|
|
396
|
-
|
|
397
17
|
var LocalDatastoreController = {
|
|
398
|
-
fromPinWithName: function (name
|
|
399
|
-
|
|
400
|
-
)
|
|
401
|
-
/*: Promise<Array<Object>>*/
|
|
402
|
-
{
|
|
403
|
-
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
18
|
+
fromPinWithName: function (name /*: string*/) /*: Promise<Array<Object>>*/{
|
|
19
|
+
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
404
20
|
var values, objects;
|
|
405
|
-
return
|
|
406
|
-
while (1) {
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
objects = JSON.parse(values);
|
|
424
|
-
return _context.abrupt("return", objects);
|
|
425
|
-
|
|
426
|
-
case 7:
|
|
427
|
-
case "end":
|
|
428
|
-
return _context.stop();
|
|
429
|
-
}
|
|
21
|
+
return _regenerator.default.wrap(function (_context) {
|
|
22
|
+
while (1) switch (_context.prev = _context.next) {
|
|
23
|
+
case 0:
|
|
24
|
+
_context.next = 2;
|
|
25
|
+
return RNStorage.getItemAsync(name);
|
|
26
|
+
case 2:
|
|
27
|
+
values = _context.sent;
|
|
28
|
+
if (values) {
|
|
29
|
+
_context.next = 5;
|
|
30
|
+
break;
|
|
31
|
+
}
|
|
32
|
+
return _context.abrupt("return", []);
|
|
33
|
+
case 5:
|
|
34
|
+
objects = JSON.parse(values);
|
|
35
|
+
return _context.abrupt("return", objects);
|
|
36
|
+
case 7:
|
|
37
|
+
case "end":
|
|
38
|
+
return _context.stop();
|
|
430
39
|
}
|
|
431
40
|
}, _callee);
|
|
432
41
|
}))();
|
|
433
42
|
},
|
|
434
|
-
pinWithName: function
|
|
435
|
-
|
|
436
|
-
, value
|
|
437
|
-
/*: any*/
|
|
438
|
-
)
|
|
439
|
-
/*: Promise<void>*/
|
|
440
|
-
{
|
|
441
|
-
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
43
|
+
pinWithName: function (name /*: string*/, value /*: any*/) /*: Promise<void>*/{
|
|
44
|
+
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
|
|
442
45
|
var values;
|
|
443
|
-
return
|
|
444
|
-
while (1) {
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
case 9:
|
|
463
|
-
case "end":
|
|
464
|
-
return _context2.stop();
|
|
465
|
-
}
|
|
46
|
+
return _regenerator.default.wrap(function (_context2) {
|
|
47
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
48
|
+
case 0:
|
|
49
|
+
_context2.prev = 0;
|
|
50
|
+
values = (0, _stringify.default)(value);
|
|
51
|
+
_context2.next = 4;
|
|
52
|
+
return RNStorage.setItemAsync(name, values);
|
|
53
|
+
case 4:
|
|
54
|
+
_context2.next = 9;
|
|
55
|
+
break;
|
|
56
|
+
case 6:
|
|
57
|
+
_context2.prev = 6;
|
|
58
|
+
_context2.t0 = _context2["catch"](0);
|
|
59
|
+
// Quota exceeded, possibly due to Safari Private Browsing mode
|
|
60
|
+
console.error(_context2.t0.message);
|
|
61
|
+
case 9:
|
|
62
|
+
case "end":
|
|
63
|
+
return _context2.stop();
|
|
466
64
|
}
|
|
467
65
|
}, _callee2, null, [[0, 6]]);
|
|
468
66
|
}))();
|
|
469
67
|
},
|
|
470
|
-
unPinWithName: function
|
|
471
|
-
/*: string*/
|
|
472
|
-
)
|
|
473
|
-
/*: Promise<void>*/
|
|
474
|
-
{
|
|
68
|
+
unPinWithName: function (name /*: string*/) /*: Promise<void>*/{
|
|
475
69
|
return RNStorage.removeItemAsync(name);
|
|
476
70
|
},
|
|
477
|
-
getAllContents: function
|
|
478
|
-
|
|
479
|
-
{
|
|
480
|
-
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
71
|
+
getAllContents: function () /*: Promise<Object>*/{
|
|
72
|
+
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
|
|
481
73
|
var keys, batch, i, key, LDS, results;
|
|
482
|
-
return
|
|
483
|
-
while (1) {
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
key = keys[i];
|
|
495
|
-
|
|
496
|
-
if ((0, _LocalDatastoreUtils.isLocalDatastoreKey)(key)) {
|
|
497
|
-
batch.push(key);
|
|
498
|
-
}
|
|
74
|
+
return _regenerator.default.wrap(function (_context3) {
|
|
75
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
76
|
+
case 0:
|
|
77
|
+
_context3.next = 2;
|
|
78
|
+
return RNStorage.getAllKeysAsync();
|
|
79
|
+
case 2:
|
|
80
|
+
keys = _context3.sent;
|
|
81
|
+
batch = [];
|
|
82
|
+
for (i = 0; i < keys.length; i += 1) {
|
|
83
|
+
key = keys[i];
|
|
84
|
+
if ((0, _LocalDatastoreUtils.isLocalDatastoreKey)(key)) {
|
|
85
|
+
batch.push(key);
|
|
499
86
|
}
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
return _context3.abrupt("return", LDS);
|
|
531
|
-
|
|
532
|
-
case 19:
|
|
533
|
-
case "end":
|
|
534
|
-
return _context3.stop();
|
|
535
|
-
}
|
|
87
|
+
}
|
|
88
|
+
LDS = {};
|
|
89
|
+
results = [];
|
|
90
|
+
_context3.prev = 7;
|
|
91
|
+
_context3.next = 10;
|
|
92
|
+
return RNStorage.multiGet(batch);
|
|
93
|
+
case 10:
|
|
94
|
+
results = _context3.sent;
|
|
95
|
+
_context3.next = 17;
|
|
96
|
+
break;
|
|
97
|
+
case 13:
|
|
98
|
+
_context3.prev = 13;
|
|
99
|
+
_context3.t0 = _context3["catch"](7);
|
|
100
|
+
console.error('Error getAllContents: ', _context3.t0);
|
|
101
|
+
return _context3.abrupt("return", {});
|
|
102
|
+
case 17:
|
|
103
|
+
(0, _forEach.default)(results).call(results, function (pair) {
|
|
104
|
+
var _pair = (0, _slicedToArray2.default)(pair, 2),
|
|
105
|
+
key = _pair[0],
|
|
106
|
+
value = _pair[1];
|
|
107
|
+
try {
|
|
108
|
+
LDS[key] = JSON.parse(value);
|
|
109
|
+
} catch (error) {
|
|
110
|
+
LDS[key] = null;
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
return _context3.abrupt("return", LDS);
|
|
114
|
+
case 19:
|
|
115
|
+
case "end":
|
|
116
|
+
return _context3.stop();
|
|
536
117
|
}
|
|
537
118
|
}, _callee3, null, [[7, 13]]);
|
|
538
119
|
}))();
|
|
539
120
|
},
|
|
540
121
|
// Used for testing
|
|
541
|
-
getRawStorage: function
|
|
542
|
-
|
|
543
|
-
{
|
|
544
|
-
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
|
122
|
+
getRawStorage: function () /*: Promise<Object>*/{
|
|
123
|
+
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4() {
|
|
545
124
|
var keys, storage, results;
|
|
546
|
-
return
|
|
547
|
-
while (1) {
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
return _context4.abrupt("return", storage);
|
|
569
|
-
|
|
570
|
-
case 9:
|
|
571
|
-
case "end":
|
|
572
|
-
return _context4.stop();
|
|
573
|
-
}
|
|
125
|
+
return _regenerator.default.wrap(function (_context4) {
|
|
126
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
127
|
+
case 0:
|
|
128
|
+
_context4.next = 2;
|
|
129
|
+
return RNStorage.getAllKeysAsync();
|
|
130
|
+
case 2:
|
|
131
|
+
keys = _context4.sent;
|
|
132
|
+
storage = {};
|
|
133
|
+
_context4.next = 6;
|
|
134
|
+
return RNStorage.multiGet(keys);
|
|
135
|
+
case 6:
|
|
136
|
+
results = _context4.sent;
|
|
137
|
+
(0, _map.default)(results).call(results, function (pair) {
|
|
138
|
+
var _pair2 = (0, _slicedToArray2.default)(pair, 2),
|
|
139
|
+
key = _pair2[0],
|
|
140
|
+
value = _pair2[1];
|
|
141
|
+
storage[key] = value;
|
|
142
|
+
});
|
|
143
|
+
return _context4.abrupt("return", storage);
|
|
144
|
+
case 9:
|
|
145
|
+
case "end":
|
|
146
|
+
return _context4.stop();
|
|
574
147
|
}
|
|
575
148
|
}, _callee4);
|
|
576
149
|
}))();
|
|
577
150
|
},
|
|
578
|
-
clear: function
|
|
579
|
-
|
|
580
|
-
{
|
|
581
|
-
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
|
|
151
|
+
clear: function () /*: Promise<void>*/{
|
|
152
|
+
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5() {
|
|
582
153
|
var keys, batch, i, key;
|
|
583
|
-
return
|
|
584
|
-
while (1) {
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
key = keys[i];
|
|
596
|
-
|
|
597
|
-
if ((0, _LocalDatastoreUtils.isLocalDatastoreKey)(key)) {
|
|
598
|
-
batch.push(key);
|
|
599
|
-
}
|
|
154
|
+
return _regenerator.default.wrap(function (_context5) {
|
|
155
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
156
|
+
case 0:
|
|
157
|
+
_context5.next = 2;
|
|
158
|
+
return RNStorage.getAllKeysAsync();
|
|
159
|
+
case 2:
|
|
160
|
+
keys = _context5.sent;
|
|
161
|
+
batch = [];
|
|
162
|
+
for (i = 0; i < keys.length; i += 1) {
|
|
163
|
+
key = keys[i];
|
|
164
|
+
if ((0, _LocalDatastoreUtils.isLocalDatastoreKey)(key)) {
|
|
165
|
+
batch.push(key);
|
|
600
166
|
}
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
return _context5.stop();
|
|
609
|
-
}
|
|
167
|
+
}
|
|
168
|
+
return _context5.abrupt("return", RNStorage.multiRemove(batch).catch(function (error) {
|
|
169
|
+
return console.error('Error clearing local datastore: ', error);
|
|
170
|
+
}));
|
|
171
|
+
case 6:
|
|
172
|
+
case "end":
|
|
173
|
+
return _context5.stop();
|
|
610
174
|
}
|
|
611
175
|
}, _callee5);
|
|
612
176
|
}))();
|