Skip to content

Commit 1d50abd

Browse files
committed
Remove level-mem compatibility checks
Category: removal
1 parent 48c8ada commit 1d50abd

File tree

2 files changed

+1
-16
lines changed

2 files changed

+1
-16
lines changed

index.js

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -264,20 +264,12 @@ for (const Ctor of [MemoryIterator, MemoryKeyIterator, MemoryValueIterator]) {
264264
}
265265

266266
class MemoryLevel extends AbstractLevel {
267-
constructor (location, options, _) {
267+
constructor (location, options) {
268268
// Take a dummy location argument to align with other implementations
269269
if (typeof location === 'object' && location !== null) {
270270
options = location
271271
}
272272

273-
// To help migrating from level-mem to abstract-level
274-
// TODO (v2): remove
275-
if (typeof location === 'function' || typeof options === 'function' || typeof _ === 'function') {
276-
throw new ModuleError('The levelup-style callback argument has been removed', {
277-
code: 'LEVEL_LEGACY'
278-
})
279-
}
280-
281273
let { storeEncoding, ...forward } = options || {}
282274
storeEncoding = storeEncoding || 'buffer'
283275

test.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,3 @@ test('throws on unsupported storeEncoding', function (t) {
3838
t.throws(() => new MemoryLevel({ storeEncoding: 'foo' }), (err) => err.code === 'LEVEL_ENCODING_NOT_SUPPORTED')
3939
t.end()
4040
})
41-
42-
test('throws on legacy level-mem options', function (t) {
43-
t.throws(() => new MemoryLevel(() => {}), (err) => err.code === 'LEVEL_LEGACY')
44-
t.throws(() => new MemoryLevel('x', () => {}), (err) => err.code === 'LEVEL_LEGACY')
45-
t.throws(() => new MemoryLevel('x', {}, () => {}), (err) => err.code === 'LEVEL_LEGACY')
46-
t.end()
47-
})

0 commit comments

Comments
 (0)