From 5e6e46f3d061b21a00ec5c78b6db164f448f1144 Mon Sep 17 00:00:00 2001 From: Vincent Weevers Date: Mon, 30 Sep 2019 22:53:49 +0200 Subject: [PATCH] Add manifest --- index.js | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/index.js b/index.js index 8b46417..13013fd 100644 --- a/index.js +++ b/index.js @@ -18,7 +18,14 @@ var DEFAULT_PREFIX = 'level-js-' function Level (location, opts) { if (!(this instanceof Level)) return new Level(location, opts) - AbstractLevelDOWN.call(this) + + AbstractLevelDOWN.call(this, { + bufferKeys: support.bufferKeys(indexedDB), + snapshots: true, + permanence: true, + clear: true + }) + opts = opts || {} if (typeof location !== 'string') { @@ -28,12 +35,6 @@ function Level (location, opts) { this.location = location this.prefix = opts.prefix || DEFAULT_PREFIX this.version = parseInt(opts.version || 1, 10) - - // Experimental, do not externally rely on this object yet. - // See Level/community#42. - this.supports = { - bufferKeys: support.bufferKeys(indexedDB) - } } inherits(Level, AbstractLevelDOWN) @@ -211,7 +212,7 @@ Level.prototype._clear = function (options, callback) { } Level.prototype._close = function (callback) { - this.db.close() + if (this.db) this.db.close() setImmediate(callback) }