fake-indexeddb 6.2.6 → 6.2.8
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 +7 -7
- package/build/cjs/FDBTransaction.js +5 -2
- package/build/cjs/lib/Index.js +50 -23
- package/build/cjs/lib/ObjectStore.js +10 -3
- package/build/cjs/lib/RecordStore.js +14 -9
- package/build/esm/FDBTransaction.js +5 -2
- package/build/esm/lib/Index.js +50 -23
- package/build/esm/lib/ObjectStore.js +10 -3
- package/build/esm/lib/RecordStore.js +14 -9
- package/package.json +1 -1
- package/build/cjs/test/fakeIndexedDB/auto.js +0 -54
- package/build/cjs/test/fakeIndexedDB/binarySearchTree.js +0 -413
- package/build/cjs/test/fakeIndexedDB/fakeIndexedDB.js +0 -1018
- package/build/cjs/test/fakeIndexedDB/forceCloseDatabase.js +0 -99
- package/build/cjs/test/fakeIndexedDB/getAll.js +0 -707
- package/build/cjs/test/fakeIndexedDB/memoryLeaks.js +0 -42
- package/build/esm/test/fakeIndexedDB/auto.js +0 -52
- package/build/esm/test/fakeIndexedDB/binarySearchTree.js +0 -409
- package/build/esm/test/fakeIndexedDB/fakeIndexedDB.js +0 -1014
- package/build/esm/test/fakeIndexedDB/forceCloseDatabase.js +0 -95
- package/build/esm/test/fakeIndexedDB/getAll.js +0 -703
- package/build/esm/test/fakeIndexedDB/memoryLeaks.js +0 -38
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var assert = _interopRequireWildcard(require("assert"));
|
|
4
|
-
var _fakeIndexedDB = _interopRequireDefault(require("../../fakeIndexedDB.js"));
|
|
5
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
6
|
-
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
7
|
-
const req = r => new Promise((res, rej) => {
|
|
8
|
-
r.onsuccess = () => res(r.result);
|
|
9
|
-
r.onerror = () => rej(r.error);
|
|
10
|
-
});
|
|
11
|
-
const openDb = async name => {
|
|
12
|
-
const open = _fakeIndexedDB.default.open(name, 1);
|
|
13
|
-
open.onupgradeneeded = () => open.result.createObjectStore("s");
|
|
14
|
-
return await req(open);
|
|
15
|
-
};
|
|
16
|
-
describe("memory leaks", () => {
|
|
17
|
-
it("does not leak memory in database.transactions (issue #170)", async () => {
|
|
18
|
-
const db = await openDb("test-mem-leaks");
|
|
19
|
-
for (let i = 0; i < 100; i++) {
|
|
20
|
-
const tx = db.transaction("s", "readwrite");
|
|
21
|
-
tx.objectStore("s").put("foo", "k" + i % 10);
|
|
22
|
-
await new Promise(r => {
|
|
23
|
-
tx.oncomplete = r;
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
// double macrotask to avoid race conditions in the test
|
|
28
|
-
await new Promise(resolve => setTimeout(resolve));
|
|
29
|
-
await new Promise(resolve => setTimeout(resolve));
|
|
30
|
-
assert.equal(db?._rawDatabase.transactions.length, 0, "Transactions should not be held onto indefinitely");
|
|
31
|
-
});
|
|
32
|
-
it("does not leak memory an aborted transaction (issue #170)", async () => {
|
|
33
|
-
const db = await openDb("test-mem-leaks-2");
|
|
34
|
-
const tx = db.transaction("s", "readwrite");
|
|
35
|
-
tx.abort();
|
|
36
|
-
|
|
37
|
-
// double macrotask to avoid race conditions in the test
|
|
38
|
-
await new Promise(resolve => setTimeout(resolve));
|
|
39
|
-
await new Promise(resolve => setTimeout(resolve));
|
|
40
|
-
assert.equal(db?._rawDatabase.transactions.length, 0, "Transactions should not be held onto indefinitely");
|
|
41
|
-
});
|
|
42
|
-
});
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import * as assert from "assert";
|
|
2
|
-
import * as fakeIndexedDB from "../../index.js";
|
|
3
|
-
|
|
4
|
-
// `indexedDB` is read-only, all others are read-write
|
|
5
|
-
const props = Object.keys(fakeIndexedDB).filter(prop => prop.startsWith("IDB") || prop === "indexedDB");
|
|
6
|
-
describe("auto", () => {
|
|
7
|
-
it("correctly overrides globals in fake-indexeddb/auto", async () => {
|
|
8
|
-
// simulate what the native property descriptors do
|
|
9
|
-
Object.defineProperty(globalThis, "indexedDB", {
|
|
10
|
-
set: undefined,
|
|
11
|
-
get: () => undefined,
|
|
12
|
-
enumerable: false,
|
|
13
|
-
configurable: true
|
|
14
|
-
});
|
|
15
|
-
for (const prop of props) {
|
|
16
|
-
Object.defineProperty(globalThis, prop, {
|
|
17
|
-
value: undefined,
|
|
18
|
-
enumerable: false,
|
|
19
|
-
configurable: true,
|
|
20
|
-
writable: true
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
// @ts-expect-error relative to the build/ directory
|
|
25
|
-
await import("../../../../auto/index.mjs");
|
|
26
|
-
|
|
27
|
-
// check our own globals
|
|
28
|
-
for (const prop of props) {
|
|
29
|
-
const descriptor = Object.getOwnPropertyDescriptor(globalThis, prop);
|
|
30
|
-
assert.equal(descriptor.value, fakeIndexedDB[prop]);
|
|
31
|
-
assert.equal(descriptor.enumerable, false);
|
|
32
|
-
assert.equal(descriptor.configurable, true);
|
|
33
|
-
assert.equal(descriptor.writable, true);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
// check that we can still overwrite them with `globalThis.<prop> = ...`
|
|
37
|
-
for (const prop of props) {
|
|
38
|
-
const fake = {};
|
|
39
|
-
globalThis[prop] = fake;
|
|
40
|
-
assert.equal(globalThis[prop], fake);
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
it("exports as cjs directly, without `default` member - issue #130", async () => {
|
|
44
|
-
// @ts-expect-error relative to the build/ directory
|
|
45
|
-
await import("../../../../auto/index.js");
|
|
46
|
-
|
|
47
|
-
// ensure we directly set the export as `module.exports` rather than `module.exports.default`
|
|
48
|
-
for (const prop of props) {
|
|
49
|
-
assert.ok(!globalThis[prop].default);
|
|
50
|
-
}
|
|
51
|
-
});
|
|
52
|
-
});
|
|
@@ -1,409 +0,0 @@
|
|
|
1
|
-
import * as assert from "assert";
|
|
2
|
-
import BinarySearchTree from "../../lib/binarySearchTree.js";
|
|
3
|
-
import FDBKeyRange from "../../FDBKeyRange.js";
|
|
4
|
-
const assertRecordsEqual = (actual, expected) => {
|
|
5
|
-
assert.deepStrictEqual([...actual], expected);
|
|
6
|
-
};
|
|
7
|
-
describe("binarySearchTree", () => {
|
|
8
|
-
it("works for basic insertion and retrieval", () => {
|
|
9
|
-
const tree = new BinarySearchTree();
|
|
10
|
-
assert.equal(tree.size(), 0);
|
|
11
|
-
tree.put({
|
|
12
|
-
key: "b",
|
|
13
|
-
value: "b"
|
|
14
|
-
});
|
|
15
|
-
assert.equal(tree.size(), 1);
|
|
16
|
-
tree.put({
|
|
17
|
-
key: "a",
|
|
18
|
-
value: "a"
|
|
19
|
-
});
|
|
20
|
-
assert.equal(tree.size(), 2);
|
|
21
|
-
tree.put({
|
|
22
|
-
key: "c",
|
|
23
|
-
value: "c"
|
|
24
|
-
});
|
|
25
|
-
assert.equal(tree.size(), 3);
|
|
26
|
-
assertRecordsEqual(tree.getAllRecords(), [{
|
|
27
|
-
key: "a",
|
|
28
|
-
value: "a"
|
|
29
|
-
}, {
|
|
30
|
-
key: "b",
|
|
31
|
-
value: "b"
|
|
32
|
-
}, {
|
|
33
|
-
key: "c",
|
|
34
|
-
value: "c"
|
|
35
|
-
}]);
|
|
36
|
-
});
|
|
37
|
-
it("overwrites duplicate key/value pairs", () => {
|
|
38
|
-
const tree = new BinarySearchTree();
|
|
39
|
-
tree.put({
|
|
40
|
-
key: "a",
|
|
41
|
-
value: "a"
|
|
42
|
-
});
|
|
43
|
-
tree.put({
|
|
44
|
-
key: "a",
|
|
45
|
-
value: "a"
|
|
46
|
-
});
|
|
47
|
-
tree.put({
|
|
48
|
-
key: "b",
|
|
49
|
-
value: "x"
|
|
50
|
-
});
|
|
51
|
-
tree.put({
|
|
52
|
-
key: "b",
|
|
53
|
-
value: "y"
|
|
54
|
-
});
|
|
55
|
-
tree.put({
|
|
56
|
-
key: "c",
|
|
57
|
-
value: "c"
|
|
58
|
-
});
|
|
59
|
-
tree.put({
|
|
60
|
-
key: "a",
|
|
61
|
-
value: "a"
|
|
62
|
-
});
|
|
63
|
-
assert.equal(tree.size(), 4);
|
|
64
|
-
assertRecordsEqual(tree.getAllRecords(), [{
|
|
65
|
-
key: "a",
|
|
66
|
-
value: "a"
|
|
67
|
-
}, {
|
|
68
|
-
key: "b",
|
|
69
|
-
value: "x"
|
|
70
|
-
}, {
|
|
71
|
-
key: "b",
|
|
72
|
-
value: "y"
|
|
73
|
-
}, {
|
|
74
|
-
key: "c",
|
|
75
|
-
value: "c"
|
|
76
|
-
}]);
|
|
77
|
-
});
|
|
78
|
-
it("works for deletions", () => {
|
|
79
|
-
const tree = new BinarySearchTree();
|
|
80
|
-
tree.put({
|
|
81
|
-
key: "a",
|
|
82
|
-
value: "a"
|
|
83
|
-
});
|
|
84
|
-
tree.put({
|
|
85
|
-
key: "b",
|
|
86
|
-
value: "b"
|
|
87
|
-
});
|
|
88
|
-
tree.put({
|
|
89
|
-
key: "c",
|
|
90
|
-
value: "c"
|
|
91
|
-
});
|
|
92
|
-
tree.delete({
|
|
93
|
-
key: "b",
|
|
94
|
-
value: "b"
|
|
95
|
-
});
|
|
96
|
-
assert.equal(tree.size(), 2);
|
|
97
|
-
assertRecordsEqual(tree.getAllRecords(), [{
|
|
98
|
-
key: "a",
|
|
99
|
-
value: "a"
|
|
100
|
-
}, {
|
|
101
|
-
key: "c",
|
|
102
|
-
value: "c"
|
|
103
|
-
}]);
|
|
104
|
-
});
|
|
105
|
-
it("works for deletions on nonexistent records", () => {
|
|
106
|
-
const tree = new BinarySearchTree();
|
|
107
|
-
tree.put({
|
|
108
|
-
key: "a",
|
|
109
|
-
value: "a"
|
|
110
|
-
});
|
|
111
|
-
tree.put({
|
|
112
|
-
key: "b",
|
|
113
|
-
value: "b"
|
|
114
|
-
});
|
|
115
|
-
tree.put({
|
|
116
|
-
key: "c",
|
|
117
|
-
value: "c"
|
|
118
|
-
});
|
|
119
|
-
tree.delete({
|
|
120
|
-
key: "x",
|
|
121
|
-
value: "x"
|
|
122
|
-
});
|
|
123
|
-
assert.equal(tree.size(), 3);
|
|
124
|
-
assertRecordsEqual(tree.getAllRecords(), [{
|
|
125
|
-
key: "a",
|
|
126
|
-
value: "a"
|
|
127
|
-
}, {
|
|
128
|
-
key: "b",
|
|
129
|
-
value: "b"
|
|
130
|
-
}, {
|
|
131
|
-
key: "c",
|
|
132
|
-
value: "c"
|
|
133
|
-
}]);
|
|
134
|
-
});
|
|
135
|
-
it("can delete a lot", () => {
|
|
136
|
-
const letters = "abcdefghijklmnopqrstuvwxyz";
|
|
137
|
-
const tree = new BinarySearchTree();
|
|
138
|
-
for (const letter of [...letters]) {
|
|
139
|
-
tree.put({
|
|
140
|
-
key: letter,
|
|
141
|
-
value: letter
|
|
142
|
-
});
|
|
143
|
-
}
|
|
144
|
-
const expected = [...letters].map(letter => ({
|
|
145
|
-
key: letter,
|
|
146
|
-
value: letter
|
|
147
|
-
}));
|
|
148
|
-
assert.equal(tree.size(), expected.length);
|
|
149
|
-
assertRecordsEqual(tree.getAllRecords(), expected);
|
|
150
|
-
for (let i = 0; i < letters.length; i++) {
|
|
151
|
-
const letter = letters.charAt(i);
|
|
152
|
-
tree.delete({
|
|
153
|
-
key: letter,
|
|
154
|
-
value: letter
|
|
155
|
-
});
|
|
156
|
-
assert.equal(tree.size(), expected.length - i - 1);
|
|
157
|
-
assertRecordsEqual(tree.getAllRecords(), expected.slice(i + 1));
|
|
158
|
-
}
|
|
159
|
-
});
|
|
160
|
-
it("works for get and getByKey", () => {
|
|
161
|
-
const tree = new BinarySearchTree();
|
|
162
|
-
tree.put({
|
|
163
|
-
key: "a",
|
|
164
|
-
value: "a"
|
|
165
|
-
});
|
|
166
|
-
tree.put({
|
|
167
|
-
key: "b",
|
|
168
|
-
value: "b"
|
|
169
|
-
});
|
|
170
|
-
tree.put({
|
|
171
|
-
key: "c",
|
|
172
|
-
value: "c"
|
|
173
|
-
});
|
|
174
|
-
tree.delete({
|
|
175
|
-
key: "a",
|
|
176
|
-
value: "a"
|
|
177
|
-
});
|
|
178
|
-
assert.deepStrictEqual(tree.get({
|
|
179
|
-
key: "b",
|
|
180
|
-
value: "b"
|
|
181
|
-
}), {
|
|
182
|
-
key: "b",
|
|
183
|
-
value: "b"
|
|
184
|
-
});
|
|
185
|
-
assertRecordsEqual(tree.getRecords(FDBKeyRange.only("b")), [{
|
|
186
|
-
key: "b",
|
|
187
|
-
value: "b"
|
|
188
|
-
}]);
|
|
189
|
-
assert.equal(tree.get({
|
|
190
|
-
key: "x",
|
|
191
|
-
value: "x"
|
|
192
|
-
}), undefined);
|
|
193
|
-
assertRecordsEqual(tree.getRecords(FDBKeyRange.only("x")), []);
|
|
194
|
-
});
|
|
195
|
-
it("throws an error on overwrite if noOverwrite=true", () => {
|
|
196
|
-
const tree = new BinarySearchTree();
|
|
197
|
-
tree.put({
|
|
198
|
-
key: "a",
|
|
199
|
-
value: "a"
|
|
200
|
-
}, true);
|
|
201
|
-
tree.put({
|
|
202
|
-
key: "b",
|
|
203
|
-
value: "b"
|
|
204
|
-
}, true);
|
|
205
|
-
assert.throws(() => tree.put({
|
|
206
|
-
key: "a",
|
|
207
|
-
value: "a"
|
|
208
|
-
}, true));
|
|
209
|
-
});
|
|
210
|
-
it("works for keysAreUnique=true", () => {
|
|
211
|
-
const tree = new BinarySearchTree(true);
|
|
212
|
-
tree.put({
|
|
213
|
-
key: "a",
|
|
214
|
-
value: 0
|
|
215
|
-
});
|
|
216
|
-
tree.put({
|
|
217
|
-
key: "a",
|
|
218
|
-
value: 1
|
|
219
|
-
});
|
|
220
|
-
tree.put({
|
|
221
|
-
key: "a",
|
|
222
|
-
value: 2
|
|
223
|
-
});
|
|
224
|
-
assertRecordsEqual(tree.getAllRecords(), [{
|
|
225
|
-
key: "a",
|
|
226
|
-
value: 2
|
|
227
|
-
}]);
|
|
228
|
-
assert.throws(() => tree.put({
|
|
229
|
-
key: "a",
|
|
230
|
-
value: 3
|
|
231
|
-
}, true));
|
|
232
|
-
});
|
|
233
|
-
it("returns existing records for overwrites", () => {
|
|
234
|
-
const tree = new BinarySearchTree();
|
|
235
|
-
assert.deepStrictEqual(tree.put({
|
|
236
|
-
key: "a",
|
|
237
|
-
value: "a"
|
|
238
|
-
}), undefined);
|
|
239
|
-
assert.deepStrictEqual(tree.put({
|
|
240
|
-
key: "a",
|
|
241
|
-
value: "a"
|
|
242
|
-
}), {
|
|
243
|
-
key: "a",
|
|
244
|
-
value: "a"
|
|
245
|
-
});
|
|
246
|
-
assert.deepStrictEqual(tree.put({
|
|
247
|
-
key: "b",
|
|
248
|
-
value: "b"
|
|
249
|
-
}), undefined);
|
|
250
|
-
tree.delete({
|
|
251
|
-
key: "a",
|
|
252
|
-
value: "a"
|
|
253
|
-
});
|
|
254
|
-
assert.deepStrictEqual(tree.put({
|
|
255
|
-
key: "a",
|
|
256
|
-
value: "a"
|
|
257
|
-
}), undefined);
|
|
258
|
-
assert.deepStrictEqual(tree.put({
|
|
259
|
-
key: "a",
|
|
260
|
-
value: "a"
|
|
261
|
-
}), {
|
|
262
|
-
key: "a",
|
|
263
|
-
value: "a"
|
|
264
|
-
});
|
|
265
|
-
});
|
|
266
|
-
it("returns existing records for overwrites, keysAreUnique=true", () => {
|
|
267
|
-
const tree = new BinarySearchTree(true);
|
|
268
|
-
assert.deepStrictEqual(tree.put({
|
|
269
|
-
key: "a",
|
|
270
|
-
value: 0
|
|
271
|
-
}), undefined);
|
|
272
|
-
assert.deepStrictEqual(tree.put({
|
|
273
|
-
key: "a",
|
|
274
|
-
value: 1
|
|
275
|
-
}), {
|
|
276
|
-
key: "a",
|
|
277
|
-
value: 0
|
|
278
|
-
});
|
|
279
|
-
assert.deepStrictEqual(tree.put({
|
|
280
|
-
key: "a",
|
|
281
|
-
value: 2
|
|
282
|
-
}), {
|
|
283
|
-
key: "a",
|
|
284
|
-
value: 1
|
|
285
|
-
});
|
|
286
|
-
assert.deepStrictEqual(tree.put({
|
|
287
|
-
key: "b",
|
|
288
|
-
value: 0
|
|
289
|
-
}), undefined);
|
|
290
|
-
tree.delete({
|
|
291
|
-
key: "a",
|
|
292
|
-
value: undefined
|
|
293
|
-
});
|
|
294
|
-
assert.deepStrictEqual(tree.put({
|
|
295
|
-
key: "a",
|
|
296
|
-
value: 3
|
|
297
|
-
}), undefined);
|
|
298
|
-
assert.deepStrictEqual(tree.put({
|
|
299
|
-
key: "a",
|
|
300
|
-
value: 4
|
|
301
|
-
}), {
|
|
302
|
-
key: "a",
|
|
303
|
-
value: 3
|
|
304
|
-
});
|
|
305
|
-
});
|
|
306
|
-
describe("can do range searches", () => {
|
|
307
|
-
[false, true].forEach(descending => {
|
|
308
|
-
const assertRecordsEqualGivenOrdering = (actual, expected) => {
|
|
309
|
-
assertRecordsEqual(actual, descending ? expected.reverse() : expected);
|
|
310
|
-
};
|
|
311
|
-
it(`descending=${descending}`, () => {
|
|
312
|
-
const tree = new BinarySearchTree();
|
|
313
|
-
tree.put({
|
|
314
|
-
key: "c",
|
|
315
|
-
value: "c"
|
|
316
|
-
});
|
|
317
|
-
tree.put({
|
|
318
|
-
key: "e",
|
|
319
|
-
value: "e"
|
|
320
|
-
});
|
|
321
|
-
tree.put({
|
|
322
|
-
key: "a",
|
|
323
|
-
value: "a"
|
|
324
|
-
});
|
|
325
|
-
tree.put({
|
|
326
|
-
key: "b",
|
|
327
|
-
value: "b"
|
|
328
|
-
});
|
|
329
|
-
tree.put({
|
|
330
|
-
key: "d",
|
|
331
|
-
value: "d"
|
|
332
|
-
});
|
|
333
|
-
|
|
334
|
-
// get all
|
|
335
|
-
assert.equal(tree.size(), 5);
|
|
336
|
-
assertRecordsEqualGivenOrdering(tree.getAllRecords(descending), [{
|
|
337
|
-
key: "a",
|
|
338
|
-
value: "a"
|
|
339
|
-
}, {
|
|
340
|
-
key: "b",
|
|
341
|
-
value: "b"
|
|
342
|
-
}, {
|
|
343
|
-
key: "c",
|
|
344
|
-
value: "c"
|
|
345
|
-
}, {
|
|
346
|
-
key: "d",
|
|
347
|
-
value: "d"
|
|
348
|
-
}, {
|
|
349
|
-
key: "e",
|
|
350
|
-
value: "e"
|
|
351
|
-
}]);
|
|
352
|
-
|
|
353
|
-
// in bounds
|
|
354
|
-
assertRecordsEqualGivenOrdering(tree.getRecords(new FDBKeyRange("b", "d", false, false), descending), [{
|
|
355
|
-
key: "b",
|
|
356
|
-
value: "b"
|
|
357
|
-
}, {
|
|
358
|
-
key: "c",
|
|
359
|
-
value: "c"
|
|
360
|
-
}, {
|
|
361
|
-
key: "d",
|
|
362
|
-
value: "d"
|
|
363
|
-
}]);
|
|
364
|
-
|
|
365
|
-
// out of bounds
|
|
366
|
-
assertRecordsEqualGivenOrdering(tree.getRecords(new FDBKeyRange("0", "z", false, false), descending), [{
|
|
367
|
-
key: "a",
|
|
368
|
-
value: "a"
|
|
369
|
-
}, {
|
|
370
|
-
key: "b",
|
|
371
|
-
value: "b"
|
|
372
|
-
}, {
|
|
373
|
-
key: "c",
|
|
374
|
-
value: "c"
|
|
375
|
-
}, {
|
|
376
|
-
key: "d",
|
|
377
|
-
value: "d"
|
|
378
|
-
}, {
|
|
379
|
-
key: "e",
|
|
380
|
-
value: "e"
|
|
381
|
-
}]);
|
|
382
|
-
|
|
383
|
-
// lower/upper open
|
|
384
|
-
assertRecordsEqualGivenOrdering(tree.getRecords(new FDBKeyRange("b", "d", true, true), descending), [{
|
|
385
|
-
key: "c",
|
|
386
|
-
value: "c"
|
|
387
|
-
}]);
|
|
388
|
-
|
|
389
|
-
// lower open only
|
|
390
|
-
assertRecordsEqualGivenOrdering(tree.getRecords(new FDBKeyRange("b", "d", true, false), descending), [{
|
|
391
|
-
key: "c",
|
|
392
|
-
value: "c"
|
|
393
|
-
}, {
|
|
394
|
-
key: "d",
|
|
395
|
-
value: "d"
|
|
396
|
-
}]);
|
|
397
|
-
|
|
398
|
-
// upper open only
|
|
399
|
-
assertRecordsEqualGivenOrdering(tree.getRecords(new FDBKeyRange("b", "d", false, true), descending), [{
|
|
400
|
-
key: "b",
|
|
401
|
-
value: "b"
|
|
402
|
-
}, {
|
|
403
|
-
key: "c",
|
|
404
|
-
value: "c"
|
|
405
|
-
}]);
|
|
406
|
-
});
|
|
407
|
-
});
|
|
408
|
-
});
|
|
409
|
-
});
|