datastore-api 4.0.3 → 6.0.0
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/README.md +3 -2
- package/dist/datastore-api.cjs.development.js +205 -209
- package/dist/datastore-api.cjs.development.js.map +1 -1
- package/dist/datastore-api.cjs.production.min.js +1 -1
- package/dist/datastore-api.cjs.production.min.js.map +1 -1
- package/dist/datastore-api.esm.js +205 -209
- package/dist/datastore-api.esm.js.map +1 -1
- package/dist/lib/dstore-api.d.ts +1 -3
- package/package.json +19 -20
- package/src/lib/dstore-api.ts +3 -4
package/README.md
CHANGED
|
@@ -34,7 +34,7 @@ See [the API documentation](http://mdornseif.github.io/datastore-api/classes/Dst
|
|
|
34
34
|
- The Javascript-Datastore Bindings use nanosecond-Timestamp Information stored in the Datasore and rounds it to milliseconds. Python at least retains microseconds.
|
|
35
35
|
- the old `get_entity_group_version()` / `getEntityGroupVersion()` API has been retired. You can still for `key` query `{ path: [key.path[0], {'kind': '__entity_group__', 'id': 1}]}` to get a `__version__` property. The reliability of this data on FireStore is unknown.
|
|
36
36
|
- Googles Javascript API decided to use `[Symbol(KEY)]` to represent the Key in an entity. This results in all kinds of confusion when serializing to JSON, e.g. for caching. This library adds the property `_keyStr` which will be transparently used to regenerate `[Symbol(KEY)]` when needed.
|
|
37
|
-
- Many functions are somewhat polymorphic where the shape of the return value depends on the function parameters, e.g. if the API was called with a key or a list of keys. You are encouraged to alvais provide a list of parameters instead a single parameter, e.g. `get([key])`
|
|
37
|
+
- Many functions are somewhat polymorphic where the shape of the return value depends on the function parameters, e.g. if the API was called with a key or a list of keys. You are encouraged to alvais provide a list of parameters instead a single parameter, e.g. `get([key])` instead of `get(key)`.
|
|
38
38
|
- `insert()` and `save()` sometimes return the key being written and sometimes not. So you might or might not get some data in `insertResponse?.[0].mutationResults?.[0]?.key?.path` - urgs.
|
|
39
39
|
- Google avoids [BigInt](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt). So `key.id` is (usually but not always) returned as a String but you have to provide a Number to the API.
|
|
40
40
|
|
|
@@ -66,7 +66,7 @@ server.get('/metrics', async (req, res) => {
|
|
|
66
66
|
- Other [Hidden Auto-Generated Datastore API Documentation](https://googleapis.dev/nodejs/datastore/latest/) with better navigation. Seems to contain more on the lower level access.
|
|
67
67
|
- [SDK Source](https://github.com/googleapis/nodejs-datastore)
|
|
68
68
|
- [API reference](https://cloud.google.com/datastore/docs/reference/data/rpc) helps to understand under-documented SDK.
|
|
69
|
-
- [grpc-js environment variables](https://github.com/grpc/grpc-node/blob/master/doc/environment_variables.md) - try [GRPC_VERBOSITY=DEBUG GRPC_TRACE=all
|
|
69
|
+
- [grpc-js environment variables](https://github.com/grpc/grpc-node/blob/master/doc/environment_variables.md) - try [GRPC_VERBOSITY=DEBUG GRPC_TRACE=all npm run test](https://github.com/grpc/grpc-node/blob/master/TROUBLESHOOTING.md)
|
|
70
70
|
|
|
71
71
|
- API Simplification
|
|
72
72
|
- [google-cloud-datastore-node](https://www.npmjs.com/package/google-cloud-datastore-node)
|
|
@@ -79,6 +79,7 @@ server.get('/metrics', async (req, res) => {
|
|
|
79
79
|
- [google-cloud-kvstore](https://www.npmjs.com/package/google-cloud-kvstore)
|
|
80
80
|
- [datastore-entity](https://github.com/aubrian-halili/datastore-entity#readme)
|
|
81
81
|
- For debugging
|
|
82
|
+
|
|
82
83
|
- [dsadmin](https://github.com/remko/dsadmin) - `npx dsadmin --project=projectid`
|
|
83
84
|
- [google-datastore-emulator for node](https://github.com/ert78gb/google-datastore-emulator)
|
|
84
85
|
|
|
@@ -12,304 +12,304 @@ var promClient = require('prom-client');
|
|
|
12
12
|
|
|
13
13
|
function _regeneratorRuntime() {
|
|
14
14
|
_regeneratorRuntime = function () {
|
|
15
|
-
return
|
|
15
|
+
return exports;
|
|
16
16
|
};
|
|
17
|
-
var
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
t[e] = r.value;
|
|
17
|
+
var exports = {},
|
|
18
|
+
Op = Object.prototype,
|
|
19
|
+
hasOwn = Op.hasOwnProperty,
|
|
20
|
+
defineProperty = Object.defineProperty || function (obj, key, desc) {
|
|
21
|
+
obj[key] = desc.value;
|
|
23
22
|
},
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
function define(
|
|
29
|
-
return Object.defineProperty(
|
|
30
|
-
value:
|
|
23
|
+
$Symbol = "function" == typeof Symbol ? Symbol : {},
|
|
24
|
+
iteratorSymbol = $Symbol.iterator || "@@iterator",
|
|
25
|
+
asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
|
|
26
|
+
toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
|
|
27
|
+
function define(obj, key, value) {
|
|
28
|
+
return Object.defineProperty(obj, key, {
|
|
29
|
+
value: value,
|
|
31
30
|
enumerable: !0,
|
|
32
31
|
configurable: !0,
|
|
33
32
|
writable: !0
|
|
34
|
-
}),
|
|
33
|
+
}), obj[key];
|
|
35
34
|
}
|
|
36
35
|
try {
|
|
37
36
|
define({}, "");
|
|
38
|
-
} catch (
|
|
39
|
-
define = function (
|
|
40
|
-
return
|
|
37
|
+
} catch (err) {
|
|
38
|
+
define = function (obj, key, value) {
|
|
39
|
+
return obj[key] = value;
|
|
41
40
|
};
|
|
42
41
|
}
|
|
43
|
-
function wrap(
|
|
44
|
-
var
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
return
|
|
48
|
-
value: makeInvokeMethod(
|
|
49
|
-
}),
|
|
42
|
+
function wrap(innerFn, outerFn, self, tryLocsList) {
|
|
43
|
+
var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
|
|
44
|
+
generator = Object.create(protoGenerator.prototype),
|
|
45
|
+
context = new Context(tryLocsList || []);
|
|
46
|
+
return defineProperty(generator, "_invoke", {
|
|
47
|
+
value: makeInvokeMethod(innerFn, self, context)
|
|
48
|
+
}), generator;
|
|
50
49
|
}
|
|
51
|
-
function tryCatch(
|
|
50
|
+
function tryCatch(fn, obj, arg) {
|
|
52
51
|
try {
|
|
53
52
|
return {
|
|
54
53
|
type: "normal",
|
|
55
|
-
arg:
|
|
54
|
+
arg: fn.call(obj, arg)
|
|
56
55
|
};
|
|
57
|
-
} catch (
|
|
56
|
+
} catch (err) {
|
|
58
57
|
return {
|
|
59
58
|
type: "throw",
|
|
60
|
-
arg:
|
|
59
|
+
arg: err
|
|
61
60
|
};
|
|
62
61
|
}
|
|
63
62
|
}
|
|
64
|
-
|
|
65
|
-
var
|
|
66
|
-
l = "suspendedYield",
|
|
67
|
-
f = "executing",
|
|
68
|
-
s = "completed",
|
|
69
|
-
y = {};
|
|
63
|
+
exports.wrap = wrap;
|
|
64
|
+
var ContinueSentinel = {};
|
|
70
65
|
function Generator() {}
|
|
71
66
|
function GeneratorFunction() {}
|
|
72
67
|
function GeneratorFunctionPrototype() {}
|
|
73
|
-
var
|
|
74
|
-
define(
|
|
68
|
+
var IteratorPrototype = {};
|
|
69
|
+
define(IteratorPrototype, iteratorSymbol, function () {
|
|
75
70
|
return this;
|
|
76
71
|
});
|
|
77
|
-
var
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
var
|
|
81
|
-
function defineIteratorMethods(
|
|
82
|
-
["next", "throw", "return"].forEach(function (
|
|
83
|
-
define(
|
|
84
|
-
return this._invoke(
|
|
72
|
+
var getProto = Object.getPrototypeOf,
|
|
73
|
+
NativeIteratorPrototype = getProto && getProto(getProto(values([])));
|
|
74
|
+
NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
|
|
75
|
+
var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
|
|
76
|
+
function defineIteratorMethods(prototype) {
|
|
77
|
+
["next", "throw", "return"].forEach(function (method) {
|
|
78
|
+
define(prototype, method, function (arg) {
|
|
79
|
+
return this._invoke(method, arg);
|
|
85
80
|
});
|
|
86
81
|
});
|
|
87
82
|
}
|
|
88
|
-
function AsyncIterator(
|
|
89
|
-
function invoke(
|
|
90
|
-
var
|
|
91
|
-
if ("throw" !==
|
|
92
|
-
var
|
|
93
|
-
|
|
94
|
-
return
|
|
95
|
-
invoke("next",
|
|
96
|
-
}, function (
|
|
97
|
-
invoke("throw",
|
|
98
|
-
}) :
|
|
99
|
-
|
|
100
|
-
}, function (
|
|
101
|
-
return invoke("throw",
|
|
83
|
+
function AsyncIterator(generator, PromiseImpl) {
|
|
84
|
+
function invoke(method, arg, resolve, reject) {
|
|
85
|
+
var record = tryCatch(generator[method], generator, arg);
|
|
86
|
+
if ("throw" !== record.type) {
|
|
87
|
+
var result = record.arg,
|
|
88
|
+
value = result.value;
|
|
89
|
+
return value && "object" == typeof value && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
|
|
90
|
+
invoke("next", value, resolve, reject);
|
|
91
|
+
}, function (err) {
|
|
92
|
+
invoke("throw", err, resolve, reject);
|
|
93
|
+
}) : PromiseImpl.resolve(value).then(function (unwrapped) {
|
|
94
|
+
result.value = unwrapped, resolve(result);
|
|
95
|
+
}, function (error) {
|
|
96
|
+
return invoke("throw", error, resolve, reject);
|
|
102
97
|
});
|
|
103
98
|
}
|
|
104
|
-
|
|
99
|
+
reject(record.arg);
|
|
105
100
|
}
|
|
106
|
-
var
|
|
107
|
-
|
|
108
|
-
value: function (
|
|
101
|
+
var previousPromise;
|
|
102
|
+
defineProperty(this, "_invoke", {
|
|
103
|
+
value: function (method, arg) {
|
|
109
104
|
function callInvokeWithMethodAndArg() {
|
|
110
|
-
return new
|
|
111
|
-
invoke(
|
|
105
|
+
return new PromiseImpl(function (resolve, reject) {
|
|
106
|
+
invoke(method, arg, resolve, reject);
|
|
112
107
|
});
|
|
113
108
|
}
|
|
114
|
-
return
|
|
109
|
+
return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
|
|
115
110
|
}
|
|
116
111
|
});
|
|
117
112
|
}
|
|
118
|
-
function makeInvokeMethod(
|
|
119
|
-
var
|
|
120
|
-
return function (
|
|
121
|
-
if (
|
|
122
|
-
if (
|
|
123
|
-
if ("throw" ===
|
|
124
|
-
return
|
|
125
|
-
value: t,
|
|
126
|
-
done: !0
|
|
127
|
-
};
|
|
113
|
+
function makeInvokeMethod(innerFn, self, context) {
|
|
114
|
+
var state = "suspendedStart";
|
|
115
|
+
return function (method, arg) {
|
|
116
|
+
if ("executing" === state) throw new Error("Generator is already running");
|
|
117
|
+
if ("completed" === state) {
|
|
118
|
+
if ("throw" === method) throw arg;
|
|
119
|
+
return doneResult();
|
|
128
120
|
}
|
|
129
|
-
for (
|
|
130
|
-
var
|
|
131
|
-
if (
|
|
132
|
-
var
|
|
133
|
-
if (
|
|
134
|
-
if (
|
|
135
|
-
return
|
|
121
|
+
for (context.method = method, context.arg = arg;;) {
|
|
122
|
+
var delegate = context.delegate;
|
|
123
|
+
if (delegate) {
|
|
124
|
+
var delegateResult = maybeInvokeDelegate(delegate, context);
|
|
125
|
+
if (delegateResult) {
|
|
126
|
+
if (delegateResult === ContinueSentinel) continue;
|
|
127
|
+
return delegateResult;
|
|
136
128
|
}
|
|
137
129
|
}
|
|
138
|
-
if ("next" ===
|
|
139
|
-
if (
|
|
140
|
-
|
|
141
|
-
} else "return" ===
|
|
142
|
-
|
|
143
|
-
var
|
|
144
|
-
if ("normal" ===
|
|
145
|
-
if (
|
|
130
|
+
if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
|
|
131
|
+
if ("suspendedStart" === state) throw state = "completed", context.arg;
|
|
132
|
+
context.dispatchException(context.arg);
|
|
133
|
+
} else "return" === context.method && context.abrupt("return", context.arg);
|
|
134
|
+
state = "executing";
|
|
135
|
+
var record = tryCatch(innerFn, self, context);
|
|
136
|
+
if ("normal" === record.type) {
|
|
137
|
+
if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
|
|
146
138
|
return {
|
|
147
|
-
value:
|
|
148
|
-
done:
|
|
139
|
+
value: record.arg,
|
|
140
|
+
done: context.done
|
|
149
141
|
};
|
|
150
142
|
}
|
|
151
|
-
"throw" ===
|
|
143
|
+
"throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
|
|
152
144
|
}
|
|
153
145
|
};
|
|
154
146
|
}
|
|
155
|
-
function maybeInvokeDelegate(
|
|
156
|
-
var
|
|
157
|
-
|
|
158
|
-
if (
|
|
159
|
-
var
|
|
160
|
-
if ("throw" ===
|
|
161
|
-
var
|
|
162
|
-
return
|
|
147
|
+
function maybeInvokeDelegate(delegate, context) {
|
|
148
|
+
var methodName = context.method,
|
|
149
|
+
method = delegate.iterator[methodName];
|
|
150
|
+
if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel;
|
|
151
|
+
var record = tryCatch(method, delegate.iterator, context.arg);
|
|
152
|
+
if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
|
|
153
|
+
var info = record.arg;
|
|
154
|
+
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);
|
|
163
155
|
}
|
|
164
|
-
function pushTryEntry(
|
|
165
|
-
var
|
|
166
|
-
tryLoc:
|
|
156
|
+
function pushTryEntry(locs) {
|
|
157
|
+
var entry = {
|
|
158
|
+
tryLoc: locs[0]
|
|
167
159
|
};
|
|
168
|
-
1 in
|
|
160
|
+
1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
|
|
169
161
|
}
|
|
170
|
-
function resetTryEntry(
|
|
171
|
-
var
|
|
172
|
-
|
|
162
|
+
function resetTryEntry(entry) {
|
|
163
|
+
var record = entry.completion || {};
|
|
164
|
+
record.type = "normal", delete record.arg, entry.completion = record;
|
|
173
165
|
}
|
|
174
|
-
function Context(
|
|
166
|
+
function Context(tryLocsList) {
|
|
175
167
|
this.tryEntries = [{
|
|
176
168
|
tryLoc: "root"
|
|
177
|
-
}],
|
|
169
|
+
}], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
|
|
178
170
|
}
|
|
179
|
-
function values(
|
|
180
|
-
if (
|
|
181
|
-
var
|
|
182
|
-
if (
|
|
183
|
-
if ("function" == typeof
|
|
184
|
-
if (!isNaN(
|
|
185
|
-
var
|
|
186
|
-
|
|
187
|
-
for (; ++
|
|
188
|
-
return next.value =
|
|
171
|
+
function values(iterable) {
|
|
172
|
+
if (iterable) {
|
|
173
|
+
var iteratorMethod = iterable[iteratorSymbol];
|
|
174
|
+
if (iteratorMethod) return iteratorMethod.call(iterable);
|
|
175
|
+
if ("function" == typeof iterable.next) return iterable;
|
|
176
|
+
if (!isNaN(iterable.length)) {
|
|
177
|
+
var i = -1,
|
|
178
|
+
next = function next() {
|
|
179
|
+
for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
|
|
180
|
+
return next.value = undefined, next.done = !0, next;
|
|
189
181
|
};
|
|
190
|
-
return
|
|
182
|
+
return next.next = next;
|
|
191
183
|
}
|
|
192
184
|
}
|
|
193
|
-
|
|
185
|
+
return {
|
|
186
|
+
next: doneResult
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
function doneResult() {
|
|
190
|
+
return {
|
|
191
|
+
value: undefined,
|
|
192
|
+
done: !0
|
|
193
|
+
};
|
|
194
194
|
}
|
|
195
|
-
return GeneratorFunction.prototype = GeneratorFunctionPrototype,
|
|
195
|
+
return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", {
|
|
196
196
|
value: GeneratorFunctionPrototype,
|
|
197
197
|
configurable: !0
|
|
198
|
-
}),
|
|
198
|
+
}), defineProperty(GeneratorFunctionPrototype, "constructor", {
|
|
199
199
|
value: GeneratorFunction,
|
|
200
200
|
configurable: !0
|
|
201
|
-
}), GeneratorFunction.displayName = define(GeneratorFunctionPrototype,
|
|
202
|
-
var
|
|
203
|
-
return !!
|
|
204
|
-
},
|
|
205
|
-
return Object.setPrototypeOf ? Object.setPrototypeOf(
|
|
206
|
-
},
|
|
201
|
+
}), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
|
|
202
|
+
var ctor = "function" == typeof genFun && genFun.constructor;
|
|
203
|
+
return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
|
|
204
|
+
}, exports.mark = function (genFun) {
|
|
205
|
+
return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
|
|
206
|
+
}, exports.awrap = function (arg) {
|
|
207
207
|
return {
|
|
208
|
-
__await:
|
|
208
|
+
__await: arg
|
|
209
209
|
};
|
|
210
|
-
}, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype,
|
|
210
|
+
}, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
|
|
211
211
|
return this;
|
|
212
|
-
}),
|
|
213
|
-
void 0 ===
|
|
214
|
-
var
|
|
215
|
-
return
|
|
216
|
-
return
|
|
212
|
+
}), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
|
|
213
|
+
void 0 === PromiseImpl && (PromiseImpl = Promise);
|
|
214
|
+
var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
|
|
215
|
+
return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
|
|
216
|
+
return result.done ? result.value : iter.next();
|
|
217
217
|
});
|
|
218
|
-
}, defineIteratorMethods(
|
|
218
|
+
}, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
|
|
219
219
|
return this;
|
|
220
|
-
}), define(
|
|
220
|
+
}), define(Gp, "toString", function () {
|
|
221
221
|
return "[object Generator]";
|
|
222
|
-
}),
|
|
223
|
-
var
|
|
224
|
-
|
|
225
|
-
for (var
|
|
226
|
-
return
|
|
227
|
-
for (;
|
|
228
|
-
var
|
|
229
|
-
if (
|
|
222
|
+
}), exports.keys = function (val) {
|
|
223
|
+
var object = Object(val),
|
|
224
|
+
keys = [];
|
|
225
|
+
for (var key in object) keys.push(key);
|
|
226
|
+
return keys.reverse(), function next() {
|
|
227
|
+
for (; keys.length;) {
|
|
228
|
+
var key = keys.pop();
|
|
229
|
+
if (key in object) return next.value = key, next.done = !1, next;
|
|
230
230
|
}
|
|
231
231
|
return next.done = !0, next;
|
|
232
232
|
};
|
|
233
|
-
},
|
|
233
|
+
}, exports.values = values, Context.prototype = {
|
|
234
234
|
constructor: Context,
|
|
235
|
-
reset: function (
|
|
236
|
-
if (this.prev = 0, this.next = 0, this.sent = this._sent =
|
|
235
|
+
reset: function (skipTempReset) {
|
|
236
|
+
if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);
|
|
237
237
|
},
|
|
238
238
|
stop: function () {
|
|
239
239
|
this.done = !0;
|
|
240
|
-
var
|
|
241
|
-
if ("throw" ===
|
|
240
|
+
var rootRecord = this.tryEntries[0].completion;
|
|
241
|
+
if ("throw" === rootRecord.type) throw rootRecord.arg;
|
|
242
242
|
return this.rval;
|
|
243
243
|
},
|
|
244
|
-
dispatchException: function (
|
|
245
|
-
if (this.done) throw
|
|
246
|
-
var
|
|
247
|
-
function handle(
|
|
248
|
-
return
|
|
244
|
+
dispatchException: function (exception) {
|
|
245
|
+
if (this.done) throw exception;
|
|
246
|
+
var context = this;
|
|
247
|
+
function handle(loc, caught) {
|
|
248
|
+
return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
|
|
249
249
|
}
|
|
250
|
-
for (var
|
|
251
|
-
var
|
|
252
|
-
|
|
253
|
-
if ("root" ===
|
|
254
|
-
if (
|
|
255
|
-
var
|
|
256
|
-
|
|
257
|
-
if (
|
|
258
|
-
if (this.prev <
|
|
259
|
-
if (this.prev <
|
|
260
|
-
} else if (
|
|
261
|
-
if (this.prev <
|
|
250
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
251
|
+
var entry = this.tryEntries[i],
|
|
252
|
+
record = entry.completion;
|
|
253
|
+
if ("root" === entry.tryLoc) return handle("end");
|
|
254
|
+
if (entry.tryLoc <= this.prev) {
|
|
255
|
+
var hasCatch = hasOwn.call(entry, "catchLoc"),
|
|
256
|
+
hasFinally = hasOwn.call(entry, "finallyLoc");
|
|
257
|
+
if (hasCatch && hasFinally) {
|
|
258
|
+
if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
|
|
259
|
+
if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
|
|
260
|
+
} else if (hasCatch) {
|
|
261
|
+
if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
|
|
262
262
|
} else {
|
|
263
|
-
if (!
|
|
264
|
-
if (this.prev <
|
|
263
|
+
if (!hasFinally) throw new Error("try statement without catch or finally");
|
|
264
|
+
if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
|
|
265
265
|
}
|
|
266
266
|
}
|
|
267
267
|
}
|
|
268
268
|
},
|
|
269
|
-
abrupt: function (
|
|
270
|
-
for (var
|
|
271
|
-
var
|
|
272
|
-
if (
|
|
273
|
-
var
|
|
269
|
+
abrupt: function (type, arg) {
|
|
270
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
271
|
+
var entry = this.tryEntries[i];
|
|
272
|
+
if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
|
|
273
|
+
var finallyEntry = entry;
|
|
274
274
|
break;
|
|
275
275
|
}
|
|
276
276
|
}
|
|
277
|
-
|
|
278
|
-
var
|
|
279
|
-
return
|
|
277
|
+
finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
|
|
278
|
+
var record = finallyEntry ? finallyEntry.completion : {};
|
|
279
|
+
return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
|
|
280
280
|
},
|
|
281
|
-
complete: function (
|
|
282
|
-
if ("throw" ===
|
|
283
|
-
return "break" ===
|
|
281
|
+
complete: function (record, afterLoc) {
|
|
282
|
+
if ("throw" === record.type) throw record.arg;
|
|
283
|
+
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;
|
|
284
284
|
},
|
|
285
|
-
finish: function (
|
|
286
|
-
for (var
|
|
287
|
-
var
|
|
288
|
-
if (
|
|
285
|
+
finish: function (finallyLoc) {
|
|
286
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
287
|
+
var entry = this.tryEntries[i];
|
|
288
|
+
if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
|
|
289
289
|
}
|
|
290
290
|
},
|
|
291
|
-
catch: function (
|
|
292
|
-
for (var
|
|
293
|
-
var
|
|
294
|
-
if (
|
|
295
|
-
var
|
|
296
|
-
if ("throw" ===
|
|
297
|
-
var
|
|
298
|
-
resetTryEntry(
|
|
291
|
+
catch: function (tryLoc) {
|
|
292
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
293
|
+
var entry = this.tryEntries[i];
|
|
294
|
+
if (entry.tryLoc === tryLoc) {
|
|
295
|
+
var record = entry.completion;
|
|
296
|
+
if ("throw" === record.type) {
|
|
297
|
+
var thrown = record.arg;
|
|
298
|
+
resetTryEntry(entry);
|
|
299
299
|
}
|
|
300
|
-
return
|
|
300
|
+
return thrown;
|
|
301
301
|
}
|
|
302
302
|
}
|
|
303
303
|
throw new Error("illegal catch attempt");
|
|
304
304
|
},
|
|
305
|
-
delegateYield: function (
|
|
305
|
+
delegateYield: function (iterable, resultName, nextLoc) {
|
|
306
306
|
return this.delegate = {
|
|
307
|
-
iterator: values(
|
|
308
|
-
resultName:
|
|
309
|
-
nextLoc:
|
|
310
|
-
}, "next" === this.method && (this.arg =
|
|
307
|
+
iterator: values(iterable),
|
|
308
|
+
resultName: resultName,
|
|
309
|
+
nextLoc: nextLoc
|
|
310
|
+
}, "next" === this.method && (this.arg = undefined), ContinueSentinel;
|
|
311
311
|
}
|
|
312
|
-
},
|
|
312
|
+
}, exports;
|
|
313
313
|
}
|
|
314
314
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
315
315
|
try {
|
|
@@ -400,11 +400,7 @@ function _construct(Parent, args, Class) {
|
|
|
400
400
|
return _construct.apply(null, arguments);
|
|
401
401
|
}
|
|
402
402
|
function _isNativeFunction(fn) {
|
|
403
|
-
|
|
404
|
-
return Function.toString.call(fn).indexOf("[native code]") !== -1;
|
|
405
|
-
} catch (e) {
|
|
406
|
-
return typeof fn === "function";
|
|
407
|
-
}
|
|
403
|
+
return Function.toString.call(fn).indexOf("[native code]") !== -1;
|
|
408
404
|
}
|
|
409
405
|
function _wrapNativeSuper(Class) {
|
|
410
406
|
var _cache = typeof Map === "function" ? new Map() : undefined;
|
|
@@ -1392,7 +1388,7 @@ var Dstore = /*#__PURE__*/function () {
|
|
|
1392
1388
|
var DstoreError = /*#__PURE__*/function (_Error) {
|
|
1393
1389
|
_inheritsLoose(DstoreError, _Error);
|
|
1394
1390
|
function DstoreError(message, originalError, extensions) {
|
|
1395
|
-
var _this2$stack, _originalError$stack, _this2$stack2;
|
|
1391
|
+
var _this2$stack, _originalError$stack, _originalError$stack$, _originalError$stack$2, _this2$stack2, _this2$stack2$split, _this2$stack2$split$s;
|
|
1396
1392
|
var _this2;
|
|
1397
1393
|
_this2 = _Error.call(this, message + ": " + (originalError == null ? void 0 : originalError.message)) || this;
|
|
1398
1394
|
// if no name provided, use the default. defineProperty ensures that it stays non-enumerable
|
|
@@ -1406,7 +1402,7 @@ var DstoreError = /*#__PURE__*/function (_Error) {
|
|
|
1406
1402
|
// metadata: Metadata { internalRepr: Map(0) {}, options: {} },
|
|
1407
1403
|
_this2.originalError = originalError;
|
|
1408
1404
|
_this2.extensions = _extends({}, extensions);
|
|
1409
|
-
_this2.stack = (((_this2$stack = _this2.stack) == null ? void 0 : _this2$stack.split('\n')[0]) || '') + '\n' + ((originalError == null
|
|
1405
|
+
_this2.stack = (((_this2$stack = _this2.stack) == null ? void 0 : _this2$stack.split('\n')[0]) || '') + '\n' + ((originalError == null ? void 0 : (_originalError$stack = originalError.stack) == null ? void 0 : (_originalError$stack$ = _originalError$stack.split('\n')) == null ? void 0 : (_originalError$stack$2 = _originalError$stack$.slice(1)) == null ? void 0 : _originalError$stack$2.join('\n')) || '') + '\n' + (((_this2$stack2 = _this2.stack) == null ? void 0 : (_this2$stack2$split = _this2$stack2.split('\n')) == null ? void 0 : (_this2$stack2$split$s = _this2$stack2$split.slice(1)) == null ? void 0 : _this2$stack2$split$s.join('\n')) || '');
|
|
1410
1406
|
// These are usually present on Datastore Errors
|
|
1411
1407
|
// logger.error({ err: originalError, extensions }, message);
|
|
1412
1408
|
return _this2;
|