-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathIDBKeyRange-static.js
More file actions
19 lines (17 loc) · 944 Bytes
/
Copy pathIDBKeyRange-static.js
File metadata and controls
19 lines (17 loc) · 944 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
const IDBKeyRangeImpl = require('./IDBKeyRange-impl')
const IDBKeyRange = require('./living/generated/IDBKeyRange')
const { valuify } = require('./value')
exports.patch = function (globalObject) {
globalObject.IDBKeyRange.bound = function (lower, upper, lowerOpen = false, upperOpen = false) {
return IDBKeyRange.create(globalObject, [ valuify(globalObject, lower), valuify(globalObject, upper), lowerOpen, upperOpen ], {})
}
globalObject.IDBKeyRange.upperBound = function (upper, open = false) {
return IDBKeyRange.create(globalObject, [ undefined, valuify(globalObject, upper), true, open ], {})
}
globalObject.IDBKeyRange.lowerBound = function (lower, open = false) {
return IDBKeyRange.create(globalObject, [ valuify(globalObject, lower), undefined, open, true ], {})
}
globalObject.IDBKeyRange.only = function (only) {
return globalObject.IDBKeyRange.bound(only, only)
}
}