From b9916c5ba42197166540217a2e0bffc6aec47aae Mon Sep 17 00:00:00 2001 From: Rod Vagg Date: Sat, 12 Oct 2013 20:33:00 +1100 Subject: [PATCH] @0.17.0-4, fix repair/destroy, remove copy --- level-packager.js | 12 ++++++++++-- package.json | 2 +- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/level-packager.js b/level-packager.js index c2ad293..3eac6c8 100644 --- a/level-packager.js +++ b/level-packager.js @@ -12,8 +12,16 @@ function packager (leveldown) { return levelup(location, options, callback) } - 'copy destroy repair'.split(' ').forEach(function (m) { - Level[m] = levelup[m] + [ 'destroy', 'repair' ].forEach(function (m) { + if (typeof leveldown[m] == 'function') { + console.log('we have a', m) + Level[m] = function (location, callback) { + leveldown[m](location, callback || function () {}) + } + } else { + console.error('leveldown has no method:', m) + console.error(leveldown) + } }) return Level diff --git a/package.json b/package.json index fbc88a2..dfe7683 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name" : "level-packager" , "description" : "LevelUP package helper for distributing with a LevelDOWN-compatible back-end" - , "version" : "0.17.0-3" + , "version" : "0.17.0-4" , "contributors" : [ "Rod Vagg (https://github.com/rvagg)" , "John Chesley (https://github.com/chesles/)"