Skip to content
This repository has been archived by the owner on Dec 1, 2024. It is now read-only.

Commit

Permalink
Added errors to the available namespace when requiring 'levelup'.
Browse files Browse the repository at this point in the history
  • Loading branch information
braydonf authored and Braydon Fuller committed Mar 17, 2015
1 parent 79787f6 commit b0247a4
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 6 deletions.
1 change: 1 addition & 0 deletions lib/levelup.js
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,7 @@ function utilStatic (name) {
}

module.exports = LevelUP
module.exports.errors = require('./errors');
// DEPRECATED: prefer accessing LevelDOWN for this: require('leveldown').destroy()
module.exports.destroy = utilStatic('destroy')
// DEPRECATED: prefer accessing LevelDOWN for this: require('leveldown').repair()
Expand Down
3 changes: 2 additions & 1 deletion test/batch-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
* MIT License <https://github.com/rvagg/node-levelup/blob/master/LICENSE.md>
*/

var errors = require('../lib/errors.js')
var levelup = require('../lib/levelup')
, errors = levelup.errors
, async = require('async')
, common = require('./common')

Expand Down
3 changes: 3 additions & 0 deletions test/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,11 @@ var referee = require('referee')
, path = require('path')
, delayed = require('delayed').delayed
, levelup = require('../lib/levelup.js')
, errors = require('../lib/errors')
, dbidx = 0

assert(levelup.errors === errors);

referee.add('isInstanceOf', {
assert: function (actual, expected) {
return actual instanceof expected
Expand Down
3 changes: 2 additions & 1 deletion test/get-put-del-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
* MIT License <https://github.com/rvagg/node-levelup/blob/master/LICENSE.md>
*/

var errors = require('../lib/errors.js')
var levelup = require('../lib/levelup.js')
, errors = levelup.errors
, async = require('async')
, common = require('./common')

Expand Down
2 changes: 1 addition & 1 deletion test/init-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/

var levelup = require('../lib/levelup.js')
, errors = require('../lib/errors.js')
, errors = levelup.errors
, fs = require('fs')
, common = require('./common')

Expand Down
2 changes: 1 addition & 1 deletion test/null-and-undefined-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/

var levelup = require('../lib/levelup.js')
, errors = require('../lib/errors.js')
, errors = levelup.errors
, common = require('./common')

, assert = require('referee').assert
Expand Down
5 changes: 3 additions & 2 deletions test/optional-leveldown-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
* MIT License <https://github.com/rvagg/node-levelup/blob/master/LICENSE.md>
*/

var assert = require('referee').assert
var levelup = require('../lib/levelup')
, assert = require('referee').assert
, refute = require('referee').refute
, buster = require('bustermove')
, errors = require('../lib/errors')
, errors = levelup.errors

function clearCache () {
delete require.cache[require.resolve('..')]
Expand Down

0 comments on commit b0247a4

Please sign in to comment.