diff --git a/.jshintrc b/.jshintrc index 26853242..ed407a72 100644 --- a/.jshintrc +++ b/.jshintrc @@ -27,4 +27,5 @@ , "es5": true , "esnext": true , "strict": false + , "onevar": true } \ No newline at end of file diff --git a/lib/levelup.js b/lib/levelup.js index 138247e7..cd76f0ab 100644 --- a/lib/levelup.js +++ b/lib/levelup.js @@ -368,14 +368,18 @@ LevelUP.prototype.toString = function () { } module.exports = function (location, options, callback) { + var message + , error + , levelup + if (typeof options == 'function') { callback = options options = {} } if (typeof location != 'string') { - var message = 'Must provide a location for the database' - var error = new errors.InitializationError(message) + message = 'Must provide a location for the database' + error = new errors.InitializationError(message) if (callback) { return callback(error) @@ -384,7 +388,7 @@ module.exports = function (location, options, callback) { throw error } - var levelup = new LevelUP(location, options) + levelup = new LevelUP(location, options) levelup.open(callback) return levelup }