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 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])` instead of `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 yarn test](https://github.com/grpc/grpc-node/blob/master/TROUBLESHOOTING.md)
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 e;
15
+ return exports;
16
16
  };
17
- var t,
18
- e = {},
19
- r = Object.prototype,
20
- n = r.hasOwnProperty,
21
- o = Object.defineProperty || function (t, e, r) {
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
- i = "function" == typeof Symbol ? Symbol : {},
25
- a = i.iterator || "@@iterator",
26
- c = i.asyncIterator || "@@asyncIterator",
27
- u = i.toStringTag || "@@toStringTag";
28
- function define(t, e, r) {
29
- return Object.defineProperty(t, e, {
30
- value: r,
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
- }), t[e];
33
+ }), obj[key];
35
34
  }
36
35
  try {
37
36
  define({}, "");
38
- } catch (t) {
39
- define = function (t, e, r) {
40
- return t[e] = r;
37
+ } catch (err) {
38
+ define = function (obj, key, value) {
39
+ return obj[key] = value;
41
40
  };
42
41
  }
43
- function wrap(t, e, r, n) {
44
- var i = e && e.prototype instanceof Generator ? e : Generator,
45
- a = Object.create(i.prototype),
46
- c = new Context(n || []);
47
- return o(a, "_invoke", {
48
- value: makeInvokeMethod(t, r, c)
49
- }), a;
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(t, e, r) {
50
+ function tryCatch(fn, obj, arg) {
52
51
  try {
53
52
  return {
54
53
  type: "normal",
55
- arg: t.call(e, r)
54
+ arg: fn.call(obj, arg)
56
55
  };
57
- } catch (t) {
56
+ } catch (err) {
58
57
  return {
59
58
  type: "throw",
60
- arg: t
59
+ arg: err
61
60
  };
62
61
  }
63
62
  }
64
- e.wrap = wrap;
65
- var h = "suspendedStart",
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 p = {};
74
- define(p, a, function () {
68
+ var IteratorPrototype = {};
69
+ define(IteratorPrototype, iteratorSymbol, function () {
75
70
  return this;
76
71
  });
77
- var d = Object.getPrototypeOf,
78
- v = d && d(d(values([])));
79
- v && v !== r && n.call(v, a) && (p = v);
80
- var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);
81
- function defineIteratorMethods(t) {
82
- ["next", "throw", "return"].forEach(function (e) {
83
- define(t, e, function (t) {
84
- return this._invoke(e, t);
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(t, e) {
89
- function invoke(r, o, i, a) {
90
- var c = tryCatch(t[r], t, o);
91
- if ("throw" !== c.type) {
92
- var u = c.arg,
93
- h = u.value;
94
- return h && "object" == typeof h && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) {
95
- invoke("next", t, i, a);
96
- }, function (t) {
97
- invoke("throw", t, i, a);
98
- }) : e.resolve(h).then(function (t) {
99
- u.value = t, i(u);
100
- }, function (t) {
101
- return invoke("throw", t, i, a);
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
- a(c.arg);
99
+ reject(record.arg);
105
100
  }
106
- var r;
107
- o(this, "_invoke", {
108
- value: function (t, n) {
101
+ var previousPromise;
102
+ defineProperty(this, "_invoke", {
103
+ value: function (method, arg) {
109
104
  function callInvokeWithMethodAndArg() {
110
- return new e(function (e, r) {
111
- invoke(t, n, e, r);
105
+ return new PromiseImpl(function (resolve, reject) {
106
+ invoke(method, arg, resolve, reject);
112
107
  });
113
108
  }
114
- return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
109
+ return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
115
110
  }
116
111
  });
117
112
  }
118
- function makeInvokeMethod(e, r, n) {
119
- var o = h;
120
- return function (i, a) {
121
- if (o === f) throw new Error("Generator is already running");
122
- if (o === s) {
123
- if ("throw" === i) throw a;
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 (n.method = i, n.arg = a;;) {
130
- var c = n.delegate;
131
- if (c) {
132
- var u = maybeInvokeDelegate(c, n);
133
- if (u) {
134
- if (u === y) continue;
135
- return u;
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" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) {
139
- if (o === h) throw o = s, n.arg;
140
- n.dispatchException(n.arg);
141
- } else "return" === n.method && n.abrupt("return", n.arg);
142
- o = f;
143
- var p = tryCatch(e, r, n);
144
- if ("normal" === p.type) {
145
- if (o = n.done ? s : l, p.arg === y) continue;
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: p.arg,
148
- done: n.done
139
+ value: record.arg,
140
+ done: context.done
149
141
  };
150
142
  }
151
- "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg);
143
+ "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
152
144
  }
153
145
  };
154
146
  }
155
- function maybeInvokeDelegate(e, r) {
156
- var n = r.method,
157
- o = e.iterator[n];
158
- if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y;
159
- var i = tryCatch(o, e.iterator, r.arg);
160
- if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y;
161
- var a = i.arg;
162
- return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y);
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(t) {
165
- var e = {
166
- tryLoc: t[0]
156
+ function pushTryEntry(locs) {
157
+ var entry = {
158
+ tryLoc: locs[0]
167
159
  };
168
- 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);
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(t) {
171
- var e = t.completion || {};
172
- e.type = "normal", delete e.arg, t.completion = e;
162
+ function resetTryEntry(entry) {
163
+ var record = entry.completion || {};
164
+ record.type = "normal", delete record.arg, entry.completion = record;
173
165
  }
174
- function Context(t) {
166
+ function Context(tryLocsList) {
175
167
  this.tryEntries = [{
176
168
  tryLoc: "root"
177
- }], t.forEach(pushTryEntry, this), this.reset(!0);
169
+ }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
178
170
  }
179
- function values(e) {
180
- if (e || "" === e) {
181
- var r = e[a];
182
- if (r) return r.call(e);
183
- if ("function" == typeof e.next) return e;
184
- if (!isNaN(e.length)) {
185
- var o = -1,
186
- i = function next() {
187
- for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next;
188
- return next.value = t, next.done = !0, next;
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 i.next = i;
182
+ return next.next = next;
191
183
  }
192
184
  }
193
- throw new TypeError(typeof e + " is not iterable");
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, o(g, "constructor", {
195
+ return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", {
196
196
  value: GeneratorFunctionPrototype,
197
197
  configurable: !0
198
- }), o(GeneratorFunctionPrototype, "constructor", {
198
+ }), defineProperty(GeneratorFunctionPrototype, "constructor", {
199
199
  value: GeneratorFunction,
200
200
  configurable: !0
201
- }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) {
202
- var e = "function" == typeof t && t.constructor;
203
- return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name));
204
- }, e.mark = function (t) {
205
- return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t;
206
- }, e.awrap = function (t) {
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: t
208
+ __await: arg
209
209
  };
210
- }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {
210
+ }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
211
211
  return this;
212
- }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {
213
- void 0 === i && (i = Promise);
214
- var a = new AsyncIterator(wrap(t, r, n, o), i);
215
- return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {
216
- return t.done ? t.value : a.next();
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(g), define(g, u, "Generator"), define(g, a, function () {
218
+ }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
219
219
  return this;
220
- }), define(g, "toString", function () {
220
+ }), define(Gp, "toString", function () {
221
221
  return "[object Generator]";
222
- }), e.keys = function (t) {
223
- var e = Object(t),
224
- r = [];
225
- for (var n in e) r.push(n);
226
- return r.reverse(), function next() {
227
- for (; r.length;) {
228
- var t = r.pop();
229
- if (t in e) return next.value = t, next.done = !1, next;
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
- }, e.values = values, Context.prototype = {
233
+ }, exports.values = values, Context.prototype = {
234
234
  constructor: Context,
235
- reset: function (e) {
236
- if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t);
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 t = this.tryEntries[0].completion;
241
- if ("throw" === t.type) throw t.arg;
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 (e) {
245
- if (this.done) throw e;
246
- var r = this;
247
- function handle(n, o) {
248
- return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o;
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 o = this.tryEntries.length - 1; o >= 0; --o) {
251
- var i = this.tryEntries[o],
252
- a = i.completion;
253
- if ("root" === i.tryLoc) return handle("end");
254
- if (i.tryLoc <= this.prev) {
255
- var c = n.call(i, "catchLoc"),
256
- u = n.call(i, "finallyLoc");
257
- if (c && u) {
258
- if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
259
- if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
260
- } else if (c) {
261
- if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
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 (!u) throw new Error("try statement without catch or finally");
264
- if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
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 (t, e) {
270
- for (var r = this.tryEntries.length - 1; r >= 0; --r) {
271
- var o = this.tryEntries[r];
272
- if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) {
273
- var i = o;
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
- i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);
278
- var a = i ? i.completion : {};
279
- return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a);
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 (t, e) {
282
- if ("throw" === t.type) throw t.arg;
283
- return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y;
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 (t) {
286
- for (var e = this.tryEntries.length - 1; e >= 0; --e) {
287
- var r = this.tryEntries[e];
288
- if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;
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 (t) {
292
- for (var e = this.tryEntries.length - 1; e >= 0; --e) {
293
- var r = this.tryEntries[e];
294
- if (r.tryLoc === t) {
295
- var n = r.completion;
296
- if ("throw" === n.type) {
297
- var o = n.arg;
298
- resetTryEntry(r);
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 o;
300
+ return thrown;
301
301
  }
302
302
  }
303
303
  throw new Error("illegal catch attempt");
304
304
  },
305
- delegateYield: function (e, r, n) {
305
+ delegateYield: function (iterable, resultName, nextLoc) {
306
306
  return this.delegate = {
307
- iterator: values(e),
308
- resultName: r,
309
- nextLoc: n
310
- }, "next" === this.method && (this.arg = t), y;
307
+ iterator: values(iterable),
308
+ resultName: resultName,
309
+ nextLoc: nextLoc
310
+ }, "next" === this.method && (this.arg = undefined), ContinueSentinel;
311
311
  }
312
- }, e;
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
- try {
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 || (_originalError$stack = originalError.stack) == null || (_originalError$stack = _originalError$stack.split('\n')) == null || (_originalError$stack = _originalError$stack.slice(1)) == null ? void 0 : _originalError$stack.join('\n')) || '') + '\n' + (((_this2$stack2 = _this2.stack) == null || (_this2$stack2 = _this2$stack2.split('\n')) == null || (_this2$stack2 = _this2$stack2.slice(1)) == null ? void 0 : _this2$stack2.join('\n')) || '');
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;