Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
start: function (PouchDB) {
// add PouchDB.new() - by default it just returns 'new PouchDB()'
// also re-adds PouchDB.destroy(), see for reasoning:
// https://github.com/pouchdb/express-pouchdb/pull/231#issuecomment-136095649
wrappers.installStaticWrapperMethods(PouchDB, {});
return Promise.resolve().then(function () {
return PouchDB.allDbs();
}).catch(function () {
require('pouchdb-all-dbs')(PouchDB);
});
}
});
start: function (PouchDB) {
// PouchDB.allDbs() should return the non-uri encoded db name
wrappers.installStaticWrapperMethods(PouchDB, {
allDbs: function (orig) {
return orig().then(function (dbs) {
return dbs.map(decodeURIComponent);
});
}
});
}
});
xhr.open('GET', url + '_all_dbs');
xhr.send();
});
};
var HTTPPouchDB = PouchDB.defaults(extend({}, opts, {
prefix: url
}));
// https://github.com/marten-de-vries/http-pouchdb/issues/1
HTTPPouchDB.adapters.http.use_prefix = false;
/* istanbul ignore next */
// noop that can be 'wrapped' soon
HTTPPouchDB.allDbs = function () {};
wrappers.installStaticWrapperMethods(HTTPPouchDB, api);
HTTPPouchDB.isHTTPPouchDB = true;
return HTTPPouchDB;
};