monkey patch memdown to allow save empty strings

This commit is contained in:
oleg 2015-12-03 22:08:46 +03:00
parent e2f8ac3070
commit db281c8b65
2 changed files with 11 additions and 4 deletions

13
app.js
View File

@ -180,9 +180,16 @@ Steppy(
logger.log('Server config:', JSON.stringify(app.config, null, 4)); logger.log('Server config:', JSON.stringify(app.config, null, 4));
db.init(app.config.paths.db, { var dbBackend = require(app.config.storage.backend);
db: require(app.config.storage.backend)
}, this.slot()); // monkey patch memdown to allow save empty strings which is correct
// at general but occasionally not allowed at _checkKey
// https://github.com/Level/abstract-leveldown/issues/74
if (app.config.storage.backend === 'memdown') {
dbBackend.prototype._checkKey = _.noop;
}
db.init(app.config.paths.db, {db: dbBackend}, this.slot());
}, },
function() { function() {
// load all projects for the first time // load all projects for the first time

View File

@ -62,7 +62,7 @@
"gulp-react-jade-amd": "git://github.com/vladimir-polyakov/gulp-react-jade-amd", "gulp-react-jade-amd": "git://github.com/vladimir-polyakov/gulp-react-jade-amd",
"jade": "1.11.0", "jade": "1.11.0",
"main-bower-files": "2.7.0", "main-bower-files": "2.7.0",
"memdown": "1.0.0", "memdown": "1.1.0",
"mocha": "1.18.2", "mocha": "1.18.2",
"nci-yaml-reader": "0.1.0", "nci-yaml-reader": "0.1.0",
"nodemon": "1.3.7", "nodemon": "1.3.7",