From 8f8fb969859133f40edf98dbfb43013ab742aa42 Mon Sep 17 00:00:00 2001 From: cnstntn-kndrtv Date: Wed, 11 Jan 2017 19:17:30 +0300 Subject: [PATCH] db Prefix added prefix for database added instead of default prefix of IDBWrapper --- index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index be7a0fd..6307027 100644 --- a/index.js +++ b/index.js @@ -8,10 +8,11 @@ var isBuffer = require('isbuffer') var xtend = require('xtend') var toBuffer = require('typedarray-to-buffer') -function Level(location) { +function Level(location, storePrefix) { if (!(this instanceof Level)) return new Level(location) if (!location) throw new Error("constructor requires at least a location argument") this.IDBOptions = {} + this.storePrefix = storePrefix || 'IDBWrapper-' this.location = location } @@ -22,6 +23,7 @@ Level.prototype._open = function(options, callback) { var idbOpts = { storeName: this.location, + storePrefix: this.storePrefix, autoIncrement: false, keyPath: null, onStoreReady: function () {